auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void putObject_test2() throws Exception { if (!mintEnv) { System.out.println("Test: multipart: putObject(String bucketName, String objectName, String filename)"); } long startTime = System.currentTimeMillis(); try { String filename = createFile6Mb(); client.putObject(bucketName, filename, filename, null, null,(ServerSideEncryption)null , null); Files.delete(Paths.get(filename)); client.removeObject(bucketName, filename); mintSuccessLog("putObject(String bucketName, String objectName, String filename)", "filename: 6MB", startTime); } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, String filename)", "filename: 6MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }

Target:
public static void putObject_test2() throws Exception { if (!mintEnv) { System.out.println("Test: multipart: putObject(String bucketName, String objectName, String filename)"); } long startTime = System.currentTimeMillis(); try { String filename = createFile6Mb(); client.putObject(bucketName, filename, filename, null, null, null , null); Files.delete(Paths.get(filename)); client.removeObject(bucketName, filename); mintSuccessLog("putObject(String bucketName, String objectName, String filename)", "filename: 6MB", startTime); } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, String filename)", "filename: 6MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }
Source:
public List<Container> getContainersOnPage(final IHTMLPage page) throws DotStateException, DotDataException, DotSecurityException { final List<Container> containers = new ArrayList<>(); List<Identifier> identifiers = new ArrayList<>(); DotConnect dc = new DotConnect(); dc.setSQL("select * from identifier where id in (select distinct(parent2) as containers from multi_tree where parent1=?)"); dc.addParam(page.getIdentifier()); identifiers = ConvertToPOJOUtil.convertDotConnectMapToIdentifier(dc.loadResults()); final List<Container> pageContainers = new ArrayList<>(); for (Identifier id : identifiers) { final Container cont = (Container) APILocator.getVersionableAPI() .findWorkingVersion(id, APILocator.getUserAPI().getSystemUser(), false); pageContainers.add(cont); } return containers; }

Target:
public List<Container> getContainersOnPage(final IHTMLPage page) throws DotStateException, DotDataException, DotSecurityException { final List<Container> containers = new ArrayList<>(); List<Identifier> identifiers = new ArrayList<>(); DotConnect dc = new DotConnect(); dc.setSQL("select * from identifier where id in (select distinct(parent2) as containers from multi_tree where parent1=?)"); dc.addParam(page.getIdentifier()); identifiers = TransformerLocator.createIdentifierTransformer(dc.loadObjectResults()).asList(); final List<Container> pageContainers = new ArrayList<>(); for (Identifier id : identifiers) { final Container cont = (Container) APILocator.getVersionableAPI() .findWorkingVersion(id, APILocator.getUserAPI().getSystemUser(), false); pageContainers.add(cont); } return containers; }
Source:
public void pushLatest() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true").exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); LOG.info("Committing container: {}", container.toString()); String imageId = dockerRule.getClient().commitCmd(container.getId()).withRepository(username + "/busybox").exec(); dockerRule.getClient().pushImageCmd(username + "/busybox").exec(new PushImageResultCallback()).awaitCompletion(); LOG.info("Removing image: {}", imageId); dockerRule.getClient().removeImageCmd(imageId).exec(); dockerRule.getClient().pullImageCmd(username + "/busybox").exec(new PullImageResultCallback()).awaitCompletion(); }

Target:
public void pushLatest() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true").exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); LOG.info("Committing container: {}", container.toString()); String imageId = dockerRule.getClient().commitCmd(container.getId()).withRepository(username + "/busybox").exec(); dockerRule.getClient().pushImageCmd(username + "/busybox").exec(new PushImageResultCallback()) .awaitCompletion(30, TimeUnit.SECONDS); LOG.info("Removing image: {}", imageId); dockerRule.getClient().removeImageCmd(imageId).exec(); dockerRule.getClient().pullImageCmd(username + "/busybox").exec(new PullImageResultCallback()) .awaitCompletion(30, TimeUnit.SECONDS); }
Source:
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { if (entity instanceof Comment) { Comment comment = (Comment) entity; KafkaJsonOutput output = new KafkaJsonOutput(comment.getCommentUri(), KafkaEventType.DELETE); sendMessage("ambra-comment", output); } super.onDelete(entity, id, state, propertyNames, types); }

Target:
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { if (entity instanceof Comment) { Comment comment = (Comment) entity; sendMessage("ambra-comment", comment.getCommentUri(), KafkaEventType.DELETE); } super.onDelete(entity, id, state, propertyNames, types); }
Source:
static boolean isValidVersion(String version) { for (Pattern p : VERSION_REGEX) { if (p.matcher(version).matches()) { return true; } } log.warn("Encountered invalid user agent version", SafeArg.of("version", version)); return false; }

Target:
static boolean isValidVersion(String version) { if (VERSION_REGEX.matcher(version).matches()) { return true; } log.warn("Encountered invalid user agent version", SafeArg.of("version", version)); return false; }
Source:
public MergeCommand include(Ref commit) { return include(commit.getName(), commit.getObjectId()); }

Target:
public MergeCommand include(Ref commit) { checkCallable(); commits.add(commit); return this; }
Source:
public static void startDedicatedScheduler() throws Exception { schedulerHelper.log("Start Scheduler in non-fork mode."); schedulerHelper = new SchedulerTHelper(false, new File(SchedulerFunctionalTest.class .getResource("/functionaltests/config/functionalTSchedulerProperties-rampolicy.ini") .toURI()).getAbsolutePath()); }

Target:
public static void startDedicatedScheduler() throws Exception { schedulerHelper.log("Start Scheduler in non-fork mode."); schedulerHelper = new SchedulerTHelper(false, new File(SchedulerFunctionalTestRamPolicy.class .getResource("/functionaltests/config/functionalTSchedulerProperties-rampolicy.ini") .toURI()).getAbsolutePath()); }
Source:
public ConsoleConfigurationRepository httpConsoleConfigurationRepository() { HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); requestFactory.setConnectTimeout((int) properties.getHttpClient().getConnectTimeout().getSeconds()); requestFactory.setReadTimeout((int) properties.getHttpClient().getReadTimeout().getSeconds()); RestTemplate restTemplate = new RestTemplate(requestFactory); return new HttpConsoleConfigurationRepository(restTemplate); }

