buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public IndexShardException(ShardId shardId, String msg, Throwable cause) { super(shardId.index(), "Shard[" + shardId.id() + "] " + msg, cause); this.shardId = shardId; }
public IndexShardException(ShardId shardId, String msg, Throwable cause) { super(shardId.index(), false, "[" + shardId.id() + "] " + msg, cause); this.shardId = shardId; }
protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); config.useAccelerometer = false; return new IOSApplication(new BulletTestCollection(), config); }
protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); config.useAccelerometer = false; return new IOSApplication(new InputTest(), config); }
private static VertexAttribute[] createVertexAttributes (boolean hasNormals, int uvs) { VertexAttribute[] attributes = new VertexAttribute[1 + (hasNormals?1:0) + uvs]; int idx = 0; attributes[idx++] = new VertexAttribute(Usage.Position, 3, ShaderProgram.POSITION_ATTRIBUTE); if(hasNormals) attributes[idx++] = n...
private static VertexAttribute[] createVertexAttributes (boolean hasNormals, int uvs) { VertexAttribute[] attributes = new VertexAttribute[1 + (hasNormals?1:0) + uvs]; int idx = 0; attributes[idx++] = new VertexAttribute(Usage.Position, 3, ShaderProgram.POSITION_ATTRIBUTE); if(hasNormals) attributes[idx++] = n...
private KeyframedModel buildModel (MD2Header header, MD2Triangle[] triangles, float[] texCoords, MD2Frame[] frames, float frameDuration) { ArrayList<VertexIndices> vertCombos = new ArrayList<VertexIndices>(); short[] indices = new short[triangles.length * 3]; int idx = 0; short vertIdx = 0; for (int i = 0; i...
private KeyframedModel buildModel (MD2Header header, MD2Triangle[] triangles, float[] texCoords, MD2Frame[] frames, float frameDuration) { ArrayList<VertexIndices> vertCombos = new ArrayList<VertexIndices>(); short[] indices = new short[triangles.length * 3]; int idx = 0; short vertIdx = 0; for (int i = 0; i...
private SkeletonSubMesh[] generateSubMeshes(Mesh ogreMesh) { List<Submesh> ogreSubmeshes = ogreMesh.getSubmeshes().getSubmesh(); SkeletonSubMesh[] submeshes = new SkeletonSubMesh[ogreSubmeshes.size()]; for(int i = 0; i < ogreSubmeshes.size(); i++) { Submesh ogreSubmesh = ogreSubmeshes.get(i); boolean ...
private SkeletonSubMesh[] generateSubMeshes(Mesh ogreMesh) { List<Submesh> ogreSubmeshes = ogreMesh.getSubmeshes().getSubmesh(); SkeletonSubMesh[] submeshes = new SkeletonSubMesh[ogreSubmeshes.size()]; for(int i = 0; i < ogreSubmeshes.size(); i++) { Submesh ogreSubmesh = ogreSubmeshes.get(i); boolean ...
public StillModel loadObj(FileHandle file, boolean flipV) { String line; String[] tokens; char firstChar; // Create a "default" Group and set it as the active group, in case // there are no groups or objects defined in the OBJ file. Group activeGroup = new Group("default"); groups.add(activeGroup); B...
public StillModel loadObj(FileHandle file, boolean flipV) { String line; String[] tokens; char firstChar; // Create a "default" Group and set it as the active group, in case // there are no groups or objects defined in the OBJ file. Group activeGroup = new Group("default"); groups.add(activeGroup); B...
public static Mesh loadObjFromString (String obj, boolean flipV) { String[] lines = obj.split("\n"); float[] vertices = new float[lines.length * 3]; float[] normals = new float[lines.length * 3]; float[] uv = new float[lines.length * 3]; int numVertices = 0; int numNormals = 0; int numUV = 0; int numF...
public static Mesh loadObjFromString (String obj, boolean flipV) { String[] lines = obj.split("\n"); float[] vertices = new float[lines.length * 3]; float[] normals = new float[lines.length * 3]; float[] uv = new float[lines.length * 3]; int numVertices = 0; int numNormals = 0; int numUV = 0; int numF...
public void draw (SpriteBatch batch, float parentAlpha) { final NinePatch backgroundPatch = style.background; final BitmapFont titleFont = style.titleFont; final Color titleFontColor = style.titleFontColor; layout(); applyTransform(batch); calculateBoundsAndScissors(batch.getTransformMatrix()); batch.s...
public void draw (SpriteBatch batch, float parentAlpha) { final NinePatch backgroundPatch = style.background; final BitmapFont titleFont = style.titleFont; final Color titleFontColor = style.titleFontColor; validate(); applyTransform(batch); calculateBoundsAndScissors(batch.getTransformMatrix()); batch...
public TranslogService(ShardId shardId, @IndexSettings Settings indexSettings, IndexSettingsService indexSettingsService, ThreadPool threadPool, IndexShard indexShard, Translog translog) { super(shardId, indexSettings); this.threadPool = threadPool; this.indexSettingsService = indexSettingsS...
public TranslogService(ShardId shardId, @IndexSettings Settings indexSettings, IndexSettingsService indexSettingsService, ThreadPool threadPool, IndexShard indexShard, Translog translog) { super(shardId, indexSettings); this.threadPool = threadPool; this.indexSettingsService = indexSettingsS...
private final static ImmutableMap<Tuple<String, String>, IndexFieldData.Builder> buildersByTypeAndFormat; static { buildersByType = MapBuilder.<String, IndexFieldData.Builder>newMapBuilder() .put("string", new ConcreteBytesRefIndexFieldData.Builder()) .put("float", new F...
private final static ImmutableMap<Tuple<String, String>, IndexFieldData.Builder> buildersByTypeAndFormat; static { buildersByType = MapBuilder.<String, IndexFieldData.Builder>newMapBuilder() .put("string", new ConcreteBytesRefIndexFieldData.Builder()) .put("float", new F...
public void read (short[] samples, int offset, int numSamples) { if (buffer.length < numSamples * 2) buffer = new byte[numSamples * 2]; int toRead = numSamples * 2; int read = 0; while (read != toRead) read += line.read(buffer, read, toRead - read); for (int i = 0, j = 0; i < numSamples * 2; i += 2, j++...
public void read (short[] samples, int offset, int numSamples) { if (buffer.length < numSamples * 2) buffer = new byte[numSamples * 2]; int toRead = numSamples * 2; int read = 0; while (read != toRead) read += line.read(buffer, read, toRead - read); for (int i = 0, j = 0; i < numSamples * 2; i += 2, j++...
public static void main(String[] args) { System.out.println("ElasticSearch Version: " + Version.CURRENT + "JVM: " + JvmInfo.jvmInfo().vmVersion()); }
public static void main(String[] args) { System.out.println("ElasticSearch Version: " + Version.CURRENT + ", JVM: " + JvmInfo.jvmInfo().vmVersion()); }
private static void assign(Edge[] holes, Coordinate[][] points, int numHoles, Edge[] edges, ArrayList<ArrayList<Coordinate[]>> components) { // Assign Hole to related components // To find the new component the hole belongs to all intersections of the // polygon edges with a vertical line ar...
private static void assign(Edge[] holes, Coordinate[][] points, int numHoles, Edge[] edges, ArrayList<ArrayList<Coordinate[]>> components) { // Assign Hole to related components // To find the new component the hole belongs to all intersections of the // polygon edges with a vertical line ar...
public static void main (String[] argv) { // this is only here for me to debug native code faster new SharedLibraryLoader("../../gdx/libs/gdx-natives.jar").load("gdx"); new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio"); GdxTest test = new Mpg123Test(); Lwjg...
public static void main (String[] argv) { // this is only here for me to debug native code faster new SharedLibraryLoader("../../gdx/libs/gdx-natives.jar").load("gdx"); new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio"); GdxTest test = new WavTest(); LwjglAp...
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...
public static final FormatDateTimeFormatter[] DYNAMIC_DATE_TIME_FORMATTERS = new FormatDateTimeFormatter[]{ DateFieldMapper.Defaults.DATE_TIME_FORMATTER, Joda.forPattern("yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z") };
public static final FormatDateTimeFormatter[] DYNAMIC_DATE_TIME_FORMATTERS = new FormatDateTimeFormatter[]{ DateFieldMapper.Defaults.DATE_TIME_FORMATTER, Joda.forPattern("yyyy/MM/dd HH:mm:ss||yyyy/MM/dd") };
public void testBulkAllowExplicitIndex() throws Exception { String bulkAction = copyToStringFromClasspath("/org/elasticsearch/action/bulk/simple-bulk.json"); try { new BulkRequest().add(new BytesArray(bulkAction.getBytes(Charsets.UTF_8)), true, null, null, false); assert fals...
public void testBulkAllowExplicitIndex() throws Exception { String bulkAction = copyToStringFromClasspath("/org/elasticsearch/action/bulk/simple-bulk.json"); try { new BulkRequest().add(new BytesArray(bulkAction.getBytes(Charsets.UTF_8)), true, null, null, false); fail(); ...
public void testRandomPayloadWithDelimitedPayloadTokenFilter() throws ElasticsearchException, IOException { //create the test document int encoding = randomIntBetween(0, 2); String encodingString = ""; if (encoding == 0) { encodingString = "float"; } ...
public void testRandomPayloadWithDelimitedPayloadTokenFilter() throws ElasticsearchException, IOException { //create the test document int encoding = randomIntBetween(0, 2); String encodingString = ""; if (encoding == 0) { encodingString = "float"; } ...
public void testUpdateSettingsValidation() throws Exception { String master = cluster().startNode(settingsBuilder().put("node.data", false).build()); String node_1 = cluster().startNode(settingsBuilder().put("node.master", false).build()); String node_2 = cluster().startNode(settingsBuilder(...
public void testUpdateSettingsValidation() throws Exception { String master = cluster().startNode(settingsBuilder().put("node.data", false).build()); String node_1 = cluster().startNode(settingsBuilder().put("node.master", false).build()); String node_2 = cluster().startNode(settingsBuilder(...
public void addListener(Listener listener) { assert listeners[0] == null; listeners[0] = listener; } }; BalancedShardsAllocator allocator = new BalancedShardsAllocator(settings.build(), service); assertThat(allocator.getIndexBalance(), Mat...
public void addListener(Listener listener) { assertNull("addListener was called twice while only one time was expected", listeners[0]); listeners[0] = listener; } }; BalancedShardsAllocator allocator = new BalancedShardsAllocator(settings.build(),...
public void testMultipleIndicesAllocation() throws Exception { client().admin().indices().prepareCreate("test1").setSettings(settingsBuilder() .put("index.number_of_shards", "4").put("index.number_of_replicas", 1)).execute().actionGet(); client().admin().indices().prepareCreate("test...
public void testMultipleIndicesAllocation() throws Exception { client().admin().indices().prepareCreate("test1").setSettings(settingsBuilder() .put("index.number_of_shards", "4").put("index.number_of_replicas", 1)).execute().actionGet(); client().admin().indices().prepareCreate("test...
public void run() { executed3.set(true); } }); assert false : "should be rejected..."; } catch (EsRejectedExecutionException e) { // all is well } wait.countDown(); exec1Wait.await(); exec2W...
public void run() { executed3.set(true); } }); fail("should be rejected..."); } catch (EsRejectedExecutionException e) { // all is well } wait.countDown(); exec1Wait.await(); exec2Wait.await...
protected boolean isPersistentStorage() { assert storeType != null; return "fs".equals(settings.get().get("index.store.type")); }
protected boolean isPersistentStorage() { assertNotNull(storeType); return "fs".equals(settings.get().get("index.store.type")); }
public void testUnknownAliasFilter() throws Exception { IndexAliasesService indexAliasesService = newIndexAliasesService(); indexAliasesService.add("cats", filter(termFilter("animal", "cat"))); indexAliasesService.add("dogs", filter(termFilter("animal", "dog"))); try { i...
public void testUnknownAliasFilter() throws Exception { IndexAliasesService indexAliasesService = newIndexAliasesService(); indexAliasesService.add("cats", filter(termFilter("animal", "cat"))); indexAliasesService.add("dogs", filter(termFilter("animal", "dog"))); try { i...
public void testDeletedDocuments() throws Exception { SimpleIdCache idCache = createSimpleIdCache(Tuple.tuple("child", "parent")); IndexWriter writer = createIndexWriter(); // Begins with parent, ends with child docs final Document parent = doc("parent", "1"); writer.addDocum...
public void testDeletedDocuments() throws Exception { SimpleIdCache idCache = createSimpleIdCache(Tuple.tuple("child", "parent")); IndexWriter writer = createIndexWriter(); // Begins with parent, ends with child docs final Document parent = doc("parent", "1"); writer.addDocum...
public void testNestedSorting(SortMode sortMode) throws IOException { final String[] values = new String[randomIntBetween(2, 20)]; for (int i = 0; i < values.length; ++i) { values[i] = _TestUtil.randomSimpleString(getRandom()); } final int numParents = atLeast(100); ...
public void testNestedSorting(SortMode sortMode) throws IOException { final String[] values = new String[randomIntBetween(2, 20)]; for (int i = 0; i < values.length; ++i) { values[i] = _TestUtil.randomSimpleString(getRandom()); } final int numParents = atLeast(100); ...
public void testParseLocal() { assertThat(Locale.GERMAN, equalTo(DateFieldMapper.parseLocale("de"))); assertThat(Locale.GERMANY, equalTo(DateFieldMapper.parseLocale("de_DE"))); assertThat(new Locale("de","DE","DE"), equalTo(DateFieldMapper.parseLocale("de_DE_DE"))); try { ...
public void testParseLocal() { assertThat(Locale.GERMAN, equalTo(DateFieldMapper.parseLocale("de"))); assertThat(Locale.GERMANY, equalTo(DateFieldMapper.parseLocale("de_DE"))); assertThat(new Locale("de","DE","DE"), equalTo(DateFieldMapper.parseLocale("de_DE_DE"))); try { ...
public void simpleIdTests() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .endObject().endObject().string(); DocumentMapper docMapper = MapperTestUtils.newParser().parse(mapping); ParsedDocument doc = docMapper.parse("typ...
public void simpleIdTests() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .endObject().endObject().string(); DocumentMapper docMapper = MapperTestUtils.newParser().parse(mapping); ParsedDocument doc = docMapper.parse("typ...
public void testDifferentInnerObjectTokenFailure() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .endObject().endObject().string(); DocumentMapper defaultMapper = MapperTestUtils.newParser().parse(mapping); try { ...
public void testDifferentInnerObjectTokenFailure() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .endObject().endObject().string(); DocumentMapper defaultMapper = MapperTestUtils.newParser().parse(mapping); try { ...
public void testRandom() throws Exception { Directory directory = newDirectory(); RandomIndexWriter indexWriter = new RandomIndexWriter(random(), directory); int numUniqueParentValues = 1 + random().nextInt(TEST_NIGHTLY ? 6000 : 600); String[] parentValues = new String[numUniqueParen...
public void testRandom() throws Exception { Directory directory = newDirectory(); RandomIndexWriter indexWriter = new RandomIndexWriter(random(), directory); int numUniqueParentValues = 1 + random().nextInt(TEST_NIGHTLY ? 6000 : 600); String[] parentValues = new String[numUniqueParen...
public void testOpenCloseUpdateSettings() throws Exception { createIndex("test"); try { client().admin().indices().prepareUpdateSettings("test") .setSettings(ImmutableSettings.settingsBuilder() .put("index.refresh_interval", -1) // this one...
public void testOpenCloseUpdateSettings() throws Exception { createIndex("test"); try { client().admin().indices().prepareUpdateSettings("test") .setSettings(ImmutableSettings.settingsBuilder() .put("index.refresh_interval", -1) // this one...
public static String[] convertFromTextArray(PercolateResponse.Match[] matches, String index) { if (matches.length == 0) { return Strings.EMPTY_ARRAY; } String[] strings = new String[matches.length]; for (int i = 0; i < matches.length; i++) { assert index.equal...
public static String[] convertFromTextArray(PercolateResponse.Match[] matches, String index) { if (matches.length == 0) { return Strings.EMPTY_ARRAY; } String[] strings = new String[matches.length]; for (int i = 0; i < matches.length; i++) { assertEquals(index...
private void checkValueInEachDoc(int value, String script, int numExpectedDocs) { SearchResponse sr = client().prepareSearch("test").setQuery(QueryBuilders.matchAllQuery()).addScriptField("tvtest", script) .execute().actionGet(); ElasticsearchAssertions.assertHitCount(sr, numExpected...
private void checkValueInEachDoc(int value, String script, int numExpectedDocs) { SearchResponse sr = client().prepareSearch("test").setQuery(QueryBuilders.matchAllQuery()).addScriptField("tvtest", script) .execute().actionGet(); ElasticsearchAssertions.assertHitCount(sr, numExpected...
public void init() throws Exception { prepareCreate("idx") .addMapping("type", "nested", "type=nested") .setSettings(indexSettings()) .execute().actionGet(); List<IndexRequestBuilder> builders = new ArrayList<IndexRequestBuilder>(); numParent...
public void init() throws Exception { prepareCreate("idx") .addMapping("type", "nested", "type=nested") .setSettings(indexSettings()) .execute().actionGet(); List<IndexRequestBuilder> builders = new ArrayList<IndexRequestBuilder>(); numParent...
public void testFailedSearchWithWrongQuery() throws Exception { prepareData(); logger.info("Start Testing failed search with wrong query"); try { SearchResponse searchResponse = client().search(searchRequest("test").source("{ xxx }".getBytes(Charsets.UTF_8))).actionGet(); ...
public void testFailedSearchWithWrongQuery() throws Exception { prepareData(); logger.info("Start Testing failed search with wrong query"); try { SearchResponse searchResponse = client().search(searchRequest("test").source("{ xxx }".getBytes(Charsets.UTF_8))).actionGet(); ...
public void testIndicesBoost() throws Exception { ElasticsearchAssertions.assertHitCount(client().prepareSearch().setQuery(termQuery("test", "value")).get(), 0); try { client().prepareSearch("test").setQuery(termQuery("test", "value")).execute().actionGet(); assert false : "...
public void testIndicesBoost() throws Exception { ElasticsearchAssertions.assertHitCount(client().prepareSearch().setQuery(termQuery("test", "value")).get(), 0); try { client().prepareSearch("test").setQuery(termQuery("test", "value")).execute().actionGet(); fail("should fai...
public void testIssue2986() { prepareCreate("test").setSettings(indexSettings()).execute().actionGet(); client().prepareIndex("test", "post", "1").setSource("{\"field1\":\"value1\"}").execute().actionGet(); client().prepareIndex("test", "post", "2").setSource("{\"field1\":\"value2\"}").exec...
public void testIssue2986() { prepareCreate("test").setSettings(indexSettings()).execute().actionGet(); client().prepareIndex("test", "post", "1").setSource("{\"field1\":\"value1\"}").execute().actionGet(); client().prepareIndex("test", "post", "2").setSource("{\"field1\":\"value2\"}").exec...
public final void before() throws IOException { assert Thread.getDefaultUncaughtExceptionHandler() instanceof ElasticsearchUncaughtExceptionHandler; try { final Scope currentClusterScope = getCurrentClusterScope(); switch (currentClusterScope) { case GLOBAL: ...
public final void before() throws IOException { assert Thread.getDefaultUncaughtExceptionHandler() instanceof ElasticsearchUncaughtExceptionHandler; try { final Scope currentClusterScope = getCurrentClusterScope(); switch (currentClusterScope) { case GLOBAL: ...
public void testConnectException() { try { serviceA.connectToNode(new DiscoveryNode("C", new InetSocketTransportAddress("localhost", 9876), Version.CURRENT)); assert false; } catch (ConnectTransportException e) { // e.printStackTrace(); // all is well ...
public void testConnectException() { try { serviceA.connectToNode(new DiscoveryNode("C", new InetSocketTransportAddress("localhost", 9876), Version.CURRENT)); fail(); } catch (ConnectTransportException e) { // e.printStackTrace(); // all is well ...
public void testUpdate() throws Exception { createIndex(); ensureGreen(); try { client().prepareUpdate("test", "type1", "1").setScript("ctx._source.field++").execute().actionGet(); assert false; } catch (DocumentMissingException e) { // all is wel...
public void testUpdate() throws Exception { createIndex(); ensureGreen(); try { client().prepareUpdate("test", "type1", "1").setScript("ctx._source.field++").execute().actionGet(); fail(); } catch (DocumentMissingException e) { // all is well ...
@Override public Query parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); // move to the field value String queryString = null; String defaultField = null; MapperQueryParser.Operator defaultOperator = Que...
@Override public Query parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); // move to the field value String queryString = null; String defaultField = null; MapperQueryParser.Operator defaultOperator = Que...
private byte[] parseSearchSource(RestRequest request) { SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); String queryString = request.param("q"); if (queryString != null) { QueryStringJsonQueryBuilder queryBuilder = JsonQueryBuilders.queryString(queryString); ...
private byte[] parseSearchSource(RestRequest request) { SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); String queryString = request.param("q"); if (queryString != null) { QueryStringJsonQueryBuilder queryBuilder = JsonQueryBuilders.queryString(queryString); ...
public static InternalSearchRequest internalSearchRequest(ShardRouting shardRouting, int numberOfShards, SearchRequest request) { InternalSearchRequest internalRequest = new InternalSearchRequest(shardRouting, numberOfShards); internalRequest.source(request.source(), request.sourceOffset(), request....
public static InternalSearchRequest internalSearchRequest(ShardRouting shardRouting, int numberOfShards, SearchRequest request) { InternalSearchRequest internalRequest = new InternalSearchRequest(shardRouting, numberOfShards, request.searchType()); internalRequest.source(request.source(), request.so...
public void onListItemClick(ListView l, View v, int position, long id) { Event event = (Event) l.getItemAtPosition(position); Issue issue = issueMatcher.getIssue(event); if (issue != null) startActivity(ViewIssuesActivity.createIntent(issue)); Gist gist = gistMatcher.get...
public void onListItemClick(ListView l, View v, int position, long id) { Event event = (Event) l.getItemAtPosition(position); Issue issue = issueMatcher.getIssue(event); if (issue != null && (issue.getPullRequest() == null || issue.getPullRequest().getHtmlUrl() == null)) startAct...
public ShardClearIndicesCacheRequest(String index, int shardId, ClearIndicesCacheRequest request) { super(index, shardId); filterCache = request.filterCache(); fieldDataCache = request.fieldDataCache(); idCache = request.idCache(); bloomCache = request.bloomCache(); f...
public ShardClearIndicesCacheRequest(String index, int shardId, ClearIndicesCacheRequest request) { super(index, shardId, request); filterCache = request.filterCache(); fieldDataCache = request.fieldDataCache(); idCache = request.idCache(); bloomCache = request.bloomCache(); ...
public ShardFlushRequest(String index, int shardId, FlushRequest request) { super(index, shardId); this.refresh = request.refresh(); this.full = request.full(); this.force = request.force(); }
public ShardFlushRequest(String index, int shardId, FlushRequest request) { super(index, shardId, request); this.refresh = request.refresh(); this.full = request.full(); this.force = request.force(); }
protected ShardGatewaySnapshotRequest newShardRequest(ShardRouting shard, GatewaySnapshotRequest request) { return new ShardGatewaySnapshotRequest(shard.index(), shard.id()); }
protected ShardGatewaySnapshotRequest newShardRequest(ShardRouting shard, GatewaySnapshotRequest request) { return new ShardGatewaySnapshotRequest(shard.index(), shard.id(), request); }
public ShardRefreshRequest(String index, int shardId, RefreshRequest request) { super(index, shardId); waitForOperations = request.waitForOperations(); }
public ShardRefreshRequest(String index, int shardId, RefreshRequest request) { super(index, shardId, request); waitForOperations = request.waitForOperations(); }
public List<Vector2> computeTriangles(final List<Vector2> polygon) { // TODO Check if LinkedList performs better final ArrayList<Vector2> triangles = new ArrayList<Vector2>(); final ArrayList<Vector2> vertices = new ArrayList<Vector2>( polygon.size()); vertices.addAll(polygon); /* * ESpitz: For the s...
public List<Vector2> computeTriangles(final List<Vector2> polygon) { // TODO Check if LinkedList performs better final ArrayList<Vector2> triangles = new ArrayList<Vector2>(); final ArrayList<Vector2> vertices = new ArrayList<Vector2>( polygon.size()); vertices.addAll(polygon); /* * ESpitz: For the s...
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; boolean queryFound = false; String childType = null; int shortCircuitParentDocSet = 8192; // Tests show a cut of...
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; boolean queryFound = false; String childType = null; int shortCircuitParentDocSet = 8192; // Tests show a cut of...
public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query innerQuery = null; boolean queryFound = false; float boost = 1.0f; String childType = null; ScoreType scoreType = null;...
public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query innerQuery = null; boolean queryFound = false; float boost = 1.0f; String childType = null; ScoreType scoreType = null;...
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; boolean queryFound = false; String parentType = null; boolean cache = false; CacheKeyFilter.Key cacheKe...
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; boolean queryFound = false; String parentType = null; boolean cache = false; CacheKeyFilter.Key cacheKe...
public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query innerQuery = null; boolean queryFound = false; float boost = 1.0f; String parentType = null; boolean score = false; ...
public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query innerQuery = null; boolean queryFound = false; float boost = 1.0f; String parentType = null; boolean score = false; ...
@Test public void testAutoIpDetection() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .startObject("properties").endObject() .endObject().endObject().string(); XContentDocumentMapper defaultMapper = MapperTests.ne...
@Test public void testAutoIpDetection() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .startObject("properties").endObject() .endObject().endObject().string(); XContentDocumentMapper defaultMapper = MapperTests.ne...
public SearchContextMissingException(long id) { super("No search context found for id [" + id + "]"); this.id = id; }
public SearchContextMissingException(long id) { super("No search context found for id [" + id + "], timed out"); this.id = id; }
protected void onFinally() throws RuntimeException { helper.close(); }; }.execute(); }
protected void onFinally() throws RuntimeException { helper.close(); } }.execute(); }
public DefaultClient() { super(); useAcceptHeader = true; setSerializeNulls(false); setUserAgent("GitHubAndroid/1.0"); }
public DefaultClient() { super(); useAcceptHeader = true; setSerializeNulls(false); setUserAgent(USER_AGENT); }
@Override protected ShardTermsResponse shardOperation(ShardTermsRequest request) throws ElasticSearchException { IndexService indexService = indicesService.indexServiceSafe(request.index()); IndexShard shard = indexService.shard(request.shardId()); Engine.Searcher searcher = shard.searcher()...
@Override protected ShardTermsResponse shardOperation(ShardTermsRequest request) throws ElasticSearchException { IndexService indexService = indicesService.indexServiceSafe(request.index()); IndexShard shard = indexService.shard(request.shardId()); Engine.Searcher searcher = shard.searcher()...
public void add(FieldMappers fieldMappers) { for (FieldMapper fieldMapper : fieldMappers) { names.add(fieldMapper.indexName()); } }
public void add(FieldMappers fieldMappers) { for (FieldMapper fieldMapper : fieldMappers) { names.add(fieldMapper.names().indexName()); } }
public String indexName(String name) { MapperService.SmartNameFieldMappers smartMapper = smartFieldMappers(name); if (smartMapper == null) { return name; } if (smartMapper.fieldMappers().mapper() != null) { return smartMapper.fieldMappers().mapper().indexName(...
public String indexName(String name) { MapperService.SmartNameFieldMappers smartMapper = smartFieldMappers(name); if (smartMapper == null) { return name; } if (smartMapper.fieldMappers().mapper() != null) { return smartMapper.fieldMappers().mapper().names().in...
@Override public Filter parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.nextToken(); assert token == JsonToken.FIELD_NAME; String fieldName = jp.getCurrentName(); jp.nextToken(); ...
@Override public Filter parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.nextToken(); assert token == JsonToken.FIELD_NAME; String fieldName = jp.getCurrentName(); jp.nextToken(); ...
@Override public Query parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.nextToken(); assert token == JsonToken.FIELD_NAME; String fieldName = jp.getCurrentName(); String value = nu...
@Override public Query parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.nextToken(); assert token == JsonToken.FIELD_NAME; String fieldName = jp.getCurrentName(); String value = nu...
@Override public Query parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.getCurrentToken(); if (token == JsonToken.START_OBJECT) { token = jp.nextToken(); } assert token =...
@Override public Query parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.getCurrentToken(); if (token == JsonToken.START_OBJECT) { token = jp.nextToken(); } assert token =...
@Override public Filter parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.nextToken(); assert token == JsonToken.FIELD_NAME; String fieldName = jp.getCurrentName(); FieldMapper field...
@Override public Filter parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.nextToken(); assert token == JsonToken.FIELD_NAME; String fieldName = jp.getCurrentName(); FieldMapper field...
@Override public Query parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.nextToken(); assert token == JsonToken.FIELD_NAME; String fieldName = jp.getCurrentName(); String value = nu...
@Override public Query parse(JsonQueryParseContext parseContext) throws IOException, QueryParsingException { JsonParser jp = parseContext.jp(); JsonToken token = jp.nextToken(); assert token == JsonToken.FIELD_NAME; String fieldName = jp.getCurrentName(); String value = nu...
private void addSortField(SearchContext context, List<SortField> sortFields, String fieldName, boolean reverse, int type) { if ("score".equals(fieldName)) { if (reverse) { sortFields.add(SORT_SCORE_REVERSE); } else { sortFields.add(SORT_SCORE); ...
private void addSortField(SearchContext context, List<SortField> sortFields, String fieldName, boolean reverse, int type) { if ("score".equals(fieldName)) { if (reverse) { sortFields.add(SORT_SCORE_REVERSE); } else { sortFields.add(SORT_SCORE); ...
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 ...
new NoSuchMethodException(aspectClass.getName() + ".aspectOf(..) is not accessible public static"); } return method; } }
throw new NoSuchMethodException(aspectClass.getName() + ".aspectOf(..) is not accessible public static"); } return method; } }
public void setVisibleItemCount (int count) { checkWidget (); if (count < 0) return; visibleCount = count; if ((style & SWT.DROP_DOWN) != 0) { forceResize (); RECT rect = new RECT (); OS.GetWindowRect (handle, rect); int flags = OS.SWP_NOMOVE | OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE; setBo...
public void setVisibleItemCount (int count) { checkWidget (); if (count < 0) return; visibleCount = count; if ((style & SWT.DROP_DOWN) != 0) { forceResize (); RECT rect = new RECT (); OS.GetWindowRect (handle, rect); int flags = OS.SWP_NOMOVE | OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE; setBo...
public void setSelection (int value) { checkWidget (); int [] max = new int [1], min = new int [1]; OS.SendMessage (hwndUpDown , OS.UDM_GETRANGE32, min, max); value = Math.min (Math.max (min [0], value), max [0]); setSelection (value, false); } void setSelection (int value, boolean notify) { OS.SendMessage (hwnd...
public void setSelection (int value) { checkWidget (); int [] max = new int [1], min = new int [1]; OS.SendMessage (hwndUpDown , OS.UDM_GETRANGE32, min, max); value = Math.min (Math.max (min [0], value), max [0]); setSelection (value, false); } void setSelection (int value, boolean notify) { OS.SendMessage (hwnd...
protected void update() { // If state is dirty if (dirty) { if (log.isDebugEnabled()) { log.debug("update: Session is dirty. Replicating."); } // State is no longer dirty this.dirty = false; // Set attribute. setAttribute(SESSION_ATTRIBUTE_NAME, this); } else { if (log.isDeb...
protected void update() { // If state is dirty if (dirty) { if (log.isDebugEnabled()) { log.debug("update: Session is dirty. Replicating."); } // State is no longer dirty this.dirty = false; // Set attribute. setAttribute(SESSION_ATTRIBUTE_NAME, this); } else { if (log.isDeb...
protected void put(Page page) { if (!page.isStateless()) { String sessionId = getSession().getId(); if (sessionId != null) { if (lastPage != page) { lastPage = page; dirty(); } getStore().storePage(sessionId, page); } } }
protected void put(Page page) { if (!page.isPageStateless()) { String sessionId = getSession().getId(); if (sessionId != null) { if (lastPage != page) { lastPage = page; dirty(); } getStore().storePage(sessionId, page); } } }
protected File getSpecFile() { return new File( "../tests/src/org/aspectj/systemtest/ajc152/jdtlikehandleprovider.xml"); } }
protected File getSpecFile() { return new File( "../tests/src/org/aspectj/systemtest/ajc153/jdtlikehandleprovider.xml"); } }
public void testOverrideStringResourceLoaderSetup() { Application dummy = tester.getApplication(); Settings settings = new Settings(dummy); settings.addStringResourceLoader(new BundleStringResourceLoader( "wicket.resource.DummyResources")); settings.addStringResourceLoader(new ComponentStringResourceLoade...
public void testOverrideStringResourceLoaderSetup() { Application dummy = tester.getApplication(); Settings settings = new Settings(dummy); settings.addStringResourceLoader(new BundleStringResourceLoader( "wicket.resource.DummyResources")); settings.addStringResourceLoader(new ComponentStringResourceLoade...
private String visitResourceLoaders(final String key, final String path, final List searchStack, final Locale locale, final String style) { // Search each loader in turn and return the string if it is found final Iterator iterator = application.getResourceSettings().getStringResourceLoaders() .iterator(); ...
private String visitResourceLoaders(final String key, final String path, final List searchStack, final Locale locale, final String style) { // Search each loader in turn and return the string if it is found final Iterator iterator = application.getResourceSettings().getStringResourceLoaders() .iterator(); ...
public MarkupFragmentFinder() { } /** * Get the markup stream and position it at the component * * @param component * @return A MarkupStream which is positioned at the component */ final MarkupStream find(final Component< ? > component) { // Get the parent's associated markup stream. MarkupContain...
public MarkupFragmentFinder() { } /** * Get the markup stream and position it at the component * * @param component * @return A MarkupStream which is positioned at the component */ final MarkupStream find(final Component< ? > component) { // Get the parent's associated markup stream. MarkupContain...
protected Link< ? > newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { return new AjaxPagingNavigationLink(id, pageable, pageIndex); }
protected Link< ? > newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { return new AjaxPagingNavigationLink<Void>(id, pageable, pageIndex); }
protected Link< ? > newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { return new AjaxPagingNavigationLink(id, pageable, pageNumber); }
protected Link< ? > newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { return new AjaxPagingNavigationLink<Void>(id, pageable, pageNumber); }
public Class< ? extends Component> getComponentClass() { return Classes.resolveClass(componentClassName); } }
public Class< ? extends Component< ? >> getComponentClass() { return Classes.resolveClass(componentClassName); } }
public IRequestTarget newRequestTarget(Page page, Component< ? > component, RequestListenerInterface listener, RequestParameters requestParameters) { return new BehaviorRequestTarget(page, component, listener, requestParameters); } }; }
public IRequestTarget newRequestTarget(Page< ? > page, Component< ? > component, RequestListenerInterface listener, RequestParameters requestParameters) { return new BehaviorRequestTarget(page, component, listener, requestParameters); } }; }
public IRequestTarget newRequestTarget(Page page, Component< ? > component, RequestListenerInterface listener, RequestParameters requestParameters) { return new BehaviorRequestTarget(page, component, listener, requestParameters); } }; /** * Called when a request to a behavior is received. */ void on...
public IRequestTarget newRequestTarget(Page< ? > page, Component< ? > component, RequestListenerInterface listener, RequestParameters requestParameters) { return new BehaviorRequestTarget(page, component, listener, requestParameters); } }; /** * Called when a request to a behavior is received. */ vo...
public final List<FeedbackMessage> messages(final IFeedbackMessageFilter filter) { if (messages.size() == 0) { return Collections.EMPTY_LIST; } final List<FeedbackMessage> list = new ArrayList<FeedbackMessage>(); for (final Iterator<FeedbackMessage> iterator = messages.iterator(); iterator.hasNext();) ...
public final List<FeedbackMessage> messages(final IFeedbackMessageFilter filter) { if (messages.size() == 0) { return Collections.emptyList(); } final List<FeedbackMessage> list = new ArrayList<FeedbackMessage>(); for (final Iterator<FeedbackMessage> iterator = messages.iterator(); iterator.hasNext();) ...
public boolean accept(Node node); }
private DOMUtil(){ } /** * Filter interface to be applied when iterating over a DOM tree. * Just think of it like a <tt>FileFilter</tt> clone. */ public interface NodeFilter { /** * @param node the node to check for acceptance. * @return <tt>true</...
public static void fullSchemaChecking(XSGrammarBucket grammarBucket, SubstitutionGroupHandler SGHandler, CMBuilder cmBuilder, XMLErrorReporter errorReporter) { // get all grammars, a...
public static void fullSchemaChecking(XSGrammarBucket grammarBucket, SubstitutionGroupHandler SGHandler, CMBuilder cmBuilder, XMLErrorReporter errorReporter) { // get all grammars, a...
private Cookie save(Cookie cookie) { if (cookie == null) { return null; } else { final String comment = getSettings().getComment(); if (comment != null) { cookie.setComment(comment); } final String domain = getSettings().getDomain(); ...
private Cookie save(Cookie cookie) { if (cookie == null) { return null; } else { final String comment = getSettings().getComment(); if (comment != null) { cookie.setComment(comment); } final String domain = getSettings().getDomain(); ...
public SignInPage(final PageParameters parameters) { new SignInPanel(this,"signInPanel"); }
public SignInPage(final PageParameters parameters) { add(new SignInPanel("signInPanel")); }
public Index() { // normal link instead of an autolink as it looks a bit weird to refer // to PageWithCustomLoading.html while the template has got a very // different name (CustomLoadedTemplate.html) new BookmarkablePageLink(this, "customLoadingPageLink", PageWithCustomLoading.class); }
public Index() { // normal link instead of an autolink as it looks a bit weird to refer // to PageWithCustomLoading.html while the template has got a very // different name (CustomLoadedTemplate.html) add(new BookmarkablePageLink("customLoadingPageLink", PageWithCustomLoading.class)); }
public HelloWorld() { new Label(this, "message", "Hello World!"); }
public HelloWorld() { add(new Label("message", "Hello World!")); }
List allBreadCrumbParticipants(); /* * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17 * Mar 2006) $ * * ============================================================================== * Licensed under the Apa...
List allBreadCrumbParticipants(); /* * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17 * Mar 2006) $ * * ============================================================================== * Licensed under the Apa...
package wicket.extensions.markup.html.tree; package wicket.markup.html.tree; import javax.swing.tree.TreeNode; /** * Methods this interface are called when tree state is changing. * * @author Matej Knopp */ public interface ITreeStateListener { /** * Fired when all nodes are collapsed. */ void allNodesCol...
package wicket.extensions.markup.html.tree; package wicket.extensions.markup.html.tree; import javax.swing.tree.TreeNode; /** * Methods this interface are called when tree state is changing. * * @author Matej Knopp */ public interface ITreeStateListener { /** * Fired when all nodes are collapsed. */ void ...
Iterator stepIterator(); /* * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17 * Mar 2006) $ * * ============================================================================== * Licensed under the Apache Licen...
Iterator stepIterator(); /* * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17 * Mar 2006) $ * * ============================================================================== * Licensed under the Apache Licen...
public Home() { new Applet(this,"sprocket", new Model("foo"), SimpleApplet.class); }
public Home() { add(new Applet("sprocket", new Model("foo"), SimpleApplet.class)); }
package wicket.proxy.util; package wicket.extensions.proxy.util; /** * Tester object that is valid as long as equals/hashCode/toString have not been * called on it. * * @author Igor Vaynberg (ivaynberg) * */ public interface IObjectMethodTester { /** * @return true if object is valid, false otherwise */...
package wicket.proxy.util; package wicket.proxy.util; /** * Tester object that is valid as long as equals/hashCode/toString have not been * called on it. * * @author Igor Vaynberg (ivaynberg) * */ public interface IObjectMethodTester { /** * @return true if object is valid, false otherwise */ boolean i...
public AccessDeniedPortletPage() { new BookmarkablePageLink(this,"homePageLink",getApplication().getHomePage()); }
public AccessDeniedPortletPage() { add(new BookmarkablePageLink("homePageLink",getApplication().getHomePage())); }
public InternalErrorPortletPage() { new BookmarkablePageLink(this,"homePageLink",getApplication().getHomePage()); }
public InternalErrorPortletPage() { add(new BookmarkablePageLink("homePageLink",getApplication().getHomePage())); }
public PageExpiredPortletPage() { new BookmarkablePageLink(this,"homePageLink",getApplication().getHomePage()); }
public PageExpiredPortletPage() { add(new BookmarkablePageLink("homePageLink",getApplication().getHomePage())); }
List getComponentResolvers(); package wicket.settings; import java.util.List; import wicket.markup.html.WebPage; import wicket.markup.resolver.AutoComponentResolver; import wicket.markup.resolver.IComponentResolver; /** * Interface for page related settings. * * @author Igor Vaynberg (ivaynberg) * @author Eelc...
List getComponentResolvers(); package wicket.settings; import java.util.List; import wicket.markup.html.WebPage; import wicket.markup.resolver.AutoComponentResolver; import wicket.markup.resolver.IComponentResolver; /** * Interface for page related settings. * * @author Igor Vaynberg (ivaynberg) * @author Eelc...
public ConcretePage() { new MyPanel(this, "panel"); }
public ConcretePage() { add(new MyPanel("panel")); }
public ConcretePage2() { new MyPanel2(this, "panel"); }
public ConcretePage2() { add(new MyPanel2("panel")); }
public TestPage() { new TestExtendedPanel(this); }
public TestPage() { add(new TestExtendedPanel()); }