auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { if (isCORSSupport) { synchronized (this) { if (initialized) { long now = System.currentTimeMillis(); if (lastInitializationTime + delayBeforeReinit < now) { initialized = false; lastInitializationTime = now; } } } } if (!initialized) { synchronized (this) { if (!initialized) { lazyInit(); initialized = true; } } } if (delegate != null) { delegate.doFilter(request, response, chain); } else { chain.doFilter(request, response); } }

Target:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { if (delegate != null) { if (initialized) { long now = System.currentTimeMillis(); if (lastInitializationTime + delayBeforeReinit < now) { synchronized (this) { initialized = false; } lastInitializationTime = now; } } } if (!initialized) { synchronized (this) { if (!initialized) { createDelegate(); initialized = true; } } } if (delegate != null) { delegate.doFilter(request, response, chain); } else { chain.doFilter(request, response); } }
Source:
private boolean canBulkCreateNewBranch(Repository[] repositories) { for (Repository repo : repositories) { if (!hasBranches(repo)) { return false; } if (repo.isBare()) { return false; } if (repo.getRepositoryState().isRebasing()) { return false; } if (RepositoryUtil.hasChanges(repo)) { return false; } } return true; }

Target:
private boolean canBulkCreateNewBranch(Repository[] repositories) { for (Repository repo : repositories) { if (!hasBranches(repo)) { return false; } if (repo.isBare()) { return false; } if (repo.getRepositoryState() != RepositoryState.SAFE) { return false; } } return true; }
Source:
RestartWatchJob(IClient client){ super("WatchMananger Job"); this.client = client; }

Target:
RestartWatchJob(IClient client){ super("OpenShift WatchMananger Job"); this.client = client; }
Source:
void open() throws Exception; void open(int maxIO, boolean useExecutor) throws Exception; boolean fits(int size); int calculateBlockStart(int position) throws Exception; String getFileName(); void fill(int size) throws Exception; void delete() throws Exception; void write(ActiveMQBuffer bytes, boolean sync, IOCallback callback) throws Exception; void write(ActiveMQBuffer bytes, boolean sync) throws Exception; void write(EncodingSupport bytes, boolean sync, IOCallback callback) throws Exception; void write(EncodingSupport bytes, boolean sync) throws Exception; void writeDirect(ByteBuffer bytes, boolean sync, IOCallback callback); void writeDirect(ByteBuffer bytes, boolean sync) throws Exception; void blockingWriteDirect(ByteBuffer bytes, boolean sync, boolean releaseBuffer) throws Exception; int read(ByteBuffer bytes, IOCallback callback) throws Exception; int read(ByteBuffer bytes) throws Exception; void position(long pos) throws IOException; long position(); void close() throws Exception; default void close(boolean waitSync) throws Exception { close(); }

Target:
void open() throws Exception; void open(int maxIO, boolean useExecutor) throws Exception; boolean fits(int size); int calculateBlockStart(int position) throws Exception; String getFileName(); void fill(int size) throws Exception; void delete() throws IOException, InterruptedException, ActiveMQException; void write(ActiveMQBuffer bytes, boolean sync, IOCallback callback) throws Exception; void write(ActiveMQBuffer bytes, boolean sync) throws Exception; void write(EncodingSupport bytes, boolean sync, IOCallback callback) throws Exception; void write(EncodingSupport bytes, boolean sync) throws Exception; void writeDirect(ByteBuffer bytes, boolean sync, IOCallback callback); void writeDirect(ByteBuffer bytes, boolean sync) throws Exception; void blockingWriteDirect(ByteBuffer bytes, boolean sync, boolean releaseBuffer) throws Exception; int read(ByteBuffer bytes, IOCallback callback) throws Exception; int read(ByteBuffer bytes) throws Exception; void position(long pos) throws IOException; long position(); void close() throws Exception; default void close(boolean waitSync) throws Exception { close(); }
Source:
public static Admin create(Properties props) { return KafkaAdminClient.createInternal(new AdminClientConfig(props, true), null); }

Target:
public static AdminClient create(Properties props) { return (AdminClient) Admin.create(props); }
Source:
private MapReduceCommand parseMapReduceCommand(String jsonClause) { String collectionName = jsonClause.replaceFirst("(?ms).*?\\.\\s*(.+?)\\s*\\.\\s*mapReduce\\s*\\(.*", "$1"); if (collectionName.contains("getCollection")) { collectionName = collectionName.replaceFirst(".*getCollection\\s*\\(\\s*['\"](.*)['\"]\\s*\\).*", "$1"); } DBCollection collection = mongoDb.getCollection(collectionName); String body = jsonClause.replaceFirst("^(?ms).*?mapReduce\\s*\\(\\s*(.*)\\s*\\)\\s*;?\\s*$", "$1"); String mapFunction = findCommaSeparatedArgument(body, 0).trim(); String reduceFunction = findCommaSeparatedArgument(body, 1).trim(); String query = findCommaSeparatedArgument(body, 2).trim(); DBObject parameters = (DBObject) JSON.parse(query); DBObject mongoQuery; if (parameters.containsField("query")) { mongoQuery = (DBObject) parameters.get("query"); } else { mongoQuery = new BasicDBObject(); } return new MapReduceCommand(collection, mapFunction, reduceFunction, null, MapReduceCommand.OutputType.INLINE, mongoQuery); }

Target:
private MapReduceCommand parseMapReduceCommand(String jsonClause) { String collectionName = jsonClause.replaceFirst("(?ms).*?\\.\\s*(.+?)\\s*\\.\\s*mapReduce\\s*\\(.*", "$1"); if (collectionName.contains("getCollection")) { collectionName = collectionName.replaceFirst(".*getCollection\\s*\\(\\s*(['\"])([^'\"]+)\\1\\s*\\).*", "$2"); } DBCollection collection = mongoDb.getCollection(collectionName); String body = jsonClause.replaceFirst("^(?ms).*?mapReduce\\s*\\(\\s*(.*)\\s*\\)\\s*;?\\s*$", "$1"); String mapFunction = findCommaSeparatedArgument(body, 0).trim(); String reduceFunction = findCommaSeparatedArgument(body, 1).trim(); String query = findCommaSeparatedArgument(body, 2).trim(); DBObject parameters = (DBObject) JSON.parse(query); DBObject mongoQuery; if (parameters.containsField("query")) { mongoQuery = (DBObject) parameters.get("query"); } else { mongoQuery = new BasicDBObject(); } return new MapReduceCommand(collection, mapFunction, reduceFunction, null, MapReduceCommand.OutputType.INLINE, mongoQuery); }
Source:
public void setLatLonBoundingBox(CRSEnvelope latLonBoundingBox) { if( latLonBoundingBox.getSRSName() != null ){ String srsName = latLonBoundingBox.getSRSName(); if( !srsName.equals("CRS:84")){ throw new IllegalStateException("Layer LatLonBoundingBox srsName required to be null or CRS:84"); } }else { latLonBoundingBox.setSRSName("CRS:84",false);; } this.latLonBoundingBox = latLonBoundingBox; }