Target:
public ConsoleConfigurationRepository httpConsoleConfigurationRepository() { HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); requestFactory.setConnectTimeout((int) properties.getHttpClient().getConnectTimeout().toMillis()); requestFactory.setReadTimeout((int) properties.getHttpClient().getReadTimeout().toMillis()); RestTemplate restTemplate = new RestTemplate(requestFactory); return new HttpConsoleConfigurationRepository(properties, restTemplate); }
Source:
protected void doGetHtml(HttpServletRequest req, HttpServletResponse res) throws IOException { Repository repo = ServletUtils.getRepository(req); GitilesView view = getView(req, repo); Paginator paginator = newPaginator(repo, view); if (paginator == null) { res.setStatus(SC_NOT_FOUND); return; } try { GitDateFormatter df = new GitDateFormatter(Format.DEFAULT); Map<String, Object> data; List<String> pretty_values = view.getParameters().get(PRETTY_PARAM); if (pretty_values.isEmpty()) { data = new LogSoyData(req, view).toSoyData(paginator, null, df); GitilesConfig.putVariant(getAccess(req).getConfig(), "logEntry", "logEntryVariant", data); } else { data = new LogSoyData(req, view, true).toSoyData(paginator, null, df); String variant = pretty_values.get(0); data.put("logPrettyVariant", pretty_values.get(0)); } if (!view.getRevision().nameIsId()) { List<Map<String, Object>> tags = Lists.newArrayListWithExpectedSize(1); for (RevObject o : RevisionServlet.listObjects(paginator.getWalk(), view.getRevision())) { if (o instanceof RevTag) { tags.add(new TagSoyData(linkifier, req).toSoyData((RevTag) o, df)); } } if (!tags.isEmpty()) { data.put("tags", tags); } } String title = "Log - "; if (view.getOldRevision() != Revision.NULL) { title += view.getRevisionRange(); } else { title += view.getRevision().getName(); } data.put("title", title); renderHtml(req, res, "gitiles.logDetail", data); } catch (RevWalkException e) { log.warn("Error in rev walk", e); res.setStatus(SC_INTERNAL_SERVER_ERROR); return; } finally { paginator.getWalk().release(); } }

Target:
protected void doGetHtml(HttpServletRequest req, HttpServletResponse res) throws IOException { Repository repo = ServletUtils.getRepository(req); GitilesView view = getView(req, repo); Paginator paginator = newPaginator(repo, view); if (paginator == null) { res.setStatus(SC_NOT_FOUND); return; } try { GitilesAccess access = getAccess(req); DateFormatter df = new DateFormatter(access, Format.DEFAULT); Map<String, Object> data; List<String> pretty_values = view.getParameters().get(PRETTY_PARAM); if (pretty_values.isEmpty()) { data = new LogSoyData(req, view).toSoyData(paginator, null, df); GitilesConfig.putVariant(access.getConfig(), "logEntry", "logEntryVariant", data); } else { data = new LogSoyData(req, view, true).toSoyData(paginator, null, df); String variant = pretty_values.get(0); data.put("logPrettyVariant", pretty_values.get(0)); } if (!view.getRevision().nameIsId()) { List<Map<String, Object>> tags = Lists.newArrayListWithExpectedSize(1); for (RevObject o : RevisionServlet.listObjects(paginator.getWalk(), view.getRevision())) { if (o instanceof RevTag) { tags.add(new TagSoyData(linkifier, req).toSoyData((RevTag) o, df)); } } if (!tags.isEmpty()) { data.put("tags", tags); } } String title = "Log - "; if (view.getOldRevision() != Revision.NULL) { title += view.getRevisionRange(); } else { title += view.getRevision().getName(); } data.put("title", title); renderHtml(req, res, "gitiles.logDetail", data); } catch (RevWalkException e) { log.warn("Error in rev walk", e); res.setStatus(SC_INTERNAL_SERVER_ERROR); return; } finally { paginator.getWalk().release(); } }
Source:
private boolean isRealWorklog(final EveritWorklog worklog) { boolean isRealWorklog = true; if (issuesRegex != null) { for (final Pattern issuePattern : issuesRegex) { final boolean issueMatches = issuePattern.matcher(worklog.getIssue()).matches(); if (issueMatches) { isRealWorklog = false; break; } } } return isRealWorklog; }

Target:
private boolean isRealWorklog(final EveritWorklog worklog) { boolean isRealWorklog = true; if (issuesRegex != null) { for (Pattern issuePattern : issuesRegex) { boolean issueMatches = issuePattern.matcher(worklog.getIssue()).matches(); if (issueMatches) { isRealWorklog = false; break; } } } return isRealWorklog; }
Source:
protected int getResponseSetSize() { return responses.size(); }

Target:
protected int getResponseSetSize() { return queuedResponseCount.get(); }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("tenantId", tenantId) .add("name", name) .add("description", description) .add("securityGroupRules", securityGroupRules) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("tenantId", tenantId) .add("name", name) .add("description", description) .add("securityGroupRules", rules) .toString(); }
Source:
public V put(@NonNull K key, @NonNull V value) { final ByteBuf keyPayload = Unpooled.buffer(); final ByteBuf valuePayload = Unpooled.buffer(); serializer.serialize(key, keyPayload); serializer.serialize(value, valuePayload); try { rocksDb.put( keyPayload.array(), keyPayload.arrayOffset(), keyPayload.readableBytes(), valuePayload.array(), valuePayload.arrayOffset(), valuePayload.readableBytes()); } catch (RocksDBException ex) { throw new UnrecoverableCorfuError(ex); } finally { keyPayload.release(); valuePayload.release(); } dataSetSize.incrementAndGet(); return value; }

Target:
public V put(@NonNull K key, @NonNull V value) { final ByteBuf keyPayload = Unpooled.buffer(); final ByteBuf valuePayload = Unpooled.buffer(); serializer.serialize(key, keyPayload); serializer.serialize(value, valuePayload); final boolean keyExists = rocksDb.keyMayExist(keyPayload.array(), keyPayload.arrayOffset(), keyPayload.readableBytes(), new StringBuilder()); if (!keyExists) { dataSetSize.incrementAndGet(); } try { rocksDb.put( keyPayload.array(), keyPayload.arrayOffset(), keyPayload.readableBytes(), valuePayload.array(), valuePayload.arrayOffset(), valuePayload.readableBytes()); } catch (RocksDBException ex) { throw new UnrecoverableCorfuError(ex); } finally { keyPayload.release(); valuePayload.release(); } return value; }
Source:
default JobExecution getLastJobExecution(JobInstance jobInstance) { return null; }

