buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
protected ShardExistsResponse shardOperation(ShardExistsRequest request) throws ElasticsearchException { IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex()); IndexShard indexShard = indexService.shardSafe(request.shardId().id()); SearchShardTarget shard...
protected ShardExistsResponse shardOperation(ShardExistsRequest request) throws ElasticsearchException { IndexService indexService = indicesService.indexServiceSafe(request.shardId().getIndex()); IndexShard indexShard = indexService.shardSafe(request.shardId().id()); SearchShardTarget shard...
protected ExplainResponse shardOperation(ExplainRequest request, ShardId shardId) throws ElasticsearchException { IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex()); IndexShard indexShard = indexService.shardSafe(shardId.id()); Term uidTerm = new Term(UidFieldMap...
protected ExplainResponse shardOperation(ExplainRequest request, ShardId shardId) throws ElasticsearchException { IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex()); IndexShard indexShard = indexService.shardSafe(shardId.id()); Term uidTerm = new Term(UidFieldMap...
public Texture newTexture (FileHandle file, TextureFilter minFilter, TextureFilter magFilter, TextureWrap uWrap, TextureWrap vWrap) { Pixmap pixmap = newPixmap(file); if (!isPowerOfTwo(pixmap.getHeight()) || !isPowerOfTwo(pixmap.getWidth())) throw new GdxRuntimeException("Texture dimensions must be a power of...
public Texture newTexture (FileHandle file, TextureFilter minFilter, TextureFilter magFilter, TextureWrap uWrap, TextureWrap vWrap) { Pixmap pixmap = newPixmap(file); if (!isPowerOfTwo(pixmap.getHeight()) || !isPowerOfTwo(pixmap.getWidth())) throw new GdxRuntimeException("Texture dimensions must be a power of...
@Override public void create () { // sound = Gdx.audio.newSound(Gdx.files.getFileHandle("data/shotgun.wav", FileType.Internal)); sound = Gdx.audio.newSound(Gdx.files.getFileHandle("data/test2_notwork.wav", FileType.Internal)); // music = Gdx.audio.newMusic(Gdx.files.internal("data/cloudconnected.ogg")); music...
@Override public void create () { // sound = Gdx.audio.newSound(Gdx.files.getFileHandle("data/shotgun.wav", FileType.Internal)); sound = Gdx.audio.newSound(Gdx.files.getFileHandle("data/sell_buy_item.wav", FileType.Internal)); // music = Gdx.audio.newMusic(Gdx.files.internal("data/cloudconnected.ogg")); music...
public boolean isOver (Actor actor, float x, float y) { Actor hit = actor.hit(x, y); 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.isDescendant(actor)) { if (touchDownX == -1 && touchDownY == -1) return false; return Math.abs(x - touchDownX) < tapSquareSize && Math.abs(y - touchDownY) < tapSquareSize; } return true; }
public TextBounds getMultiLineBounds (CharSequence str) { int start = 0; float maxWidth = 0; int numLines = 0; int length = str.length(); while (start < length) { int lineEnd = indexOf(str, '\n', start); float lineWidth = getBounds(str, start, lineEnd).width; maxWidth = Math.max(maxWidth, lineWidth)...
public TextBounds getMultiLineBounds (CharSequence str) { int start = 0; float maxWidth = 0; int numLines = 0; int length = str.length(); while (start < length) { int lineEnd = indexOf(str, '\n', start); float lineWidth = getBounds(str, start, lineEnd).width; maxWidth = Math.max(maxWidth, lineWidth)...
public void setText (String text) { this.text = text; TextBounds bounds = style.font.getMultiLineBounds(text); cache.setMultiLineText(text, 0, bounds.height); prefWidth = bounds.width; prefHeight = bounds.height; invalidateHierarchy(); }
public void setText (String text) { this.text = text; TextBounds bounds = style.font.getMultiLineBounds(text); cache.setMultiLineText(text, 0, bounds.height); prefWidth = bounds.width; prefHeight = bounds.height - style.font.getDescent(); // Centers text in the label. invalidateHierarchy(); }
public void build (String outputDir, String appName, String packageName, String mainClass, String sdkLocation, CharCallback callback) { Project project = new Project(); String packageDir = packageName.replace('.', '/'); String sdkPath = sdkLocation.replace('\\', '/'); if(!isSdkLocationValid(sdkLocation)) { ...
public void build (String outputDir, String appName, String packageName, String mainClass, String sdkLocation, CharCallback callback) { Project project = new Project(); String packageDir = packageName.replace('.', '/'); String sdkPath = sdkLocation.replace('\\', '/'); if(!isSdkLocationValid(sdkLocation)) { ...
protected void drawChildren (SpriteBatch batch, float parentAlpha) { parentAlpha *= color.a; if (cullingArea != null) { if (transform) { for (int i = 0; i < children.size(); i++) { Actor child = children.get(i); if (!child.visible) continue; if (child.x <= cullingArea.x + cullingArea.width &&...
protected void drawChildren (SpriteBatch batch, float parentAlpha) { parentAlpha *= color.a; if (cullingArea != null) { if (transform) { for (int i = 0; i < children.size(); i++) { Actor child = children.get(i); if (!child.visible) continue; if (child.x <= cullingArea.x + cullingArea.width &&...
public void create() { // Create an empty dynamic pixmap pixmap = new Pixmap (800, 480, Pixmap.Format.RGBA8888); // Pixmap.Format.RGBA8888); // Create a texture to contain the pixmap texture = new Texture (1024, 1024, Pixmap.Format.RGBA8888); //Pixmap.Format.RGBA8888); texture.setFilter...
public void create() { // Create an empty dynamic pixmap pixmap = new Pixmap (800, 480, Pixmap.Format.RGBA8888); // Pixmap.Format.RGBA8888); // Create a texture to contain the pixmap texture = new Texture (1024, 1024, Pixmap.Format.RGBA8888); //Pixmap.Format.RGBA8888); texture.setFilter...
public AbstractStringTermsAggregator(String name, AggregatorFactories factories, long estimatedBucketsCount, AggregationContext context, Aggregator parent, InternalOrder order, BucketCountThresholds bucketCountThresholds, SubAggCollectionMode subAggCollectMode, boolean showTermDocCountError)...
public AbstractStringTermsAggregator(String name, AggregatorFactories factories, long estimatedBucketsCount, AggregationContext context, Aggregator parent, Terms.Order order, BucketCountThresholds bucketCountThresholds, SubAggCollectionMode subAggCollectMode, boolean showTermDocCountError) {...
public DoubleTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, @Nullable ValueFormat format, long estimatedBucketCount, InternalOrder order, BucketCountThresholds bucketCountThresholds, AggregationContext aggregationContext, Aggregator pare...
public DoubleTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, @Nullable ValueFormat format, long estimatedBucketCount, Terms.Order order, BucketCountThresholds bucketCountThresholds, AggregationContext aggregationContext, Aggregator parent...
public LongTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, @Nullable ValueFormat format, long estimatedBucketCount, InternalOrder order, BucketCountThresholds bucketCountThresholds, AggregationContext aggregationContext, Aggregator parent...
public LongTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, @Nullable ValueFormat format, long estimatedBucketCount, Terms.Order order, BucketCountThresholds bucketCountThresholds, AggregationContext aggregationContext, Aggregator parent, ...
public StringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource, long estimatedBucketCount, InternalOrder order, BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude, AggregationContext aggrega...
public StringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource, long estimatedBucketCount, Terms.Order order, BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude, AggregationContext aggregati...
public static InetAddress getFirstNonLoopbackAddress(NetworkInterface intf, StackType ipVersion) throws SocketException { if (intf == null) throw new IllegalArgumentException("Network interface pointer is null"); for (Enumeration addresses = intf.getInetAddresses(); addresses.hasMoreEle...
public static InetAddress getFirstNonLoopbackAddress(NetworkInterface intf, StackType ipVersion) throws SocketException { if (intf == null) throw new IllegalArgumentException("Network interface pointer is null"); for (Enumeration addresses = intf.getInetAddresses(); addresses.hasMoreEle...
public CustomScoreQueryBuilder params(Map<String, Object> params) { if (params == null) { this.params = params; } else { this.params.putAll(params); } return this; }
public CustomScoreQueryBuilder params(Map<String, Object> params) { if (this.params == null) { this.params = params; } else { this.params.putAll(params); } return this; }
public ScriptFilterBuilder params(Map<String, Object> params) { if (params == null) { this.params = params; } else { this.params.putAll(params); } return this; }
public ScriptFilterBuilder params(Map<String, Object> params) { if (this.params == null) { this.params = params; } else { this.params.putAll(params); } return this; }
@Override public void connectToNode(DiscoveryNode node) { if (!lifecycle.started()) { throw new ElasticSearchIllegalStateException("Can't add nodes to a stopped transport"); } if (node == null) { throw new ConnectTransportException(node, "Can't connect to a null node"...
@Override public void connectToNode(DiscoveryNode node) { if (!lifecycle.started()) { throw new ElasticSearchIllegalStateException("Can't add nodes to a stopped transport"); } if (node == null) { throw new ConnectTransportException(null, "Can't connect to a null node"...
public String getFormatString () { switch (format) { case GDX2D_FORMAT_ALPHA: return "alpha"; case GDX2D_FORMAT_LUMINANCE_ALPHA: return "luminance alpha"; case GDX2D_FORMAT_RGB888: return "rgb888"; case GDX2D_FORMAT_RGBA8888: return "rgba8888"; case GDX2D_FORMAT_RGB565: return "rgb565"; ca...
public String getFormatString () { switch (format) { case GDX2D_FORMAT_ALPHA: return "alpha"; case GDX2D_FORMAT_LUMINANCE_ALPHA: return "luminance alpha"; case GDX2D_FORMAT_RGB888: return "rgb888"; case GDX2D_FORMAT_RGBA8888: return "rgba8888"; case GDX2D_FORMAT_RGB565: return "rgb565"; ca...
public static Pixmap decodeImage (ETC1Data etc1Data, Format format) { int dataOffset = 0; int width = 0; int height = 0; if (etc1Data.hasPKMHeader()) { dataOffset = 16; width = ETC1.getWidthPKM(etc1Data.compressedData, 0); height = ETC1.getHeightPKM(etc1Data.compressedData, 0); } else { dataOffs...
public static Pixmap decodeImage (ETC1Data etc1Data, Format format) { int dataOffset = 0; int width = 0; int height = 0; if (etc1Data.hasPKMHeader()) { dataOffset = 16; width = ETC1.getWidthPKM(etc1Data.compressedData, 0); height = ETC1.getHeightPKM(etc1Data.compressedData, 0); } else { dataOffs...
public void release() { try { lock.release(); } catch (IOException e) { logger.warn("failed to release snapshot lock [{}]", e, lock); } } }
public void release() { try { lock.close(); } catch (IOException e) { logger.warn("failed to release snapshot lock [{}]", e, lock); } } }
public int compareTo(Object light) { return (((PointLight) light).priority > this.priority) ? -1 : 1; }
public int compareTo(Object light) { return (((PointLight) light).priority < this.priority) ? -1 : 1; }
public org.elasticsearch.index.fielddata.FieldDataType fieldDataType2() { throw new ElasticSearchIllegalArgumentException("not implemented"); }
public org.elasticsearch.index.fielddata.FieldDataType fieldDataType2() { return new org.elasticsearch.index.fielddata.FieldDataType("float"); }
public Mesh(boolean isStatic, int maxVertices, int maxIndices, VertexAttribute... attributes) { if (Gdx.gl11 != null || Gdx.gl20 != null) { vertices = new VertexBufferObject(isStatic, maxVertices, attributes); indices = new IndexBufferObject(isStatic, maxIndices); isVertexArray = false; } else { ver...
public Mesh(boolean isStatic, int maxVertices, int maxIndices, VertexAttribute... attributes) { if (isStatic && (Gdx.gl11 != null || Gdx.gl20 != null)) { vertices = new VertexBufferObject(isStatic, maxVertices, attributes); indices = new IndexBufferObject(isStatic, maxIndices); isVertexArray = false; }...
private void flush() { drawing = false; lightManager.applyAmbient(shader); // do actual drawing // frustum culling for all point lights (sphere) @lightMananger // find N nearest lights per model // draw for opaque queu for (int i = 0; i < stillModelQueue.size; i++) { final StillModelInstance instan...
private void flush() { drawing = false; lightManager.applyGlobalLights(shader); // do actual drawing // frustum culling for all point lights (sphere) @lightMananger // find N nearest lights per model // draw for opaque queu for (int i = 0; i < stillModelQueue.size; i++) { final StillModelInstance i...
private byte[] extractSource(Document doc, DocumentMapper documentMapper) { byte[] source = null; Fieldable sourceField = doc.getFieldable(documentMapper.sourceMapper().names().indexName()); if (sourceField != null) { source = documentMapper.sourceMapper().value(sourceField); ...
private byte[] extractSource(Document doc, DocumentMapper documentMapper) { byte[] source = null; Fieldable sourceField = doc.getFieldable(documentMapper.sourceMapper().names().indexName()); if (sourceField != null) { source = documentMapper.sourceMapper().nativeValue(sourceField...
private byte[] extractSource(Document doc, DocumentMapper documentMapper) { Fieldable sourceField = doc.getFieldable(SourceFieldMapper.NAME); if (sourceField != null) { return documentMapper.sourceMapper().value(sourceField); } return null; }
private byte[] extractSource(Document doc, DocumentMapper documentMapper) { Fieldable sourceField = doc.getFieldable(SourceFieldMapper.NAME); if (sourceField != null) { return documentMapper.sourceMapper().nativeValue(sourceField); } return null; }
protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new MyGdxGame(), config); }
protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new MultitouchTest(), config); }
public JoglSound (JoglAudio audio, JoglFileHandle file) throws UnsupportedAudioFileException, IOException { this.audio = audio; InputStream fin = new BufferedInputStream(file.readFile()); AudioInputStream ain = AudioSystem.getAudioInputStream(fin); AudioFormat baseFormat = ain.getFormat(); AudioFormat decode...
public JoglSound (JoglAudio audio, JoglFileHandle file) throws UnsupportedAudioFileException, IOException { this.audio = audio; InputStream fin = new BufferedInputStream(file.read()); AudioInputStream ain = AudioSystem.getAudioInputStream(fin); AudioFormat baseFormat = ain.getFormat(); AudioFormat decodedFor...
Object execute(int docId, Map<String, Object> vars); /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the...
Object execute(int docId, Map<String, Object> vars); /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the...
String[] names(); /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache License, Version 2.0 (the ...
String[] names(); /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache License, Version 2.0 (the ...
public RecoverySettings(Settings settings, NodeSettingsService nodeSettingsService) { super(settings); this.fileChunkSize = componentSettings.getAsBytesSize("file_chunk_size", settings.getAsBytesSize("index.shard.recovery.file_chunk_size", new ByteSizeValue(512, ByteSizeUnit.KB))); this.tra...
public RecoverySettings(Settings settings, NodeSettingsService nodeSettingsService) { super(settings); this.fileChunkSize = componentSettings.getAsBytesSize("file_chunk_size", settings.getAsBytesSize("index.shard.recovery.file_chunk_size", new ByteSizeValue(512, ByteSizeUnit.KB))); this.tra...
public TransportNodesShutdownAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, Node node, ClusterName clusterName) { super(settings, transportService, clusterService, threadPool); this.node = nod...
public TransportNodesShutdownAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, Node node, ClusterName clusterName) { super(settings, transportService, clusterService, threadPool); this.node = nod...
@Inject public PathHierarchyTokenizerFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name, settings); bufferSize = settings.getAsInt("buffer_size", 1024); String delimiter = settings.get("delimiter"...
@Inject public PathHierarchyTokenizerFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name, settings); bufferSize = settings.getAsInt("buffer_size", 1024); String delimiter = settings.get("delimiter"...
public static CommitPoint fromXContent(byte[] data) throws Exception { XContentParser parser = XContentFactory.xContent(XContentType.JSON).createParser(data); try { String currentFieldName = null; XContentParser.Token token = parser.nextToken(); if (token == null)...
public static CommitPoint fromXContent(byte[] data) throws Exception { XContentParser parser = XContentFactory.xContent(XContentType.JSON).createParser(data); try { String currentFieldName = null; XContentParser.Token token = parser.nextToken(); if (token == null)...
public CommitPoint findCommitPoint(int shardId) throws IOException { ImmutableBlobContainer container = blobStore.immutableBlobContainer(shardPath(shardId)); ImmutableMap<String, BlobMetaData> blobs = container.listBlobs(); List<CommitPoint> commitPointsList = Lists.newArrayList(); f...
public CommitPoint findCommitPoint(int shardId) throws IOException { ImmutableBlobContainer container = blobStore.immutableBlobContainer(shardPath(shardId)); ImmutableMap<String, BlobMetaData> blobs = container.listBlobs(); List<CommitPoint> commitPointsList = Lists.newArrayList(); f...
public ScriptDocValues getScriptValues() { return ScriptDocValues.EMPTY; }
public ScriptDocValues getScriptValues() { return ScriptDocValues.EMPTY_GEOPOINTS; }
public ScriptDocValues getScriptValues() { return ScriptDocValues.EMPTY; } }
public ScriptDocValues getScriptValues() { return ScriptDocValues.EMPTY_DOUBLES; } }
public ScriptDocValues getScriptValues() { return ScriptDocValues.EMPTY; } }
public ScriptDocValues getScriptValues() { return ScriptDocValues.EMPTY_LONGS; } }
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException { final Bundle bundle = new Bundle(); if (!authTokenType.equals(ACCOUNT_TYPE)) return bundle; AccountMa...
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException { final Bundle bundle = new Bundle(); if (!ACCOUNT_TYPE.equals(authTokenType)) return bundle; AccountMa...
protected void clicked (Object object) { System.out.println("Chosen: " + object); } }.text("Are you enjoying this demo?").button("Yes", true).button("No", false).key(Keys.ENTER, true) .key(Keys.ESCAPE, false).show(stage, 0.4f); } }); }
protected void clicked (Object object) { System.out.println("Chosen: " + object); } }.text("Are you enjoying this demo?").button("Yes", true).button("No", false).key(Keys.ENTER, true) .key(Keys.ESCAPE, false).show(stage); } }); }
public static byte[] parseQuerySource(RestRequest request) { String queryString = request.param("q"); if (queryString == null) { throw new ElasticSearchIllegalArgumentException("No query to execute, not in body, and not bounded to 'q' parameter"); } QueryStringQueryBuilde...
public static byte[] parseQuerySource(RestRequest request) { String queryString = request.param("q"); if (queryString == null) { return null; } QueryStringQueryBuilder queryBuilder = QueryBuilders.queryString(queryString); queryBuilder.defaultField(request.param("...
public org.elasticsearch.index.fielddata.FieldDataType fieldDataType2() { throw new ElasticSearchIllegalArgumentException("not implemented"); }
public org.elasticsearch.index.fielddata.FieldDataType fieldDataType2() { return new org.elasticsearch.index.fielddata.FieldDataType("byte"); }
import org.elasticsearch.index.shard.service.IndexShard; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under...
import org.elasticsearch.index.shard.service.IndexShard; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under...
public JavaSoundAudioDevice (int samplingRate, boolean isMono) { this.isMono = isMono; try { AudioFormat format = new AudioFormat(samplingRate, 16, isMono ? 1 : 2, true, false); line = AudioSystem.getSourceDataLine(format); line.open(format, Math.min(2048, samplingRate / 5) * 2); line.start(); } cat...
public JavaSoundAudioDevice (int samplingRate, boolean isMono) { this.isMono = isMono; try { AudioFormat format = new AudioFormat(samplingRate, 16, isMono ? 1 : 2, true, false); line = AudioSystem.getSourceDataLine(format); line.open(format, 2048 * 10);// Math.min(2048*10, samplingRate / 5) * 2); line...
public void testSimpleFacetEmptyFilterFacet() throws Exception { createIndex("test"); ensureGreen(); client().prepareIndex("test", "type1").setSource(jsonBuilder().startObject() .field("tag", "green") .endObject()).execute().actionGet(); refresh(); ...
public void testSimpleFacetEmptyFilterFacet() throws Exception { createIndex("test"); ensureGreen(); client().prepareIndex("test", "type1").setSource(jsonBuilder().startObject() .field("tag", "green") .endObject()).execute().actionGet(); refresh(); ...
@Override protected MappingUpdatedResponse masterOperation(MappingUpdatedRequest request, ClusterState state) throws ElasticSearchException { try { metaDataMappingService.updateMapping(request.index(), request.type(), request.mappingSource()); } catch (IOException e) { throw ...
@Override protected MappingUpdatedResponse masterOperation(MappingUpdatedRequest request, ClusterState state) throws ElasticSearchException { try { metaDataMappingService.updateMapping(request.index(), request.type(), request.mappingSource()); } catch (Exception e) { throw ne...
public void create () { Gdx.app.log("MD5 Test", "created"); model = MD5Loader.loadModel(Gdx.files.internal("data/zfat.md5mesh").read(), false); anim = MD5Loader.loadAnimation(Gdx.files.internal("data/walk1.md5anim").read()); skeleton = new MD5Joints(); skeleton.joints = new float[anim.frames[0].joints.length...
public void create () { Gdx.app.log("MD5 Test", "created"); model = MD5Loader.loadModel(Gdx.files.internal("data/zfat.md5mesh").read(), true); anim = MD5Loader.loadAnimation(Gdx.files.internal("data/walk1.md5anim").read()); skeleton = new MD5Joints(); skeleton.joints = new float[anim.frames[0].joints.length]...
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src/", "bin/", "jni/"); BuildConfig buildConfig = new BuildConfig("gdx-controllers-desktop"); String[] windowsSrc = {"*.cpp", "ois-v1-4svn/src/*.cpp", "ois-v1-4svn/src/win32/*.cpp" }; String[] linuxSrc ...
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src/", "bin/", "jni/"); BuildConfig buildConfig = new BuildConfig("gdx-controllers-desktop"); String[] windowsSrc = {"*.cpp", "ois-v1-4svn/src/*.cpp", "ois-v1-4svn/src/win32/*.cpp" }; String[] linuxSrc ...
@Test public void testPrimaryNotRelocatedWhileBeingRecoveredFrom() { ShardsAllocation strategy = new ShardsAllocation(settingsBuilder().put("cluster.routing.allocation.concurrent_recoveries", 10).build()); logger.info("Building initial routing table"); MetaData metaData = newMetaDataBuilde...
@Test public void testPrimaryNotRelocatedWhileBeingRecoveredFrom() { ShardsAllocation strategy = new ShardsAllocation(settingsBuilder().put("cluster.routing.allocation.concurrent_recoveries", 10).build()); logger.info("Building initial routing table"); MetaData metaData = newMetaDataBuilde...
@Test public void testBackupIsAllocatedAfterPrimary() { ShardsAllocation strategy = new ShardsAllocation(settingsBuilder().put("cluster.routing.allocation.concurrent_recoveries", 10).build()); logger.info("Building initial routing table"); MetaData metaData = newMetaDataBuilder() ...
@Test public void testBackupIsAllocatedAfterPrimary() { ShardsAllocation strategy = new ShardsAllocation(settingsBuilder().put("cluster.routing.allocation.concurrent_recoveries", 10).build()); logger.info("Building initial routing table"); MetaData metaData = newMetaDataBuilder() ...
public TmxMapLoader() {
protected static int unsignedByteToInt (byte b) { return (int) b & 0xFF; } }
public ScriptScoreFunction(String sScript, Map<String, Object> params, SearchScript script) { super(CombineFunction.PLAIN); this.sScript = sScript; this.params = params; this.script = script; }
public ScriptScoreFunction(String sScript, Map<String, Object> params, SearchScript script) { super(CombineFunction.REPLACE); this.sScript = sScript; this.params = params; this.script = script; }
private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo, NodesStatsResponse nodesStats) { boolean fullId = req.paramAsBoolean("full_id", false); String masterId = state.getState().nodes().masterNodeId(); Table table = new Table(); table.sta...
private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo, NodesStatsResponse nodesStats) { boolean fullId = req.paramAsBoolean("full_id", false); String masterId = state.getState().nodes().masterNodeId(); Table table = new Table(); table.sta...
@Inject public IndicesStore(Settings settings, NodeEnvironment nodeEnv, IndicesService indicesService, ClusterService clusterService) { super(settings); this.nodeEnv = nodeEnv; this.indicesService = indicesService; this.clusterService = clusterService; clusterService.add(this...
@Inject public IndicesStore(Settings settings, NodeEnvironment nodeEnv, IndicesService indicesService, ClusterService clusterService) { super(settings); this.nodeEnv = nodeEnv; this.indicesService = indicesService; this.clusterService = clusterService; clusterService.addLast(...
public MultiSearchRequest add(BytesReference data, boolean contentUnsafe, @Nullable String[] indices, @Nullable String[] types, @Nullable String searchType, IgnoreIndices ignoreIndices) throws Exception { XContent xContent = XContentFactory.xContent(data); int from ...
public MultiSearchRequest add(BytesReference data, boolean contentUnsafe, @Nullable String[] indices, @Nullable String[] types, @Nullable String searchType, IgnoreIndices ignoreIndices) throws Exception { XContent xContent = XContentFactory.xContent(data); int from ...
public void draw (SpriteBatch batch, float parentAlpha) { validate(); super.drawChildren(batch, parentAlpha); }
public void draw (SpriteBatch batch, float parentAlpha) { validate(); super.draw(batch, parentAlpha); }
@Override protected PutMappingResponse masterOperation(PutMappingRequest request) throws ElasticSearchException { ClusterState clusterState = clusterService.state(); // update to concrete indices request.indices(clusterState.metaData().concreteIndices(request.indices())); final Stri...
@Override protected PutMappingResponse masterOperation(PutMappingRequest request) throws ElasticSearchException { ClusterState clusterState = clusterService.state(); // update to concrete indices request.indices(clusterState.metaData().concreteIndices(request.indices())); final Stri...
@Test public void testSnapshotOperations() throws Exception { node("server1").start(); // Translog tests logger.info("Creating index [{}]", "test"); client("server1").admin().indices().create(createIndexRequest("test")).actionGet(); // create a mapping PutMappingRe...
@Test public void testSnapshotOperations() throws Exception { node("server1").start(); // Translog tests logger.info("Creating index [{}]", "test"); client("server1").admin().indices().create(createIndexRequest("test")).actionGet(); // create a mapping PutMappingRe...
@BeforeClass public void createNodes() throws Exception { startNode("server1"); startNode("server2"); client = getClient(); client.admin().indices().create(createIndexRequest("test")).actionGet(); logger.info("Update mapping (_all to store and have term vectors)"); ...
@BeforeClass public void createNodes() throws Exception { startNode("server1"); startNode("server2"); client = getClient(); client.admin().indices().create(createIndexRequest("test")).actionGet(); logger.info("Update mapping (_all to store and have term vectors)"); ...
@Test public void testSimpleAttachment() throws Exception { String mapping = copyToStringFromClasspath("/org/elasticsearch/plugin/attachments/index/mapper/test-mapping.json"); node.client().admin().indices().putMapping(putMappingRequest("test").mappingSource(mapping)).actionGet(); node.cli...
@Test public void testSimpleAttachment() throws Exception { String mapping = copyToStringFromClasspath("/org/elasticsearch/plugin/attachments/index/mapper/test-mapping.json"); node.client().admin().indices().putMapping(putMappingRequest("test").source(mapping)).actionGet(); node.client().i...
private static native ByteBuffer load (long[] nativeData, byte[] buffer, int offset, int len, int requestedFormat); /*MANUAL const unsigned char* p_buffer = (const unsigned char*)env->GetPrimitiveArrayCritical(buffer, 0); gdx2d_pixmap* pixmap = gdx2d_load(p_buffer, len, requestedFormat); env->ReleasePrimitiveAr...
private static native ByteBuffer load (long[] nativeData, byte[] buffer, int offset, int len, int requestedFormat); /*MANUAL const unsigned char* p_buffer = (const unsigned char*)env->GetPrimitiveArrayCritical(buffer, 0); gdx2d_pixmap* pixmap = gdx2d_load(p_buffer + offset, len, requestedFormat); env->ReleasePr...
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("openChannels", serverOpenChannels); pipeline.addLast("decoder", new TextMemcachedDecoder()); pipeline.addLast("d...
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("openChannels", serverOpenChannels); pipeline.addLast("decoder", new MemcachedDecoder()); pipeline.addLast("dispa...
@Override protected TransportRequestOptions options() { return TransportRequestOptions.options().withCompress(true); }
@Override protected TransportRequestOptions options() { return TransportRequestOptions.options().withLowType().withCompress(true); }
public NodeEnvironment(Settings settings, Environment environment) { super(settings); if (!DiscoveryNode.nodeRequiresLocalStorage(settings)) { nodeFiles = null; nodeIndicesLocations = null; locks = null; localNodeId = -1; return; }...
public NodeEnvironment(Settings settings, Environment environment) { super(settings); if (!DiscoveryNode.nodeRequiresLocalStorage(settings)) { nodeFiles = null; nodeIndicesLocations = null; locks = null; localNodeId = -1; return; }...
private void updateFiles(Gist gist) { for (View header : fileHeaders) list.removeHeaderView(header); fileHeaders.clear(); Map<String, GistFile> files = gist.getFiles(); if (files == null || files.isEmpty()) return; Activity activity = getActivity(); ...
private void updateFiles(Gist gist) { for (View header : fileHeaders) list.removeHeaderView(header); fileHeaders.clear(); Map<String, GistFile> files = gist.getFiles(); if (files == null || files.isEmpty()) return; Activity activity = getActivity(); ...
public JsonQueryParserRegistry(Index index, @IndexSettings Settings indexSettings, AnalysisService analysisService, @Nullable Iterable<JsonQueryParser> queryParsers, @Nullable ...
public JsonQueryParserRegistry(Index index, @IndexSettings Settings indexSettings, AnalysisService analysisService, @Nullable Iterable<JsonQueryParser> queryParsers, @Nullable ...
public InternalNode(Settings pSettings, boolean loadConfigSettings) throws ElasticSearchException { Tuple<Settings, Environment> tuple = InternalSettingsPerparer.prepareSettings(pSettings, loadConfigSettings); Version version = Version.CURRENT; ESLogger logger = Loggers.getLogger(Node.clas...
public InternalNode(Settings pSettings, boolean loadConfigSettings) throws ElasticSearchException { Tuple<Settings, Environment> tuple = InternalSettingsPreparer.prepareSettings(pSettings, loadConfigSettings); Version version = Version.CURRENT; ESLogger logger = Loggers.getLogger(Node.clas...
public ThreadPool(Settings settings, @Nullable NodeSettingsService nodeSettingsService) { super(settings); Map<String, Settings> groupSettings = settings.getGroups(THREADPOOL_GROUP); int availableProcessors = Runtime.getRuntime().availableProcessors(); int halfProcMaxAt5 = Math.min...
public ThreadPool(Settings settings, @Nullable NodeSettingsService nodeSettingsService) { super(settings); Map<String, Settings> groupSettings = settings.getGroups(THREADPOOL_GROUP); int availableProcessors = Runtime.getRuntime().availableProcessors(); int halfProcMaxAt5 = Math.min...
public static String VERSION = "0.81"; }
public static String VERSION = "0.9"; }
public void glUniformMatrix4fv(int location, int count, boolean transpose, FloatBuffer value) { gl.glUniformMatrix2x4fv( location, count, transpose, value ); }
public void glUniformMatrix4fv(int location, int count, boolean transpose, FloatBuffer value) { gl.glUniformMatrix4fv( location, count, transpose, value ); }
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 double addEstimateBytesAndMaybeBreak(long bytes, String label) throws CircuitBreakingException { // short-circuit on no data allowed, immediately throwing an exception if (memoryBytesLimit == 0) { circuitBreak(label, bytes); } long newUsed; // If there is ...
public double addEstimateBytesAndMaybeBreak(long bytes, String label) throws CircuitBreakingException { // short-circuit on no data allowed, immediately throwing an exception if (memoryBytesLimit == 0) { circuitBreak(label, bytes); } long newUsed; // If there is ...
public RestPercolateAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/{index}/{type}/_percolate", this); controller.registerHandler(POST, "/{index}/{type}/_percolate", this); RestPercolateExistingDocHandl...
public RestPercolateAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/{index}/{type}/_percolate", this); controller.registerHandler(POST, "/{index}/{type}/_percolate", this); RestPercolateExistingDocHandl...
public static Throwable unwrapCause(Throwable t) { int counter = 0; Throwable result = t; while (result instanceof ElasticSearchWrapperException) { if (result.getCause() == null) { return result; } if (result.getCause() == result) { ...
public static Throwable unwrapCause(Throwable t) { int counter = 0; Throwable result = t; while (result instanceof ElasticSearchWrapperException) { if (result.getCause() == null) { return result; } if (result.getCause() == result) { ...
public Shape build() { final Geometry geometry; if(wrapdateline) { ArrayList<LineString> parts = new ArrayList<LineString>(); for (BaseLineStringBuilder<?> line : lines) { BaseLineStringBuilder.decompose(FACTORY, line.coordinates(false), parts); } ...
public Shape build() { final Geometry geometry; if(wrapdateline) { ArrayList<LineString> parts = new ArrayList<LineString>(); for (BaseLineStringBuilder<?> line : lines) { BaseLineStringBuilder.decompose(FACTORY, line.coordinates(false), parts); } ...
public boolean release() { boolean success = false; try { super.release(); success = true; } finally { Releasables.release(success, bytes, hashes); } return true; }
public boolean release() { boolean success = false; try { super.release(); success = true; } finally { Releasables.release(success, bytes, hashes, startOffsets); } return true; }
public TextBounds setWrappedText (CharSequence str, float x, float y, float wrapWidth, HAlignment alignment) { BitmapFont font = this.font; int length = str.length(); reset(length); y += font.data.ascent; float down = font.data.down; if (wrapWidth <= 0) wrapWidth = Integer.MAX_VALUE; float maxWidth = ...
public TextBounds setWrappedText (CharSequence str, float x, float y, float wrapWidth, HAlignment alignment) { BitmapFont font = this.font; int length = str.length(); reset(length); y += font.data.ascent; float down = font.data.down; if (wrapWidth <= 0) wrapWidth = Integer.MAX_VALUE; float maxWidth = ...
private void innerClose() { if (closed) { return; } indexSettingsService.removeListener(applySettings); closed = true; this.versionMap.clear(); this.failedEngineListeners.clear(); try { try { IOUtils.close(searcherManage...
private void innerClose() { if (closed) { return; } indexSettingsService.removeListener(applySettings); closed = true; this.versionMap.clear(); this.failedEngineListeners.clear(); try { try { IOUtils.close(searcherManage...
static private boolean nativesLoaded = false; /** * loads the necessary libraries depending on the operating system */ static void load () { GdxNativesLoader.load(); if(GdxNativesLoader.disableNativesLoading) return; if (nativesLoaded) return; NativeLibLoader.disableLoading(); com.sun.gluegen.runtim...
public static void load () { GdxNativesLoader.load(); if(GdxNativesLoader.disableNativesLoading) return; if (nativesLoaded) return; NativeLibLoader.disableLoading(); com.sun.gluegen.runtime.NativeLibLoader.disableLoading(); // By wkien: On some systems (read: mine) jogl_awt would not find its // depend...
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 void main (String[] argv) { JoglApplicationConfiguration config = new JoglApplicationConfiguration(); config.useGL20 = true; config.vSyncEnabled = false; new JoglApplication(new com.badlogic.gdx.tests.InputTest(), config); }
public static void main (String[] argv) { JoglApplicationConfiguration config = new JoglApplicationConfiguration(); config.useGL20 = true; config.vSyncEnabled = false; new JoglApplication(new com.badlogic.gdx.tests.UITest(), config); }
@Inject public CouchdbRiver(RiverName riverName, RiverSettings settings, @RiverIndexName String riverIndexName, Client client) { super(riverName, settings); this.riverIndexName = riverIndexName; this.client = client; if (settings.settings().containsKey("couchdb")) { Map<...
@Inject public CouchdbRiver(RiverName riverName, RiverSettings settings, @RiverIndexName String riverIndexName, Client client) { super(riverName, settings); this.riverIndexName = riverIndexName; this.client = client; if (settings.settings().containsKey("couchdb")) { Map<...
public FilterListAdapter(LayoutInflater inflater, IssueFilter[] elements, AvatarLoader avatars) { super(layout.issue_filter_item, inflater, elements); this.avatars = avatars; }
public FilterListAdapter(LayoutInflater inflater, IssueFilter[] elements, AvatarLoader avatars) { super(layout.issues_filter_item, inflater, elements); this.avatars = avatars; }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(layout.issue_filter_list); ActionBar actionBar = getSupportActionBar(); actionBar.setTitle(string.bookmarks); actionBar.setIcon(drawable.action_bookmark); actionB...
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(layout.issues_filter_list); ActionBar actionBar = getSupportActionBar(); actionBar.setTitle(string.bookmarks); actionBar.setIcon(drawable.action_bookmark); action...
public void setRenderListener(RenderListener listener) { synchronized( this ) { if( this.listener != null ) listener.dispose( app ); this.listener = listener; } }
public void setRenderListener(RenderListener listener) { synchronized( this ) { if( this.listener != null ) this.listener.dispose( app ); this.listener = listener; } }
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case id.dashboard_issues: startActivity(new Intent(this, IssueDashboardActivity.class)); return true; case id.gists: startActivity(new Intent(this, GistsActivity.class)); ...
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case id.dashboard_issues: startActivity(new Intent(this, IssueDashboardActivity.class)); return true; case id.gists: startActivity(new Intent(this, GistsActivity.class)); ...
public void onActivityResult(int requestCode, int resultCode, Intent data) { if ((requestCode == GIST_CREATE || requestCode == GIST_VIEW) && RESULT_OK == resultCode) { refresh(); return; } super.onActivityResult(requestCode, resultCode, data); }
public void onActivityResult(int requestCode, int resultCode, Intent data) { if ((requestCode == GIST_CREATE || requestCode == GIST_VIEW) && RESULT_OK == resultCode) { forceReload(); return; } super.onActivityResult(requestCode, resultCode, data); }
public void testRandom() throws Exception { boolean omitNorms = false; boolean stored = false; boolean enabled = true; boolean autoBoost = false; boolean tv_stored = false; boolean tv_payloads = false; boolean tv_offsets = false; boolean tv_positions =...
public void testRandom() throws Exception { boolean omitNorms = false; boolean stored = false; boolean enabled = true; boolean autoBoost = false; boolean tv_stored = false; boolean tv_payloads = false; boolean tv_offsets = false; boolean tv_positions =...
Class<? extends DirectoryService> shardDirectory(); /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the ...
Class<? extends DirectoryService> shardDirectory(); /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { byte value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { byte value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String dateAsString = null; Long value = null; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (e...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String dateAsString = null; Long value = null; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (e...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { long value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { long value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { short value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { short value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if...
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException { ValueAndBoost valueAndBoost = StringFieldMapper.parseCreateFieldForString(context, null /* Out null value is an int so we convert*/, boost); if (valueAndBoost.value() == null && nullValue() == null) { ...
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException { ValueAndBoost valueAndBoost = StringFieldMapper.parseCreateFieldForString(context, null /* Out null value is an int so we convert*/, boost); if (valueAndBoost.value() == null && nullValue() == null) { ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String ipAsString; if (context.externalValueSet()) { ipAsString = (String) context.externalValue(); if (ipAsString == null) { ipAsString = nullValue; ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String ipAsString; if (context.externalValueSet()) { ipAsString = (String) context.externalValue(); if (ipAsString == null) { ipAsString = nullValue; ...
public FieldDataBreakerStats stats() { return new FieldDataBreakerStats(breaker.getMaximum(), breaker.getUsed(), breaker.getOverhead()); }
public FieldDataBreakerStats stats() { return new FieldDataBreakerStats(breaker.getMaximum(), breaker.getUsed(), breaker.getOverhead(), breaker.getTrippedCount()); }
public FieldDataBreakerStats stats() { return new FieldDataBreakerStats(-1, -1, 0); }
public FieldDataBreakerStats stats() { return new FieldDataBreakerStats(-1, -1, 0, 0); }
public void setupSecondCluster() { // create another cluster cluster2 = new TestCluster(randomLong(), 2, cluster().getClusterName() + "-2"); cluster2.beforeTest(getRandom(), getPerTestTransportClientRatio()); cluster2.ensureAtLeastNumNodes(2); Settings settings = ImmutableSe...
public void setupSecondCluster() { // create another cluster cluster2 = new TestCluster(randomLong(), 2, 2, cluster().getClusterName() + "-2"); cluster2.beforeTest(getRandom(), getPerTestTransportClientRatio()); cluster2.ensureAtLeastNumNodes(2); Settings settings = Immutabl...
public void show(Reference selectedRef) { if (refs == null) { load(selectedRef); return; } final ArrayList<Reference> users = new ArrayList<Reference>( refs.values()); int checked = -1; if (selectedRef != null) for (int i =...
public void show(Reference selectedRef) { if (refs == null || refs.isEmpty()) { load(selectedRef); return; } final ArrayList<Reference> users = new ArrayList<Reference>( refs.values()); int checked = -1; if (selectedRef != null) ...