Target:
public void setLatLonBoundingBox(CRSEnvelope latLonBoundingBox) { if( latLonBoundingBox.getSRSName() != null ){ String srsName = latLonBoundingBox.getSRSName(); if( !srsName.equals("CRS:84")){ throw new IllegalStateException("Layer LatLonBoundingBox srsName required to be null or CRS:84"); } } else { latLonBoundingBox.setSRSName("CRS:84",false); } this.latLonBoundingBox = latLonBoundingBox; }
Source:
public void emitTuples() { if (currentWindowId <= windowManager.getLargestRecoveryWindow()) { return; } int pollSize = (emitQueue.size() < batchSize) ? emitQueue.size() : batchSize; while (pollSize-- > 0) { T obj = emitQueue.poll(); emitTuple(obj); lastEmittedRecord++; } }

Target:
public void emitTuples() { if (currentWindowId <= windowManager.getLargestRecoveryWindow()) { return; } int pollSize = (emitQueue.size() < batchSize) ? emitQueue.size() : batchSize; while (pollSize-- > 0) { T obj = emitQueue.poll(); if (obj != null) { emitTuple(obj); } lastEmittedRow++; } }
Source:
public static QcDto asDto(QC from) { QcDto dto = new QcDto(); dto.setId(from.getId()); dto.setDate(getDateString(from.getDate())); dto.setCreator(from.getCreator().getFullName()); dto.setType(asDto(from.getType())); dto.setResults(from.getResults()); dto.setOwnerId(from.getEntity().getId()); dto.setOwnerAlias(from.getEntity().getAlias()); return dto; }

Target:
public static QcDto asDto(QC from) { QcDto dto = new QcDto(); dto.setId(from.getId()); dto.setDate(formatDate(from.getDate())); dto.setCreator(from.getCreator().getFullName()); dto.setType(asDto(from.getType())); dto.setResults(from.getResults()); dto.setEntityId(from.getEntity().getId()); dto.setEntityAlias(from.getEntity().getAlias()); return dto; }
Source:
private void runPatchMetadataTests(EPerson asUser, int expectedStatus) throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context).withName("Community").withLogo("logo_community") .build(); String token = getAuthToken(asUser.getEmail(), password); new MetadataPatchSuite().runWith(getClient(token), "/api/core/bitstreams/" + parentCommunity.getLogo().getID(), expectedStatus); }

Target:
private void runPatchMetadataTests(EPerson asUser, int expectedStatus) throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context).withName("Community").withLogo("logo_community") .build(); context.restoreAuthSystemState(); String token = getAuthToken(asUser.getEmail(), password); new MetadataPatchSuite().runWith(getClient(token), "/api/core/bitstreams/" + parentCommunity.getLogo().getID(), expectedStatus); }
Source:
private void setAccount() throws OrmException, IOException, UnloggedFailure { user = genericUserFactory.create(id); rsrc = new AccountResource(user); try { for (String email : addEmails) { addEmail(email); } for (String email : deleteEmails) { deleteEmail(email); } if (preferredEmail != null) { if (isRegistered(preferredEmail)) { putPreferred(preferredEmail); } else { System.err.println("WARNING: preferred email not set, " + preferredEmail + " not registered"); } } if (fullName != null) { PutName.Input in = new PutName.Input(); in.name = fullName; putName.apply(rsrc, in); } if (httpPassword != null || clearHttpPassword) { PutHttpPassword.Input in = new PutHttpPassword.Input(); in.httpPassword = httpPassword; putHttpPassword.apply(rsrc, in); } if (active) { putActive.apply(rsrc, null); } else if (inactive) { try { deleteActive.apply(rsrc, null); } catch (ResourceNotFoundException e) { } } addSshKeys = readSshKey(addSshKeys); if (!addSshKeys.isEmpty()) { addSshKeys(addSshKeys); } deleteSshKeys = readSshKey(deleteSshKeys); if (!deleteSshKeys.isEmpty()) { deleteSshKeys(deleteSshKeys); } } catch (RestApiException e) { throw die(e.getMessage()); } }

Target:
private void setAccount() throws OrmException, IOException, UnloggedFailure { user = genericUserFactory.create(id); rsrc = new AccountResource(user); try { for (String email : addEmails) { addEmail(email); } for (String email : deleteEmails) { deleteEmail(email); } if (preferredEmail != null) { putPreferred(preferredEmail); } if (fullName != null) { PutName.Input in = new PutName.Input(); in.name = fullName; putName.apply(rsrc, in); } if (httpPassword != null || clearHttpPassword) { PutHttpPassword.Input in = new PutHttpPassword.Input(); in.httpPassword = httpPassword; putHttpPassword.apply(rsrc, in); } if (active) { putActive.apply(rsrc, null); } else if (inactive) { try { deleteActive.apply(rsrc, null); } catch (ResourceNotFoundException e) { } } addSshKeys = readSshKey(addSshKeys); if (!addSshKeys.isEmpty()) { addSshKeys(addSshKeys); } deleteSshKeys = readSshKey(deleteSshKeys); if (!deleteSshKeys.isEmpty()) { deleteSshKeys(deleteSshKeys); } } catch (RestApiException e) { throw die(e.getMessage()); } }
Source:
public void testSearchParamsQueryCustomExpression() { this.gateway.setSearchArgs("new SearchParameters('foo' + payload).count(5).sinceId(11)"); Tweet tweet = new Tweet(1L, "foo", new Date(), "bar", "baz", 0L, 0L, "qux", "fiz"); SearchMetadata searchMetadata = mock(SearchMetadata.class); final SearchResults searchResults = new SearchResults(Collections.singletonList(tweet), searchMetadata); doAnswer(new Answer<SearchResults>() { @Override public SearchResults answer(InvocationOnMock invocation) throws Throwable { SearchParameters searchParameters = (SearchParameters) invocation.getArguments()[0]; assertEquals("foobar", searchParameters.getQuery()); assertEquals(Integer.valueOf(5), searchParameters.getCount()); assertEquals(Long.valueOf(11), searchParameters.getSinceId()); return searchResults; } }).when(this.searchOps).search(Matchers.any(SearchParameters.class)); this.gateway.handleMessage(new GenericMessage<String>("bar")); Message<?> reply = this.outputChannel.receive(0); assertNotNull(reply); @SuppressWarnings("unchecked") List<Tweet> tweets = (List<Tweet>) reply.getPayload(); assertEquals(1, tweets.size()); assertSame(tweet, tweets.get(0)); assertSame(searchMetadata, reply.getHeaders().get(TwitterHeaders.SEARCH_METADATA)); }