Target:
default JobExecution getLastJobExecution(JobInstance jobInstance) { throw new UnsupportedOperationException(); }
Source:
public static ResourceMapping[] getResourceMappings(IFile file, ResourceMappingContext context) { final IModelProviderDescriptor[] modelDescriptors = ModelProvider .getModelProviderDescriptors(); final Set<ResourceMapping> mappings = new LinkedHashSet<ResourceMapping>(); for (IModelProviderDescriptor candidate : modelDescriptors) { try { final IResource[] resources = candidate .getMatchingResources(new IResource[] { file, }); if (resources.length > 0) { final ModelProvider model = candidate.getModelProvider(); final ResourceMapping[] modelMappings = model.getMappings( file, context, null); for (ResourceMapping mapping : modelMappings) { mappings.add(mapping); } } } catch (CoreException e) { Activator.logError(e.getMessage(), e); } } return mappings.toArray(new ResourceMapping[mappings.size()]); }

Target:
public static ResourceMapping[] getResourceMappings(IFile file, ResourceMappingContext context) { final IModelProviderDescriptor[] modelDescriptors = ModelProvider .getModelProviderDescriptors(); final Set<ResourceMapping> mappings = new LinkedHashSet<ResourceMapping>(); for (IModelProviderDescriptor candidate : modelDescriptors) { try { final IResource[] resources = candidate .getMatchingResources(new IResource[] { file, }); if (resources.length > 0) { final ModelProvider model = candidate.getModelProvider(); final ResourceMapping[] modelMappings = model.getMappings( file, context, null); for (ResourceMapping mapping : modelMappings) mappings.add(mapping); } } catch (CoreException e) { Activator.logError(e.getMessage(), e); } } return mappings.toArray(new ResourceMapping[mappings.size()]); }
Source:
private void setupSound() { if (state.soundPop == null) { state.soundPop = createMediaPlayer(R.raw.pop); } if (state.soundNewPop == null) { state.soundNewPop = createMediaPlayer(R.raw.newpop); } setVolumeControlStream(AudioManager.STREAM_MUSIC); TelephonyManager tele = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tele != null && state.phoneState == null) { state.phoneState = new PhoneState(); final int signal_strengths = 256; try { tele.listen(state.phoneState, PhoneStateListener.LISTEN_SERVICE_STATE | PhoneStateListener.LISTEN_CALL_STATE | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS | signal_strengths); } catch (SecurityException ex) { info("cannot get call state, will play audio over any telephone calls: " + ex); } } Intent checkTTSIntent = new Intent(); checkTTSIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA); startActivityForResult(checkTTSIntent, ACTION_TTS_CODE); }

Target:
private void setupSound() { if (state.soundPop == null) { state.soundPop = createMediaPlayer(R.raw.pop); } if (state.soundNewPop == null) { state.soundNewPop = createMediaPlayer(R.raw.newpop); } setVolumeControlStream(AudioManager.STREAM_MUSIC); TelephonyManager tele = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tele != null && state.phoneState == null) { state.phoneState = new PhoneState(); final int signal_strengths = 256; try { tele.listen(state.phoneState, PhoneStateListener.LISTEN_SERVICE_STATE | PhoneStateListener.LISTEN_CALL_STATE | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS | signal_strengths); } catch (SecurityException ex) { info("cannot get call state, will play audio over any telephone calls: " + ex); } } ttsCheckIntent(); }
Source:
public Response putBatchWifiInfo (@Auth final AccessToken token, @Valid @NotNull final List<WifiInfo> wifiInfoList){ if (wifiInfoList.size() > WifiInfoDynamoDB.MAXIMUM_BATCH_WRITE_SIZE) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity(new JsonError(Response.Status.BAD_REQUEST.getStatusCode(), String.format("Max batch size allow is %s", WifiInfoDynamoDB.MAXIMUM_BATCH_WRITE_SIZE))).build()); } final Boolean hasPut = wifiInfoDAO.putBatch(wifiInfoList); if (!hasPut) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to update wifi info batch"))).build()); } return Response.noContent().build(); }

Target:
public Response putBatchWifiInfo (@Auth final AccessToken token, @Valid @NotNull final List<WifiInfo> wifiInfoList){ if (wifiInfoList.size() > WifiInfoDynamoDB.MAXIMUM_BATCH_WRITE_SIZE) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity(new JsonError(Response.Status.BAD_REQUEST.getStatusCode(), String.format("Max batch size allowed is %s", WifiInfoDynamoDB.MAXIMUM_BATCH_WRITE_SIZE))).build()); } final Boolean hasPut = wifiInfoDAO.putBatch(wifiInfoList); if (!hasPut) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to update wifi info batch"))).build()); } return Response.noContent().build(); }
Source:
@Override protected Optional<SmeltableProperty> getFor(ItemStack itemStack) { if(FurnaceRecipes.instance().getSmeltingResult(itemStack) != null) { return Optional.of(new SmeltableProperty(true)); } return Optional.of(new SmeltableProperty(false)); }

Target:
@Override protected Optional<SmeltableProperty> getFor(ItemStack itemStack) { return Optional.of(new SmeltableProperty(FurnaceRecipes.instance().getSmeltingResult(itemStack) != null)); }
Source:
public void searchRightsByQuestionsTestLicenseWithoutFields() throws Exception { getClient().perform(get("/api/config/submissioncclicenses/search/rightsByQuestions?license=license3")) .andExpect(status().isOk()) .andExpect(jsonPath("$.url", is("mock-license-uri"))) .andExpect(jsonPath("$.type", is("submissioncclicenseUrl"))) .andExpect(jsonPath("$._links.self.href", is("http://localhost/api/config/submissioncclicenses/search/rightsByQuestions" + "?license=license3"))); }

Target:
public void searchRightsByQuestionsTestLicenseWithoutFields() throws Exception { String epersonToken = getAuthToken(eperson.getEmail(), password); getClient(epersonToken) .perform(get("/api/config/submissioncclicenses/search/rightsByQuestions?license=license3")) .andExpect(status().isOk()) .andExpect(jsonPath("$.url", is("mock-license-uri"))) .andExpect(jsonPath("$.type", is("submissioncclicenseUrl"))) .andExpect(jsonPath("$._links.self.href", is("http://localhost/api/config/submissioncclicenses/search/rightsByQuestions" + "?license=license3"))); }
Source:
public static ExecutorServices create(ResourceLoader loader) { URL configuration = loader.getResource(CONFIGURATION_FILE); Properties properties = null; if (configuration != null) { properties = loadProperties(configuration); } final int threadPoolSize = initIntValue(properties, THREAD_POOL_SIZE, DEFAULT_THREAD_POOL_SIZE); final boolean debug = initBooleanValue(properties, DEBUG, false); ThreadPoolType defaultType = PermissionChecker.hasPermission(new java.lang.RuntimePermission("modifyThreadGroup")) ? ThreadPoolType.FIXED : ThreadPoolType.NONE; final ThreadPoolType threadPoolType = initThreadPoolType(properties, THREAD_POOL_TYPE, defaultType); final long threadPoolKeepAliveTime = initLongValue(properties, THREAD_POOL_KEEP_ALIVE_TIME, DEFAULT_KEEP_ALIVE_TIME); if (debug) { return enableDebugMode(constructExecutorServices(threadPoolType, threadPoolSize, threadPoolKeepAliveTime)); } else { return constructExecutorServices(threadPoolType, threadPoolSize, threadPoolKeepAliveTime); } }

Target:
public static ExecutorServices create(ResourceLoader loader) { URL configuration = loader.getResource(CONFIGURATION_FILE); Properties properties = null; if (configuration != null) { properties = loadProperties(configuration); } final int threadPoolSize = initIntValue(properties, THREAD_POOL_SIZE, DEFAULT_THREAD_POOL_SIZE); final boolean debug = initBooleanValue(properties, DEBUG, false); ThreadPoolType defaultType = Permissions.hasPermission(Permissions.MODIFY_THREAD_GROUP) ? ThreadPoolType.FIXED : ThreadPoolType.NONE; final ThreadPoolType threadPoolType = initThreadPoolType(properties, THREAD_POOL_TYPE, defaultType); final long threadPoolKeepAliveTime = initLongValue(properties, THREAD_POOL_KEEP_ALIVE_TIME, DEFAULT_KEEP_ALIVE_TIME); if (debug) { return enableDebugMode(constructExecutorServices(threadPoolType, threadPoolSize, threadPoolKeepAliveTime)); } else { return constructExecutorServices(threadPoolType, threadPoolSize, threadPoolKeepAliveTime); } }
Source:
private static GitFlowRepository getRepository(Object element) { GitFlowRepository repository = null; if (element instanceof GitFlowRepository) { repository = (GitFlowRepository) element; } if (element instanceof RepositoryNode) { RepositoryNode node = (RepositoryNode) element; repository = new GitFlowRepository(node.getObject()); } return repository; }

Target:
private static @Nullable GitFlowRepository getRepository(Object element) { GitFlowRepository repository = null; if (element instanceof GitFlowRepository) { repository = (GitFlowRepository) element; } if (element instanceof RepositoryNode) { RepositoryNode node = (RepositoryNode) element; repository = new GitFlowRepository(node.getObject()); } return repository; }
Source:
public void canQueryOverTwoStringFieldsNormalized() { Map<String, Object> nameOperator = new HashMap<String, Object>(); nameOperator.put("$eq", "mike"); Map<String, Object> query = new HashMap<String, Object>(); query.put("name", nameOperator); Map<String, Object> petOperator = new HashMap<String, Object>(); petOperator.put("$eq", "cat"); query.put("pet", petOperator); QueryResult queryResult = im.find(query); Assert.assertNotNull(queryResult); Assert.assertEquals(2, queryResult.size()); List<String> checkList = new ArrayList<String>(); checkList.add("mike12"); checkList.add("mike72"); Assert.assertEquals(2, queryResult.documentIds().size()); Assert.assertTrue(queryResult.documentIds().containsAll(checkList)); List<String> docCheckList = new ArrayList<String>(); for (DocumentRevision rev: queryResult) { Assert.assertNotNull(rev.getId()); Assert.assertNotNull(rev.getBody()); docCheckList.add(rev.getId()); } Assert.assertEquals(2, docCheckList.size()); Assert.assertTrue(docCheckList.containsAll(checkList)); }

Target:
public void canQueryOverTwoStringFieldsNormalized() { Map<String, Object> nameOperator = new HashMap<String, Object>(); nameOperator.put("$eq", "mike"); Map<String, Object> query = new HashMap<String, Object>(); query.put("name", nameOperator); Map<String, Object> petOperator = new HashMap<String, Object>(); petOperator.put("$eq", "cat"); query.put("pet", petOperator); QueryResult queryResult = im.find(query); Assert.assertNotNull(queryResult); Assert.assertEquals(2, queryResult.size()); List<String> checkList = Arrays.asList("mike12", "mike72"); Assert.assertEquals(2, queryResult.documentIds().size()); Assert.assertTrue(queryResult.documentIds().containsAll(checkList)); }
Source:
public Object invoke(Message message) throws Exception { checkArgument(message != null); try { Method method = this.methods.get(message.header(ServiceHeaders.METHOD)); Object result; if (method.getParameters().length == 0) { result = method.invoke(serviceObject); } else if (method.getParameters()[0].getType().isAssignableFrom(Message.class)) { result = method.invoke(serviceObject, (Message) message.data()); } else { result = method.invoke(serviceObject, new Object[] {message.data()}); } return result; } catch (Exception ex) { return ex; } }

Target:
public Object invoke(Message message) throws Exception { checkArgument(message != null); try { Method method = this.methods.get(message.header(ServiceHeaders.METHOD)); Object result; if (method.getParameters().length == 0) { result = method.invoke(serviceObject); } else if (method.getParameters()[0].getType().isAssignableFrom(Message.class)) { result = method.invoke(serviceObject, message); } else { result = method.invoke(serviceObject, new Object[] {message.data()}); } return result; } catch (Exception ex) { return ex; } }
Source:
@Override public String getLegacyColumnName( DatabaseMetaData dbMetaData, ResultSetMetaData rsMetaData, int index ) throws KettleDatabaseException { String columnName; try { columnName = rsMetaData.getColumnLabel( index ); } catch ( SQLException sqlException ) { throw new KettleDatabaseException( "Something went wrong trying to get the legacy column name", sqlException ); } catch ( Exception e ) { throw new KettleDatabaseException( "Something unexpected went wrong trying to get the legacy column name", e ); } return columnName; }