Target:
public void testSearchParamsQueryCustomExpression() { this.gateway.setSearchArgsExpression(new SpelExpressionParser() .parseExpression("new SearchParameters('foo' + payload).count(5).sinceId(11)")); Tweet tweet = new Tweet(1L, "foo", new Date(), "bar", "baz", 0L, 0L, "qux", "fiz"); SearchMetadata searchMetadata = mock(SearchMetadata.class); final SearchResults searchResults = new SearchResults(Collections.singletonList(tweet), searchMetadata); doAnswer(new Answer<SearchResults>() { @Override public SearchResults answer(InvocationOnMock invocation) throws Throwable { SearchParameters searchParameters = (SearchParameters) invocation.getArguments()[0]; assertEquals("foobar", searchParameters.getQuery()); assertEquals(Integer.valueOf(5), searchParameters.getCount()); assertEquals(Long.valueOf(11), searchParameters.getSinceId()); return searchResults; } }).when(this.searchOps).search(Matchers.any(SearchParameters.class)); this.gateway.handleMessage(new GenericMessage<String>("bar")); Message<?> reply = this.outputChannel.receive(0); assertNotNull(reply); @SuppressWarnings("unchecked") List<Tweet> tweets = (List<Tweet>) reply.getPayload(); assertEquals(1, tweets.size()); assertSame(tweet, tweets.get(0)); assertSame(searchMetadata, reply.getHeaders().get(TwitterHeaders.SEARCH_METADATA)); }
Source:
ArraySchema.Builder load() { ArraySchema.Builder builder = ArraySchema.builder(); ls.schemaJson().maybe("minItems").map(JsonValue::requireInteger).ifPresent(builder::minItems); ls.schemaJson().maybe("maxItems").map(JsonValue::requireInteger).ifPresent(builder::maxItems); ls.schemaJson().maybe("uniqueItems").map(JsonValue::requireBoolean).ifPresent(builder::uniqueItems); if (config.useDefaults) ls.schemaJson().maybe("default").map(JsonValue::deepToOrgJson).ifPresent(builder::defaultValue); ls.schemaJson().maybe("additionalItems").ifPresent(maybe -> { maybe.canBe(Boolean.class, builder::additionalItems) .or(JsonObject.class, obj -> builder.schemaOfAdditionalItems(defaultLoader.loadChild(obj).build())) .requireAny(); }); ls.schemaJson().maybe("items").ifPresent(items -> { items.canBeSchema(itemSchema -> builder.allItemSchema(defaultLoader.loadChild(itemSchema).build())) .or(JsonArray.class, arr -> buildTupleSchema(builder, arr)) .requireAny(); }); if (config.specVersion == DRAFT_6) { ls.schemaJson().maybe("contains").ifPresent(containedRawSchema -> addContainedSchema(builder, containedRawSchema)); } return builder; }

Target:
ArraySchema.Builder load() { ArraySchema.Builder builder = ArraySchema.builder(); ls.schemaJson().maybe("minItems").map(JsonValue::requireInteger).ifPresent(builder::minItems); ls.schemaJson().maybe("maxItems").map(JsonValue::requireInteger).ifPresent(builder::maxItems); ls.schemaJson().maybe("uniqueItems").map(JsonValue::requireBoolean).ifPresent(builder::uniqueItems); ls.schemaJson().maybe("additionalItems").ifPresent(maybe -> { maybe.canBe(Boolean.class, builder::additionalItems) .or(JsonObject.class, obj -> builder.schemaOfAdditionalItems(defaultLoader.loadChild(obj).build())) .requireAny(); }); ls.schemaJson().maybe("items").ifPresent(items -> { items.canBeSchema(itemSchema -> builder.allItemSchema(defaultLoader.loadChild(itemSchema).build())) .or(JsonArray.class, arr -> buildTupleSchema(builder, arr)) .requireAny(); }); if (config.specVersion == DRAFT_6) { ls.schemaJson().maybe("contains").ifPresent(containedRawSchema -> addContainedSchema(builder, containedRawSchema)); } return builder; }
Source:
private ExtendSANStorageDomainParameters createParameters(Guid storageDomainId, List<LogicalUnit> newLuns, boolean force) { ExtendSANStorageDomainParameters params = new ExtendSANStorageDomainParameters(); params.setStorageDomainId(storageDomainId); ArrayList<String> lunIds = newLuns.stream().map(LogicalUnit::getId).collect(Collectors.toCollection(ArrayList::new)); params.setLunIds(lunIds); params.setForce(force); return params; }

Target:
private ExtendSANStorageDomainParameters createParameters(Guid storageDomainId, List<LogicalUnit> newLuns, boolean force) { ExtendSANStorageDomainParameters params = new ExtendSANStorageDomainParameters(); params.setStorageDomainId(storageDomainId); ArrayList<String> lunIds = newLuns.stream().map(LogicalUnit::getId).collect(toCollection(ArrayList::new)); params.setLunIds(lunIds); params.setForce(force); return params; }
Source:
private void notifyLocalListener(Collection<CacheEntryEvent<? extends K, ? extends V>> evts, @Nullable IgniteClosure<CacheEntryEvent<? extends K, ? extends V>, ?> trans) { EventListener locTransLsnr = localTransformedEventListener(); if (F.isEmpty(evts)) return; if (locLsnr != null) locLsnr.onUpdated(evts); if (locTransLsnr != null) locTransLsnr.onUpdated(transform(trans, evts)); }