Target:
@Override public String getLegacyColumnName( DatabaseMetaData dbMetaData, ResultSetMetaData rsMetaData, int index ) throws KettleDatabaseException { if ( dbMetaData == null ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, "MySQLDatabaseMeta.Exception.LegacyColumnNameNoDBMetaDataException" ) ); } if ( rsMetaData == null ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, "MySQLDatabaseMeta.Exception.LegacyColumnNameNoRSMetaDataException" ) ); } try { return rsMetaData.getColumnLabel( index ); } catch ( Exception e ) { throw new KettleDatabaseException( String.format( "%s: %s", BaseMessages.getString( PKG, "MySQLDatabaseMeta.Exception.LegacyColumnNameException" ), e.getMessage() ), e ); } }
Source:
public static File copyDir(File srcDir, File dstDir) throws IOException { if (!srcDir.exists()) { throw new FileNotFoundException("Directory: " + srcDir.getAbsolutePath() + " does not exist."); } if (!srcDir.isDirectory()) { throw new IOException(srcDir.getAbsolutePath() + " is not a directory."); } dstDir.mkdirs(); if (!dstDir.isDirectory()) { throw new IOException("Cannot create directory: " + dstDir.getAbsolutePath()); } for (File file : srcDir.listFiles()) { if (file.isDirectory()) { copyDir(file, new File(dstDir, file.getName())); } else { copyFileToDir(file, dstDir); } } return dstDir; }

Target:
public static File copyDir(File srcDir, File dstDir) throws IOException { if (!srcDir.exists()) { throw new FileNotFoundException("Directory: " + srcDir.getAbsolutePath() + " does not exist."); } if (!srcDir.isDirectory()) { throw new IOException(srcDir.getAbsolutePath() + " is not a directory."); } dstDir.mkdir(); if (!dstDir.isDirectory()) { throw new IOException("Cannot create directory: " + dstDir.getAbsolutePath()); } for (File file : srcDir.listFiles()) { if (file.isDirectory()) { copyDir(file, new File(dstDir, file.getName())); } else { copyFileToDir(file, dstDir); } } return dstDir; }
Source:
private Token nextIsASimpleValue(ConfigOrigin baseOrigin, int lineNumber) { if (lastTokenWasSimpleValue) { if (whitespace.length() > 0) { Token t = Tokens.newUnquotedText( lineOrigin(baseOrigin, lineNumber), whitespace.toString()); whitespace.setLength(0); return t; } else { return null; } } else { lastTokenWasSimpleValue = true; if (whitespace.length() > 0) { Token t = Tokens.newIgnoredWhitespace(lineOrigin(baseOrigin, lineNumber), whitespace.toString()); whitespace.setLength(0); return t; } return null; } }

Target:
private Token nextIsASimpleValue(ConfigOrigin baseOrigin, int lineNumber) { Token t = createWhitespaceTokenFromSaver(baseOrigin, lineNumber); if (!lastTokenWasSimpleValue) { lastTokenWasSimpleValue = true; } return t; }
Source:
private Map<String, Map<String, String>> getPluginConfigValues() { Map<String, Map<String, String>> pluginConfigValues = new HashMap<>(pluginConfigWidgets.size()); for (Entry<String, Map<String, FocusWidget>> e : pluginConfigWidgets.entrySet()) { Map<String, String> values = new HashMap<String, String>(e.getValue().size()); pluginConfigValues.put(e.getKey(), values); for (Entry<String, FocusWidget> e2 : e.getValue().entrySet()) { FocusWidget widget = e2.getValue(); if (widget instanceof TextBox) { values.put(e2.getKey(), ((TextBox) widget).getValue().trim()); } else if (widget instanceof CheckBox) { values.put(e2.getKey(), Boolean.toString(((CheckBox) widget).getValue())); } else if (widget instanceof ListBox) { ListBox listBox = (ListBox) widget; String value = listBox.getSelectedIndex() > 0 ? listBox.getValue(listBox.getSelectedIndex()) : null; values.put(e2.getKey(), value); } else if (widget instanceof NpTextArea) { NpTextArea txtArea = (NpTextArea) widget; values.put(e2.getKey(), txtArea.getText().trim()); } else { throw new UnsupportedOperationException("unupported widget type"); } } } return pluginConfigValues; }

Target:
private Map<String, Map<String, String>> getPluginConfigValues() { Map<String, Map<String, String>> pluginConfigValues = new HashMap<>(pluginConfigWidgets.size()); for (Entry<String, Map<String, FocusWidget>> e : pluginConfigWidgets.entrySet()) { Map<String, String> values = new HashMap<String, String>(e.getValue().size()); pluginConfigValues.put(e.getKey(), values); for (Entry<String, FocusWidget> e2 : e.getValue().entrySet()) { FocusWidget widget = e2.getValue(); if (widget instanceof TextBox) { values.put(e2.getKey(), ((TextBox) widget).getValue().trim()); } else if (widget instanceof CheckBox) { values.put(e2.getKey(), Boolean.toString(((CheckBox) widget).getValue())); } else if (widget instanceof ListBox) { ListBox listBox = (ListBox) widget; String value = listBox.getSelectedIndex() > 0 ? listBox.getValue(listBox.getSelectedIndex()) : null; values.put(e2.getKey(), value); } else if (widget instanceof NpTextArea) { NpTextArea txtArea = (NpTextArea) widget; values.put(e2.getKey(), txtArea.getText().trim()); } else { throw new UnsupportedOperationException("unsupported widget type"); } } } return pluginConfigValues; }
Source:
public Set<RuntimeIdentity> findIdentities() throws InternalInfrastructureException { try { return docker.listContainers(ListContainersParams.create().withAll(false)) .stream() .map(container -> Labels.newDeserializer(container.getLabels()).runtimeId()) .filter(id -> !Strings.isNullOrEmpty(id.getWorkspaceId())) .collect(Collectors.toSet()); } catch (IOException x) { throw new InternalInfrastructureException(x.getMessage(), x); } }