Target:
private void notifyLocalListener(Collection<CacheEntryEvent<? extends K, ? extends V>> evts, @Nullable IgniteClosure<CacheEntryEvent<? extends K, ? extends V>, ?> trans) { EventListener locTransLsnr = localTransformedEventListener(); assert locLsnr == null || locTransLsnr == null; if (F.isEmpty(evts)) return; if (locLsnr != null) locLsnr.onUpdated(evts); if (locTransLsnr != null) locTransLsnr.onUpdated(transform(trans, evts)); }
Source:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = null; if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { description = new DelegatingResourceDescription(); description.addProperty("identifierType"); description.addProperty("location"); description.addProperty("source"); description.addProperty("manualEntryEnabled"); description.addProperty("automaticGenerationEnabled"); } return description; }

Target:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = null; if (rep instanceof RefRepresentation) { description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addSelfLink(); } if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("identifierType"); description.addProperty("source"); description.addProperty("manualEntryEnabled"); description.addProperty("automaticGenerationEnabled"); description.addSelfLink(); if (rep instanceof DefaultRepresentation) { description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } } return description; }
Source:
private void forkRepo(String repoToForkName) { System.out.println("Forking repository:"); String repoToForkOwner = "openmrs"; GitHubClient client = new GitHubClient(); System.out.print("- Client authentication"); client.setCredentials(githubUsername, githubPassword); System.out.println(" - DONE"); RepositoryService service = new RepositoryService(); System.out.print("- Service authentication"); service.getClient().setCredentials(githubUsername, githubPassword); System.out.println(" - DONE"); RepositoryId toBeForked = new RepositoryId(repoToForkOwner, repoToForkName); try { System.out.print("- Forking"); service.forkRepository(toBeForked); System.out.println(" - DONE"); } catch (IOException e) { e.printStackTrace(); throw new IllegalStateException("Failed to fork repository \"" + repoToForkOwner + "/" + repoToForkName+ "\""); } }

Target:
private void forkRepo(String repoToForkName) { wizard.showMessage("Forking repository:"); String repoToForkOwner = "openmrs"; GitHubClient client = new GitHubClient(); System.out.print("- Client authentication"); client.setCredentials(githubUsername, githubPassword); wizard.showMessage(" - DONE"); RepositoryService service = new RepositoryService(); System.out.print("- Service authentication"); service.getClient().setCredentials(githubUsername, githubPassword); wizard.showMessage(" - DONE"); RepositoryId toBeForked = new RepositoryId(repoToForkOwner, repoToForkName); try { System.out.print("- Forking"); service.forkRepository(toBeForked); wizard.showMessage(" - DONE"); } catch (IOException e) { throw new IllegalStateException("Failed to fork repository \"" + repoToForkOwner + "/" + repoToForkName+ "\"", e); } }
Source:
public Faction read(JsonReader in) throws IOException { if (in.peek() == JsonToken.NULL) { in.nextNull(); return null; } return Faction.fromFaValue(Integer.parseInt(in.nextString())); }

Target:
public Faction read(JsonReader in) throws IOException { if (in.peek() == JsonToken.NULL) { in.nextNull(); return null; } return Faction.fromString(in.nextString()); }
Source:
protected boolean requiresQuotes(final String identifier, final boolean precededByDot) { if (NON_UNDERSCORE_ALPHA_NUMERIC.matchesAnyOf(identifier)) { return true; } else if (precededByDot && isUnquotedReservedWordsAsIdentifierSupported()) { return false; } else { return isReservedWord(identifier); } }

Target:
protected boolean requiresQuotes(final String identifier, final boolean precededByDot) { if (NON_UNDERSCORE_ALPHA_NUMERIC.matchesAnyOf(identifier)) { return true; } else if (precededByDot && supportsUnquotedReservedWordsAsIdentifier) { return false; } else { return isReservedWord(identifier); } }
Source:
private void addPLCookie(HttpServletRequest httpRequest, HttpServletResponse response) { Cookie plCookie = null; if (httpRequest.getCookies() != null) { for (Cookie c : httpRequest.getCookies()) { if (PL.equals(c.getName()) && c.getName() != null) { plCookie = c; break; } } } if (plCookie == null) { plCookie = new Cookie(PL, PL_SETTING.getValue()); plCookie.setPath("/"); response.addCookie(plCookie); } else if (!PL_SETTING.getValue().equalsIgnoreCase(plCookie.getValue())) { plCookie = new Cookie(PL, PL_SETTING.getValue()); plCookie.setPath("/"); response.addCookie(plCookie); } }

Target:
private void addPLCookie(HttpServletRequest httpRequest, HttpServletResponse response) { Cookie plCookie = null; if (httpRequest.getCookies() != null) { for (Cookie c : httpRequest.getCookies()) { if (PL.equals(c.getName()) && c.getName() != null) { plCookie = c; break; } } } if (plCookie == null || !PL_SETTING.getValue().equalsIgnoreCase(plCookie.getValue())) { plCookie = new Cookie(PL, PL_SETTING.getValue()); plCookie.setPath("/"); response.addCookie(plCookie); } }
Source:
private static List<? extends ICodeMining> logCodeMiningProviderException(Throwable e) { String PLUGIN_ID= "org.eclipse.jface.text"; ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getMessage(), e)); return new ArrayList<>(); }

Target:
private static void logCodeMiningProviderException(Throwable e) { String PLUGIN_ID= "org.eclipse.jface.text"; ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getMessage(), e)); }
Source:
public JobConfig generateConfig(String executionPlanJson) { Map<String, String> configs = new HashMap<>(); configs.put(JobConfig.JOB_NAME(), jobName); List<String> inputs = inEdges.stream().map(edge -> edge.getFormattedSystemStream()).collect(Collectors.toList()); configs.put(TaskConfig.INPUT_STREAMS(), Joiner.on(',').join(inputs)); if (streamGraph.hasWindowOrJoins() && !config.containsKey(TaskConfig.WINDOW_MS())) { long triggerInterval = computeTriggerInterval(); log.info("Using triggering interval: for jobName: {}", triggerInterval, jobName); configs.put(TaskConfig.WINDOW_MS(), String.valueOf(triggerInterval)); } log.info("Job has generated configs {}", jobName, configs); configs.put(CONFIG_INTERNAL_EXECUTION_PLAN, executionPlanJson); String configPrefix = String.format(CONFIG_JOB_PREFIX, jobName); return new JobConfig(Util.rewriteConfig(extractScopedConfig(config, new MapConfig(configs), configPrefix))); }

Target:
public JobConfig generateConfig(String executionPlanJson) { Map<String, String> configs = new HashMap<>(); configs.put(JobConfig.JOB_NAME(), jobName); List<String> inputs = inEdges.stream().map(edge -> edge.getFormattedSystemStream()).collect(Collectors.toList()); configs.put(TaskConfig.INPUT_STREAMS(), Joiner.on(',').join(inputs)); if (streamGraph.hasWindowOrJoins()) { if ("-1".equals(config.get(TaskConfig.WINDOW_MS(), "-1"))) { long triggerInterval = computeTriggerInterval(); log.info("Using triggering interval: for jobName: {}", triggerInterval, jobName); configs.put(TaskConfig.WINDOW_MS(), String.valueOf(triggerInterval)); } } log.info("Job has generated configs {}", jobName, configs); configs.put(CONFIG_INTERNAL_EXECUTION_PLAN, executionPlanJson); String configPrefix = String.format(CONFIG_JOB_PREFIX, jobName); return new JobConfig(Util.rewriteConfig(extractScopedConfig(config, new MapConfig(configs), configPrefix))); }
Source:
private String getProgressText(GlusterVolumeSizeInfo sizeStats) { if(sizeStats == null) { return ConstantsManager.getInstance().getConstants().unknown(); } else { return ConstantsManager.getInstance().getMessages().volumeCapacityUsedPercentage((int)((sizeStats.getUsedSize().floatValue() / sizeStats.getTotalSize().floatValue()) * 100)); } }

Target:
private String getProgressText(GlusterVolumeSizeInfo sizeStats) { if(sizeStats == null) { return ConstantsManager.getInstance().getConstants().noValue(); } else { return ConstantsManager.getInstance().getMessages().volumeCapacityUsedPercentage((int)((sizeStats.getUsedSize().floatValue() / sizeStats.getTotalSize().floatValue()) * 100)); } }
Source:
public void afterTextChanged(Editable s) { if (mModifiedText == null) { return; } SpanRange spanRange; if (mModifiedText.toString().contains("<")) { spanRange = restyleForChangedOpeningSymbol(s, "<"); } else if (mModifiedText.toString().contains(">")) { spanRange = restyleForChangedClosingSymbol(s, ">"); } else if (mModifiedText.toString().contains("&")) { spanRange = restyleForChangedOpeningSymbol(s, "&"); } else if (mModifiedText.toString().contains(";")) { spanRange = restyleForChangedClosingSymbol(s, ";"); } else { spanRange = restyleNormalTextIfWithinSymbols(s, "<", ">"); if (spanRange == null) { spanRange = restyleNormalTextIfWithinSymbols(s, "&", ";"); } } if (spanRange != null) { updateSpans(s, spanRange); } mModifiedText = null; mLastOperation = Operation.NONE; }

Target:
public void afterTextChanged(Editable s) { if (mModifiedText == null || s == null) { return; } SpanRange spanRange; if (mModifiedText.toString().contains("<")) { spanRange = getRespanRangeForChangedOpeningSymbol(s, "<"); } else if (mModifiedText.toString().contains(">")) { spanRange = getRespanRangeForChangedClosingSymbol(s, ">"); } else if (mModifiedText.toString().contains("&")) { spanRange = getRespanRangeForChangedOpeningSymbol(s, "&"); } else if (mModifiedText.toString().contains(";")) { spanRange = getRespanRangeForChangedClosingSymbol(s, ";"); } else { spanRange = getRespanRangeForNormalText(s, "<"); if (spanRange == null) { spanRange = getRespanRangeForNormalText(s, "&"); } } if (spanRange != null) { updateSpans(s, spanRange); } mModifiedText = null; mLastOperation = Operation.NONE; }
Source:
public PlayerInfoBean getPlayerForUsername(String username) { PlayerInfoBean playerInfoBean = players.get(username); if(playerInfoBean == null) logger.warn("Error returning playerInfoBean of {}", username); return playerInfoBean; }

Target:
public PlayerInfoBean getPlayerForUsername(String username) { PlayerInfoBean playerInfoBean = players.get(username); if (playerInfoBean == null) { logger.warn("Unknown user: {}", username); } return playerInfoBean; }
Source:
public void testFandomUniversityLink() { HomePage homePage = new HomePage(); GlobalNavigation globalNav = homePage.getGlobalNavigation(); globalNav = globalNav.openWikisMenu(); homePage = globalNav.clickFandomUniversityLink(); Assertion.assertEquals(homePage.getCurrentUrl(), urlBuilder.getUrlForPage("community", "/wiki/Fandom_University")); }

Target:
public void testFandomUniversityLink() { new HomePage() .getGlobalNavigation() .openWikisMenu() .clickFandomUniversityLink(); Assertion.assertEquals(driver.getCurrentUrl(), urlBuilder.getUrlForPage("community", "/wiki/Fandom_University")); }
Source:
public void update() { synchronized (accounts) { accounts.clear(); } if (skCase == null) { return; } int artId = BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID(); int pathAttrId = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(); String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " + "FROM blackboard_attributes,blackboard_artifacts WHERE " + "attribute_type_id=" + pathAttrId + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" + " AND blackboard_artifacts.artifact_type_id=" + artId; if (datasourceObjId > 0) { query += " AND blackboard_artifacts.data_source_obj_id = " + datasourceObjId; } try (CaseDbQuery dbQuery = skCase.executeQuery(query)) { ResultSet resultSet = dbQuery.getResultSet(); synchronized (accounts) { while (resultSet.next()) { final String path = resultSet.getString("value_text"); final long artifactId = resultSet.getLong("artifact_id"); final Map<String, String> parsedPath = parsePath(path); final String account = parsedPath.get(MAIL_ACCOUNT); final String folder = parsedPath.get(MAIL_FOLDER); Map<String, List<Long>> folders = accounts.get(account); if (folders == null) { folders = new LinkedHashMap<>(); accounts.put(account, folders); } List<Long> messages = folders.get(folder); if (messages == null) { messages = new ArrayList<>(); folders.put(folder, messages); } messages.add(artifactId); } } } catch (TskCoreException | SQLException ex) { logger.log(Level.WARNING, "Cannot initialize email extraction: ", ex); } setChanged(); notifyObservers(); }