Target:
public Set<RuntimeIdentity> findIdentities() throws InternalInfrastructureException { return listNonStoppedContainers(Labels.LABEL_WORKSPACE_ID, Labels.LABEL_WORKSPACE_ID, Labels.LABEL_WORKSPACE_OWNER) .stream() .map(e -> Labels.newDeserializer(e.getLabels()).runtimeId()) .collect(Collectors.toSet()); }
Source:
public void testThrowing() { XLogger logger = XLoggerFactory.getXLogger("UnitTest"); Throwable t = new UnsupportedOperationException("Test"); assertEquals(t, logger.throwing(t)); assertEquals(t, logger.throwing(XLogger.Level.DEBUG,t)); assertEquals(2, listAppender.list.size()); if (listAppender.list.get(0).getThrowableStrRep() == null) { return; } verifyWithException((LoggingEvent) listAppender.list.get(0), "throwing", t); LoggingEvent event = (LoggingEvent)listAppender.list.get(1); verifyWithLevelAndException(event, XLogger.Level.DEBUG, "throwing", t); }

Target:
public void testThrowing() { XLogger logger = XLoggerFactory.getXLogger("UnitTest"); Throwable t = new UnsupportedOperationException("Test"); assertEquals(t, logger.throwing(t)); assertEquals(t, logger.throwing(XLogger.Level.DEBUG, t)); assertEquals(2, listAppender.list.size()); verifyWithException((LoggingEvent) listAppender.list.get(0), "throwing", t); LoggingEvent event = (LoggingEvent) listAppender.list.get(1); verifyWithLevelAndException(event, XLogger.Level.DEBUG, "throwing", t); }
Source:
public void testDoubleClaim() throws CloudnameException, InterruptedException { final Coordinate c = Coordinate.parse("2.service.user.cell"); final CountDownLatch okCounter = new CountDownLatch(1); final CountDownLatch failCounter = new CountDownLatch(1); final CoordinateListener listener = new CoordinateListener() { @Override public void onCoordinateEvent(Event event, String message) { switch (event) { case COORDINATE_OK: okCounter.countDown(); break; case NOT_OWNER: failCounter.countDown(); default: assert(false); break; } } }; Cloudname cn = null; try { cn = makeLocalZkCloudname(); } catch (CloudnameException e) { fail("connecting to localhost failed."); } try { cn.createCoordinate(c); } catch (CoordinateExistsException e) { fail("should not happen."); } ServiceHandle handle1 = cn.claim(c); assert(handle1.waitForCoordinateOkSeconds(4)); handle1.registerCoordinateListener(listener); ServiceHandle handle2 = cn.claim(c); assertFalse(handle2.waitForCoordinateOkSeconds(1)); handle2.registerCoordinateListener(listener); assert(okCounter.await(4, TimeUnit.SECONDS)); assert(failCounter.await(2, TimeUnit.SECONDS)); }

Target:
public void testDoubleClaim() throws CloudnameException, InterruptedException { final Coordinate c = Coordinate.parse("2.service.user.cell"); final CountDownLatch okCounter = new CountDownLatch(1); final CountDownLatch failCounter = new CountDownLatch(1); final CoordinateListener listener = new CoordinateListener() { @Override public void onCoordinateEvent(Event event, String message) { switch (event) { case COORDINATE_OK: okCounter.countDown(); break; case NOT_OWNER: failCounter.countDown(); default: assert(false); break; } } }; final Cloudname cn; try { cn = makeLocalZkCloudname(); } catch (CloudnameException e) { fail("connecting to localhost failed."); return; } try { cn.createCoordinate(c); } catch (CoordinateExistsException e) { fail("should not happen."); } final ServiceHandle handle1 = cn.claim(c); assert(handle1.waitForCoordinateOkSeconds(4)); handle1.registerCoordinateListener(listener); ServiceHandle handle2 = cn.claim(c); assertFalse(handle2.waitForCoordinateOkSeconds(1)); handle2.registerCoordinateListener(listener); assert(okCounter.await(4, TimeUnit.SECONDS)); assert(failCounter.await(2, TimeUnit.SECONDS)); }
Source:
private void initListeners() { Set<Class<? extends ITestNGListener>> listenerClasses = Sets.newHashSet(); Class<? extends ITestNGListenerFactory> listenerFactoryClass = null; for (IClass cls : getTestClasses()) { Class<?> realClass = cls.getRealClass(); TestListenerHelper.ListenerHolder listenerHolder = TestListenerHelper.findAllListeners(realClass, m_annotationFinder); if (listenerFactoryClass == null) { listenerFactoryClass = listenerHolder.getListenerFactoryClass(); } listenerClasses.addAll(listenerHolder.getListenerClasses()); } ITestNGListenerFactory factory = TestListenerHelper.createListenerFactory(m_testClassFinder, listenerFactoryClass); for (Class<? extends ITestNGListener> c : listenerClasses) { if (IClassListener.class.isAssignableFrom(c) && m_classListeners.containsKey(c)) { continue; } ITestNGListener listener = TestListenerHelper.createListener(factory, c); addListener(listener); } }

Target:
private void initListeners() { Set<Class<? extends ITestNGListener>> listenerClasses = Sets.newHashSet(); Class<? extends ITestNGListenerFactory> listenerFactoryClass = null; for (IClass cls : getTestClasses()) { Class<?> realClass = cls.getRealClass(); TestListenerHelper.ListenerHolder listenerHolder = TestListenerHelper.findAllListeners(realClass, m_annotationFinder); if (listenerFactoryClass == null) { listenerFactoryClass = listenerHolder.getListenerFactoryClass(); } listenerClasses.addAll(listenerHolder.getListenerClasses()); } if (listenerFactoryClass == null) { listenerFactoryClass = DefaultListenerFactory.class; } ITestNGListenerFactory factory = TestListenerHelper.createListenerFactory(m_testClassFinder, listenerFactoryClass); for (Class<? extends ITestNGListener> c : listenerClasses) { if (IClassListener.class.isAssignableFrom(c) && m_classListeners.containsKey(c)) { continue; } ITestNGListener listener = factory.createListener(c); addListener(listener); } }
Source:
TopicMetadataLoadingJob(TopicMetadataLoadingRunner topicMetadataLoadingRunner, int intervalSeconds) { this.topicMetadataLoadingRunner = topicMetadataLoadingRunner; this.intervalSeconds = intervalSeconds; ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat("TopicMetadataLoadingExecutor-%d").build(); this.executorService = Executors.newSingleThreadScheduledExecutor(threadFactory); }

Target:
TopicMetadataLoadingJob(TopicMetadataLoadingRunner topicMetadataLoadingRunner, int intervalSeconds) { this.topicMetadataLoadingRunner = topicMetadataLoadingRunner; this.intervalSeconds = intervalSeconds; ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat("TopicMetadataLoadingJob-%d").build(); this.executorService = Executors.newSingleThreadScheduledExecutor(threadFactory); }
Source:
public Object applyUpdateUnsafe(SMRRecord record) { log.trace("Apply[{}] of {}@{} ({})", this, record.getSMRMethod(), Address.isAddress(record.getGlobalAddress()) ? record.getGlobalAddress() : "OPT", record.getSMRArguments()); ICorfuSMRUpcallTarget<T> target = upcallTargetMap.get(record.getSMRMethod()); if (target == null) { throw new RuntimeException("Unknown upcall " + record.getSMRMethod()); } if (!record.isUndoable() || !Address.isAddress(record.getGlobalAddress())) { IUndoRecordFunction<T> undoRecordTarget = undoRecordFunctionMap.get(record.getSMRMethod()); if (undoRecordTarget != null) { record.setUndoRecord(undoRecordTarget .getUndoRecord(object, record.getSMRArguments())); log.trace("Apply[{}] Undo->{}", this, record.getUndoRecord()); } else if (resetSet.contains(record.getSMRMethod())) { record.setUndoRecord(object); object = newObjectFn.get(); log.trace("Apply[{}] Undo->RESET", this); } } return target.upcall(object, record.getSMRArguments()); }

Target:
private Object applyUpdateUnsafe(SMRRecord record) { log.trace("Apply[{}] of {}@{} ({})", this, record.getSMRMethod(), Address.isAddress(record.getGlobalAddress()) ? record.getGlobalAddress() : "OPT", record.getSMRArguments()); ICorfuSMRUpcallTarget<T> target = upcallTargetMap.get(record.getSMRMethod()); if (target == null) { throw new RuntimeException("Unknown upcall " + record.getSMRMethod()); } if (!record.isUndoable() || !Address.isAddress(record.getGlobalAddress())) { IUndoRecordFunction<T> undoRecordTarget = undoRecordFunctionMap.get(record.getSMRMethod()); if (undoRecordTarget != null) { record.setUndoRecord(undoRecordTarget .getUndoRecord(object, record.getSMRArguments())); log.trace("Apply[{}] Undo->{}", this, record.getUndoRecord()); } else if (resetSet.contains(record.getSMRMethod())) { record.setUndoRecord(object); object = newObjectFn.get(); log.trace("Apply[{}] Undo->RESET", this); } } return target.upcall(object, record.getSMRArguments()); }
Source:
public void run() { int exitCode = waitForExit(); ji.setExitCode(exitCode); ReentrantReadWriteLock rwl = PersistenceManager.getDbLock(); try { rwl.writeLock().lock(); JobInfoElement dbJI = pm.getEntity(ji.getJobID(), JobInfoElement.class); if ((dbJI.getStatus() != null) && !dbJI.getStatus().equalsIgnoreCase("KILLED")) { GenieNodeStatistics stats = GenieNodeStatistics.getInstance(); if (exitCode != SubprocessStatus.SUCCESS.code()) { logger.error("Failed to execute job, exit code: " + exitCode); String errMsg = Types.SubprocessStatus.message(exitCode); if ((errMsg == null) || (errMsg.isEmpty())) { errMsg = "Please look at job's stderr for more details"; } ji.setJobStatus(JobStatus.FAILED, "Failed to execute job, Error Message: " + errMsg); stats.incrGenieFailedJobs(); } else { ji.setJobStatus(JobStatus.SUCCEEDED, "Job finished successfully"); stats.incrGenieSuccessfulJobs(); } if (!ji.getDisableLogArchival()) { ji.setArchiveLocation(NetUtil.getArchiveURI(ji.getJobID())); } pm.updateEntity(ji); rwl.writeLock().unlock(); } else { logger.debug("Job has been killed - will not update DB: " + ji.getJobID()); rwl.writeLock().unlock(); } if (config.getBoolean("netflix.genie.server.mail.enable", false)) { logger.info("Sending Job Completion Email to user"); if (sendEmail() != 0) { logger.warn("Failed to Send Email.Will not fail job."); } } else { logger.info("Email Sending is disabled"); } } finally { if (rwl.writeLock().isHeldByCurrentThread()) { rwl.writeLock().unlock(); } } }

Target:
public void run() { GenieNodeStatistics stats = GenieNodeStatistics.getInstance(); int exitCode = waitForExit(); ji.setExitCode(exitCode); ReentrantReadWriteLock rwl = PersistenceManager.getDbLock(); try { rwl.writeLock().lock(); JobInfoElement dbJI = pm.getEntity(ji.getJobID(), JobInfoElement.class); if ((dbJI.getStatus() != null) && !dbJI.getStatus().equalsIgnoreCase("KILLED")) { if (exitCode != SubprocessStatus.SUCCESS.code()) { logger.error("Failed to execute job, exit code: " + exitCode); String errMsg = Types.SubprocessStatus.message(exitCode); if ((errMsg == null) || (errMsg.isEmpty())) { errMsg = "Please look at job's stderr for more details"; } ji.setJobStatus(JobStatus.FAILED, "Failed to execute job, Error Message: " + errMsg); stats.incrGenieFailedJobs(); } else { ji.setJobStatus(JobStatus.SUCCEEDED, "Job finished successfully"); stats.incrGenieSuccessfulJobs(); } if (!ji.getDisableLogArchival()) { ji.setArchiveLocation(NetUtil.getArchiveURI(ji.getJobID())); } pm.updateEntity(ji); rwl.writeLock().unlock(); } else { logger.debug("Job has been killed - will not update DB: " + ji.getJobID()); rwl.writeLock().unlock(); } } finally { if (rwl.writeLock().isHeldByCurrentThread()) { rwl.writeLock().unlock(); } } String emailTo = ji.getUserEmail(); if (emailTo != null) { logger.info("User email address: " + emailTo); if (sendEmail(emailTo)) { stats.incrSuccessfulEmailCount(); } else { logger.warn("Failed to send email."); stats.incrFailedEmailCount(); } } }
Source:
private List<String> parseChipsetPrefixedList(String line, ChipsetType chipset) { List<String> values = new ArrayList<>(); if (StringUtils.isEmpty(line)) { return values; } for (String element : line.split(",")) { Pair<String, String> pair = parseSlashSeparatedPair(element); if (pair == null) { String value = element.trim(); if (!value.isEmpty()) { values.add(value); } } else if (chipset != null && chipset.getChipsetName().equalsIgnoreCase(pair.getFirst())) { values.add(pair.getSecond()); } } return values; }