Target:
public void update() { synchronized (accounts) { accounts.clear(); } if (skCase == null) { return; } int artId = BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID(); int pathAttrId = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(); String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " + "FROM blackboard_attributes,blackboard_artifacts WHERE " + "attribute_type_id=" + pathAttrId + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" + " AND blackboard_artifacts.artifact_type_id=" + artId; if (filteringDSObjId > 0) { query += " AND blackboard_artifacts.data_source_obj_id = " + filteringDSObjId; } try (CaseDbQuery dbQuery = skCase.executeQuery(query)) { ResultSet resultSet = dbQuery.getResultSet(); synchronized (accounts) { while (resultSet.next()) { final String path = resultSet.getString("value_text"); final long artifactId = resultSet.getLong("artifact_id"); final Map<String, String> parsedPath = parsePath(path); final String account = parsedPath.get(MAIL_ACCOUNT); final String folder = parsedPath.get(MAIL_FOLDER); Map<String, List<Long>> folders = accounts.get(account); if (folders == null) { folders = new LinkedHashMap<>(); accounts.put(account, folders); } List<Long> messages = folders.get(folder); if (messages == null) { messages = new ArrayList<>(); folders.put(folder, messages); } messages.add(artifactId); } } } catch (TskCoreException | SQLException ex) { logger.log(Level.WARNING, "Cannot initialize email extraction: ", ex); } setChanged(); notifyObservers(); }
Source:
public void debugRender (Sprite sprite, Color color) { tempColor = renderer.getColor(); renderer.setColor(color); renderer.rect(sprite.getBoundingRectangle().x, sprite.getBoundingRectangle().y, sprite.getBoundingRectangle().width, sprite.getBoundingRectangle().height); renderer.setColor(tempColor); }

Target:
public void debugRender (Sprite sprite, Color color) { tempColor = renderer.getColor(); tempBounds = sprite.getBoundingRectangle(); renderer.setColor(color); renderer.rect(tempBounds.x, tempBounds.y, tempBounds.width, tempBounds.height); renderer.setColor(tempColor); }
Source:
String sanitized(String url) { if (url != null) { final Matcher matcher = GIT_HTTP_URL_PATTERN.matcher(url); if (matcher.find()) { return matcher.group(1); } } return url; }

Target:
String sanitized(String url) { if (url != null) { final Matcher matcher = GIT_HTTP_URL_PATTERN.matcher(url); if (matcher.find()) { return matcher.group("sanitized"); } } return url; }
Source:
public CoordinatorDynamicConfig( @JsonProperty("millisToWaitBeforeDeleting") long millisToWaitBeforeDeleting, @JsonProperty("mergeBytesLimit") long mergeBytesLimit, @JsonProperty("mergeSegmentsLimit") int mergeSegmentsLimit, @JsonProperty("maxSegmentsToMove") int maxSegmentsToMove, @JsonProperty("replicantLifetime") int replicantLifetime, @JsonProperty("replicationThrottleLimit") int replicationThrottleLimit, @JsonProperty("balancerComputeThreads") int balancerComputeThreads, @JsonProperty("emitBalancingStats") boolean emitBalancingStats ) { this.maxSegmentsToMove = maxSegmentsToMove; this.millisToWaitBeforeDeleting = millisToWaitBeforeDeleting; this.mergeSegmentsLimit = mergeSegmentsLimit; this.mergeBytesLimit = mergeBytesLimit; this.replicantLifetime = replicantLifetime; this.replicationThrottleLimit = replicationThrottleLimit; this.emitBalancingStats = emitBalancingStats; this.balancerComputeThreads = balancerComputeThreads; }

Target:
public CoordinatorDynamicConfig( @JsonProperty("millisToWaitBeforeDeleting") long millisToWaitBeforeDeleting, @JsonProperty("mergeBytesLimit") long mergeBytesLimit, @JsonProperty("mergeSegmentsLimit") int mergeSegmentsLimit, @JsonProperty("maxSegmentsToMove") int maxSegmentsToMove, @JsonProperty("replicantLifetime") int replicantLifetime, @JsonProperty("replicationThrottleLimit") int replicationThrottleLimit, @JsonProperty("balancerComputeThreads") int balancerComputeThreads, @JsonProperty("emitBalancingStats") boolean emitBalancingStats ) { this.maxSegmentsToMove = maxSegmentsToMove; this.millisToWaitBeforeDeleting = millisToWaitBeforeDeleting; this.mergeSegmentsLimit = mergeSegmentsLimit; this.mergeBytesLimit = mergeBytesLimit; this.replicantLifetime = replicantLifetime; this.replicationThrottleLimit = replicationThrottleLimit; this.emitBalancingStats = emitBalancingStats; this.balancerComputeThreads = Math.min(balancerComputeThreads, Runtime.getRuntime().availableProcessors() - 1); }
Source:
private OptimizationOrchestrator(final Optimizer optimizer, final PlanExecutor planExecutor, final UserJobInfo userJobInfo) { this.optimizer = optimizer; this.planExecutor = planExecutor; this.stageInfoList = userJobInfo.getStageInfoList(); this.iterationIdToMetrics = new ConcurrentHashMap<>(); this.optimizationThreadPool = Executors.newFixedThreadPool(2); }

Target:
private OptimizationOrchestrator(final Optimizer optimizer, final PlanExecutor planExecutor, final UserJobInfo userJobInfo) { this.optimizer = optimizer; this.planExecutor = planExecutor; this.stageInfoList = userJobInfo.getStageInfoList(); this.iterationIdToMetrics = new ConcurrentHashMap<>(); this.optimizationThreadPool = Executors.newSingleThreadExecutor(); }
Source:
private static Run setCommonRunValues(NotificationDto from, Run to) { to.setName(from.getRunName()); to.setFilePath(from.getSequencerFolderPath().toString()); to.setHealth(from.getHealthType()); to.setStartDate(Date.from(from.getStartDate().atStartOfDay(ZoneId.systemDefault()).toInstant())); to.setCompletionDate(Date.from(from.getCompletionDate().atStartOfDay(ZoneId.systemDefault()).toInstant())); return to; }

Target:
private static Run setCommonRunValues(NotificationDto from, Run to) { to.setName(from.getRunName()); to.setFilePath(from.getSequencerFolderPath().toString()); to.setHealth(from.getHealthType()); to.setStartDate(LimsUtils.toBadDate(from.getStartDate())); to.setCompletionDate(LimsUtils.toBadDate(from.getCompletionDate())); return to; }
Source:
protected void doCommit() throws InterruptedException { logger.trace("Starting commit."); if (type.equals(TransactionType.NONE)) { return; } if (type.equals(TransactionType.PUT)) { if (!kafkaFutures.isPresent()) { kafkaFutures = Optional.of(new LinkedList<Future<RecordMetadata>>()); } try { long batchSize = producerRecords.get().size(); long startTime = System.nanoTime(); int index = 0; for (ProducerRecord<String, byte[]> record : producerRecords.get()) { index++; kafkaFutures.get().add(producer.send(record, new ChannelCallback(index, startTime))); } producer.flush(); for (Future<RecordMetadata> future : kafkaFutures.get()) { future.get(); } long endTime = System.nanoTime(); counter.addToKafkaEventSendTimer((endTime - startTime) / (1000 * 1000)); counter.addToEventPutSuccessCount(batchSize); producerRecords.get().clear(); kafkaFutures.get().clear(); } catch (Exception ex) { logger.warn("Sending events to Kafka failed", ex); throw new ChannelException("Commit failed as send to Kafka failed", ex); } } else { if (consumerAndRecords.get().failedEvents.isEmpty() && eventTaken) { logger.trace("about to commit batch."); long startTime = System.nanoTime(); consumerAndRecords.get().commitOffsets(); long endTime = System.nanoTime(); counter.addToKafkaCommitTimer((endTime - startTime) / (1000 * 1000)); counter.addToEventTakeSuccessCount(Long.valueOf(events.get().size())); if (logger.isDebugEnabled()) { logger.debug(consumerAndRecords.get().getCommittedOffsetsString()); } } logger.trace("clearing offsets map."); consumerAndRecords.get().offsets.clear(); events.get().clear(); } }

Target:
protected void doCommit() throws InterruptedException { logger.trace("Starting commit"); if (type.equals(TransactionType.NONE)) { return; } if (type.equals(TransactionType.PUT)) { if (!kafkaFutures.isPresent()) { kafkaFutures = Optional.of(new LinkedList<Future<RecordMetadata>>()); } try { long batchSize = producerRecords.get().size(); long startTime = System.nanoTime(); int index = 0; for (ProducerRecord<String, byte[]> record : producerRecords.get()) { index++; kafkaFutures.get().add(producer.send(record, new ChannelCallback(index, startTime))); } producer.flush(); for (Future<RecordMetadata> future : kafkaFutures.get()) { future.get(); } long endTime = System.nanoTime(); counter.addToKafkaEventSendTimer((endTime - startTime) / (1000 * 1000)); counter.addToEventPutSuccessCount(batchSize); producerRecords.get().clear(); kafkaFutures.get().clear(); } catch (Exception ex) { logger.warn("Sending events to Kafka failed", ex); throw new ChannelException("Commit failed as send to Kafka failed", ex); } } else { if (consumerAndRecords.get().failedEvents.isEmpty() && eventTaken) { logger.trace("About to commit batch"); long startTime = System.nanoTime(); consumerAndRecords.get().commitOffsets(); long endTime = System.nanoTime(); counter.addToKafkaCommitTimer((endTime - startTime) / (1000 * 1000)); if (logger.isDebugEnabled()) { logger.debug(consumerAndRecords.get().getCommittedOffsetsString()); } } int takes = events.get().size(); if (takes > 0) { counter.addToEventTakeSuccessCount(takes); events.get().clear(); } } }
Source:
public void testSTExteriorRing() throws Exception { assertQuery("select ST_AsText(ST_ExteriorRing(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 1))')))", "select 'LINESTRING (1 1, 4 1, 1 4, 1 1)'"); assertQuery("select ST_AsText(ST_ExteriorRing(ST_GeometryFromText('POLYGON ((0 0, 0 5, 5 5, 5 0, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1))')))", "select 'LINESTRING (0 0, 5 0, 5 5, 0 5, 0 0)'"); assertQueryFails("select ST_AsText(ST_ExteriorRing(ST_GeometryFromText('LineString(1 1, 2 2, 1 3)')))", "ST_ExteriorRing only applies to Polygon. Input type is: LineString"); assertQueryFails("select ST_AsText(ST_ExteriorRing(ST_GeometryFromText('POLYGON EMPTY')))", "ST_ExteriorRing only applies to Polygon. Input type is: MultiPolygon"); }

Target:
public void testSTExteriorRing() throws Exception { assertFunction("ST_AsText(ST_ExteriorRing(ST_GeometryFromText('POLYGON EMPTY')))", VARCHAR, null); assertFunction("ST_AsText(ST_ExteriorRing(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 1))')))", VARCHAR, "LINESTRING (1 1, 4 1, 1 4, 1 1)"); assertFunction("ST_AsText(ST_ExteriorRing(ST_GeometryFromText('POLYGON ((0 0, 0 5, 5 5, 5 0, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1))')))", VARCHAR, "LINESTRING (0 0, 5 0, 5 5, 0 5, 0 0)"); assertInvalidFunction("ST_AsText(ST_ExteriorRing(ST_GeometryFromText('LINESTRING (1 1, 2 2, 1 3)')))", "ST_ExteriorRing only applies to POLYGON or MULTI_POLYGON. Input type is: LINE_STRING"); }
Source:
public void testsHeaderAvailable() throws IOException { MatcherAssert.assertThat( new RsWithHeader( new RsWithBody("<html>Hello</html>"), "content-encoding: gzip" ), new HmRsHeader(Matchers.hasEntry("content-encoding", "gzip")) ); }

Target:
public void testsHeaderAvailable() throws Exception { MatcherAssert.assertThat( new RsWithHeader( new RsWithBody("<html>Hello</html>"), "content-encoding: gzip" ), new HmRsHeader(Matchers.hasEntry("content-encoding", "gzip")) ); }
Source:
public static void sortByProvider(boolean reverse, AboutData[] infos) { if (reverse) { reverse(infos); return; } Arrays.sort(infos, new Comparator<AboutData>() { Collator collator = Collator.getInstance(Locale.getDefault()); public int compare(AboutData a, AboutData b) { AboutData info1 = a; AboutData info2 = b; String provider1 = info1.getProviderName(); String provider2 = info2.getProviderName(); if (!provider1.equals(provider2)) { return collator.compare(provider1, provider2); } return collator.compare(info1.getName(), info2.getName()); } }); }