Target:
private List<String> parseChipsetPrefixedList(String line, ChipsetType chipset) { if (StringUtils.isEmpty(line)) { return Collections.emptyList(); } List<String> values = new ArrayList<>(); for (String element : line.split(",")) { Pair<String, String> pair = parseSlashSeparatedPair(element); if (pair == null) { String value = element.trim(); if (!value.isEmpty()) { values.add(value); } } else if (chipset != null && chipset.getChipsetName().equalsIgnoreCase(pair.getFirst())) { values.add(pair.getSecond()); } } return values; }
Source:
private void fetchNameNodeTokenInternal(final String renewer, final Credentials cred, final String userToProxy, final URI uri) throws IOException, HadoopSecurityManagerException { FileSystem fs = null; try { if (uri == null) { fs = FileSystem.newInstance(conf); } else { fs = FileSystem.newInstance(uri, conf); } logger.info("Getting DFS token from " + fs.getUri()); try { final Token<?>[] fsTokens = fs.addDelegationTokens(renewer, cred); for (int i = 0; i < fsTokens.length; i++) { final Token<?> fsToken = fsTokens[i]; logger.info(String.format( "DFS token from namenode pre-fetched, token kind: %s, token service: %s", fsToken.getKind(), fsToken.getService())); } } catch (Exception e) { logger.error("Failed to fetch DFS token for "); throw new HadoopSecurityManagerException( "Failed to fetch DFS token for " + userToProxy); } } finally { if (fs != null) { fs.close(); } } }

Target:
private void fetchNameNodeTokenInternal(final String renewer, final Credentials cred, final String userToProxy, final URI uri) throws IOException, HadoopSecurityManagerException { FileSystem fs = null; try { if (uri == null) { fs = FileSystem.newInstance(conf); } else { fs = FileSystem.newInstance(uri, conf); } logger.info("Getting DFS token from " + fs.getUri()); try { final Token<?>[] fsTokens = fs.addDelegationTokens(renewer, cred); for (int i = 0; i < fsTokens.length; i++) { final Token<?> fsToken = fsTokens[i]; logger.info(String.format( "DFS token from namenode pre-fetched, token kind: %s, token service: %s", fsToken.getKind(), fsToken.getService())); } } catch (Exception e) { logger.error("Failed to fetch DFS token for " + userToProxy); throw new HadoopSecurityManagerException( "Failed to fetch DFS token for " + userToProxy); } } finally { if (fs != null) { fs.close(); } } }
Source:
public static int getRawDataType(final VariableIF variable) { VariableDS ds = (VariableDS) variable; final DataType type = ds.getDataType(); return transcodeNetCDFDataType(type,variable.isUnsigned()); }

Target:
public static int getRawDataType(final VariableIF variable) { VariableDS ds = (VariableDS) variable; final DataType type; if (Boolean.getBoolean(ENHANCE_SCALE_MISSING)) { type = ds.getDataType(); } else { type = ds.getOriginalDataType(); } return transcodeNetCDFDataType(type,variable.isUnsigned()); }
Source:
private Observable<CoreOperation> createCoreOperation(@NonNull final CoreValue<U> value) { switch (value.type()) { case UPDATE: return createCoreOperation((CoreUpdateValue<U>) value); case DELETE: return createCoreOperation((CoreDeleteValue<U>) value); default: throw new IllegalStateException("Unknown value type " + value.type()); } }

Target:
private Observable<CoreOperation> createCoreOperation(@NonNull final CoreValue<U> value) { Observable<CoreOperation> valueObservable; switch (value.type()) { case PUT: valueObservable = createCoreOperation((CoreValuePut<U>) value); break; case DELETE: valueObservable = createCoreOperation((CoreValueDelete<U>) value); break; default: throw new IllegalStateException("Unknown value type " + value.type()); } return valueObservable .onErrorReturn(__ -> value.noOperation()) .doOnNext(this::releaseIfNoOp) .filter(CoreOperation::isValid); }
Source:
public ScalarFunctionImplementation getScalarFunctionImplementation(Signature signature) { checkArgument(signature.getKind() == SCALAR, "%s is not a scalar function", signature); checkArgument(signature.getTypeVariableConstraints().isEmpty(), "%s has unbound type parameters", signature); try { return specializedScalarCache.getUnchecked(getSpecializedFunctionKey(signature)); } catch (UncheckedExecutionException e) { if (e.getCause() instanceof ByteCodeException) { throw new PrestoException(StandardErrorCode.NOT_SUPPORTED, e.getCause()); } throwIfUnchecked(e.getCause()); throw new RuntimeException(e.getCause()); } }

Target:
public ScalarFunctionImplementation getScalarFunctionImplementation(Signature signature) { checkArgument(signature.getKind() == SCALAR, "%s is not a scalar function", signature); checkArgument(signature.getTypeVariableConstraints().isEmpty(), "%s has unbound type parameters", signature); try { return specializedScalarCache.getUnchecked(getSpecializedFunctionKey(signature)); } catch (UncheckedExecutionException e) { throw Throwables.propagate(e.getCause()); } }
Source:
public boolean filterOut(final SAMRecord first, final SAMRecord second) { return (values.contains(first.getAttribute(tag)) && values.contains(second.getAttribute(tag))) != includeReads; }

Target:
public boolean filterOut(final SAMRecord first, final SAMRecord second) { if (includeReads) { return !(values.contains(first.getAttribute(tag)) || values.contains(second.getAttribute(tag))); } else { return values.contains(first.getAttribute(tag)) && values.contains(second.getAttribute(tag)); } }