Target:
public static void sortByProvider(boolean reverse, AboutData[] infos) { if (reverse) { reverse(infos); return; } Arrays.sort(infos, new Comparator<AboutData>() { Collator collator = Collator.getInstance(Locale.getDefault()); public int compare(AboutData info1, AboutData info2) { String provider1 = info1.getProviderName(); String provider2 = info2.getProviderName(); if (!provider1.equals(provider2)) { return collator.compare(provider1, provider2); } return collator.compare(info1.getName(), info2.getName()); } }); }
Source:
public Artifact copyWithParameterizedUri() { Artifact newArtifact = new Artifact(artifactCoordinates, uri); File repositoryFolder = new File("repository"); String newUriPath = getFormattedOutputDirectory(repositoryFolder, toArtifact(this)).getPath(); try { newArtifact.setUri(new URI(newUriPath)); } catch (URISyntaxException e) { } return newArtifact; }

Target:
public Artifact copyWithParameterizedUri() { Artifact newArtifact = new Artifact(artifactCoordinates, uri); File repositoryFolder = new File("repository"); String newUriPath = getFormattedOutputDirectory(repositoryFolder, toArtifact(this)).getPath(); try { newArtifact.setUri(new URI(newUriPath)); } catch (URISyntaxException e) { throw new RuntimeException("Could not generate URI for resource, the given path is invalid: " + newUriPath, e); } return newArtifact; }
Source:
public ArrayList<String> getAllObjects(String path) { ArrayList<String> objects = new ArrayList<String>(); if (!path.substring(path.length() - 1).equals("/")) { path += "/"; } ListObjectsV2Result listing = client.listObjectsV2(new ListObjectsV2Request() .withBucketName(bucketName) .withPrefix(path)); for (S3ObjectSummary objectSummary : listing.getObjectSummaries()) { if (!objectSummary.getKey().equals(path)) { objects.add(objectSummary.getKey()); } } return objects; }

Target:
private List<String> getAllObjects(String path) { ListObjectsV2Result listing = client.listObjectsV2(new ListObjectsV2Request() .withBucketName(bucketName) .withPrefix(ensureTrailingSlashPresent(path))); return listing.getObjectSummaries().stream() .map(S3ObjectSummary::getKey) .filter(key -> !key.equals(ensureTrailingSlashPresent(path))) .collect(Collectors.toList()); }
Source:
public Task start(final ReusableMachineTemplate template, final List<? extends Startable> entities) { BasicExecutionContext ctx = BasicExecutionContext.getCurrentExecutionContext(); if (ctx==null) throw new IllegalStateException("Pool.start is only permitted within a task (effector)"); final Task t[] = new Task[1]; t[0] = ctx.submit(new Runnable() { public void run() { if (log.isDebugEnabled()) log.debug("Pool "+this+", task "+t[0]+" claiming a "+template); SshMachineLocation m = claim(template); if (log.isDebugEnabled()) log.debug("Pool "+this+", task "+t[0]+" got "+m+"; starting "+entities); for (Startable entity: entities) addTask( ((Entity)entity).invoke(Startable.START, MutableMap.of("locations", Arrays.asList(m))) ); } }); addTask(t[0]); return t[0]; }

Target:
public Task start(final ReusableMachineTemplate template, final List<? extends Startable> entities) { BasicExecutionContext ctx = BasicExecutionContext.getCurrentExecutionContext(); if (ctx==null) throw new IllegalStateException("Pool.start is only permitted within a task (effector)"); final AtomicReference<Task> t = new AtomicReference<Task>(); synchronized (t) { t.set(ctx.submit(new Runnable() { public void run() { synchronized (t) { if (log.isDebugEnabled()) log.debug("Pool "+this+", task "+t.get()+" claiming a "+template); SshMachineLocation m = obtain(template); if (log.isDebugEnabled()) log.debug("Pool "+this+", task "+t.get()+" got "+m+"; starting "+entities); for (Startable entity: entities) addTask( ((Entity)entity).invoke(Startable.START, MutableMap.of("locations", Arrays.asList(m))) ); } } })); } addTask(t.get()); return t.get(); }
Source:
public synchronized void done() { if (!isCanceled()) { for (IEnabledTarget fAction : fActions) { fAction.setEnabled(fEnabled); } } }

Target:
public synchronized void done() { if (!isCanceled()) { for (IEnabledTarget action : fActions) { action.setEnabled(fEnabled); } } }
Source:
public void test_update_by_query_returning_multiple_results() throws Exception { execute("create table test (id int primary key, x int, message string) clustered into 2 shards"); execute("insert into test values(1, 1, 'msg');"); execute("insert into test values(2, 1, 'msg');"); assertEquals(1, response.rowCount()); refresh(); execute("update test set message='updated' where message='msg' and x > 0 returning message as message_renamed"); assertThat((response.rowCount()), is(2L )); assertThat((response.cols()[0]), is("message_renamed")); assertThat(response.rows()[0][0], is("updated")); assertThat(response.rows()[1][0], is("updated")); }

Target:
public void test_update_by_query_returning_multiple_results() throws Exception { execute("create table test (id int primary key, x int, message string) clustered into 2 shards"); execute("insert into test values(1, 1, 'msg');"); execute("insert into test values(2, 1, 'msg');"); assertEquals(1, response.rowCount()); refresh(); execute("update test set message='updated' where message='msg' and x > 0 " + "returning _docid, _seq_no as seq, message as message_renamed"); assertThat((response.rowCount()), is(2L)); assertThat((response.cols()[0]), is("_docid")); assertThat((response.cols()[1]), is("seq")); assertThat((response.cols()[2]), is("message_renamed")); assertThat(response.rows()[0][0], is(0)); assertThat(response.rows()[0][1], is(2L)); assertThat(response.rows()[0][2], is("updated")); assertThat(response.rows()[1][0], is(1)); assertThat(response.rows()[1][1], is(3L)); assertThat(response.rows()[1][2], is("updated")); }