auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Set<User> getUsersFromIds(final String ids, final String delimiter) { final Set<User> userSet = new HashSet<>(); final StringTokenizer tokenizer = new StringTokenizer(ids, delimiter); while (tokenizer.hasMoreTokens()) { boolean idNotFound = Boolean.FALSE; Exception exception = null; final String token = tokenizer.nextToken().trim(); if (Validator.isEmailAddress(token)) { try { User user = APILocator.getUserAPI() .loadByUserByEmail(token, APILocator.getUserAPI().getSystemUser(), false); userSet.add(user); } catch (Exception e) { idNotFound = Boolean.TRUE; exception = e; } } else { try { User user = APILocator.getUserAPI() .loadUserById(token, APILocator.getUserAPI().getSystemUser(), false); userSet.add(user); continue; } catch (Exception e) { idNotFound = Boolean.TRUE; exception = e; } try { final Role role = APILocator.getRoleAPI().loadRoleByKey(token); final List<User> approvingUsersInRole = APILocator.getRoleAPI() .findUsersForRole(role); userSet.addAll(approvingUsersInRole); idNotFound = Boolean.FALSE; } catch (DotSecurityException e) { Logger.warn(WorkflowActionletUtil.class, "An error occurred when retrieving users from role key: " + token, e); } catch (DotDataException e) { idNotFound = Boolean.TRUE; exception = e; } } if (idNotFound) { Logger.warn(WorkflowActionletUtil.class, "The following email/userID/role key could not be found: " + token, exception); } } return userSet; }

Target:
public static Set<User> getUsersFromIds(final String ids, final String delimiter) { final Set<User> userSet = new HashSet<>(); final StringTokenizer tokenizer = new StringTokenizer(ids, delimiter); while (tokenizer.hasMoreTokens()) { boolean idNotFound = Boolean.FALSE; Exception exception = null; final String token = tokenizer.nextToken().trim(); if (Validator.isEmailAddress(token)) { try { final User user = APILocator.getUserAPI() .loadByUserByEmail(token, APILocator.getUserAPI().getSystemUser(), false); userSet.add(user); } catch (Exception e) { idNotFound = Boolean.TRUE; exception = e; } } else { try { final User user = APILocator.getUserAPI() .loadUserById(token, APILocator.getUserAPI().getSystemUser(), false); userSet.add(user); continue; } catch (Exception e) { idNotFound = Boolean.TRUE; exception = e; } try { final Role role = APILocator.getRoleAPI().loadRoleByKey(token); final List<User> approvingUsersInRole = APILocator.getRoleAPI() .findUsersForRole(role); userSet.addAll(approvingUsersInRole); idNotFound = Boolean.FALSE; } catch (DotSecurityException e) { Logger.warn(WorkflowActionletUtil.class, "An error occurred when retrieving users from role key: " + token, e); } catch (DotDataException e) { idNotFound = Boolean.TRUE; exception = e; } } if (idNotFound) { Logger.warn(WorkflowActionletUtil.class, "The following email/userID/role key could not be found: " + token, exception); } } return userSet; }
Source:
private void doAddNewBranch() { final String branchName = nameTxtBox.getText().trim(); if ("".equals(branchName)) { nameTxtBox.setFocus(true); return; } final String rev = irevTxtBox.getText().trim(); if ("".equals(rev)) { irevTxtBox.setText("HEAD"); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { irevTxtBox.selectAll(); irevTxtBox.setFocus(true); } }); return; } addBranch.setEnabled(false); ProjectApi.createBranch(getProjectKey(), branchName, rev, new GerritCallback<BranchInfo>() { @Override public void onSuccess(BranchInfo branch) { showAddedBranch(branch); addBranch.setEnabled(true); nameTxtBox.setText(""); irevTxtBox.setText(""); delBranch.setVisible(branchTable.hasBranchCanDelete()); if (branchTable.matches(branch)) { branchTable.insert(branch); } } @Override public void onFailure(Throwable caught) { addBranch.setEnabled(true); selectAllAndFocus(nameTxtBox); new ErrorDialog(caught.getMessage()).center(); } }); }

Target:
private void doAddNewBranch() { final String branchName = nameTxtBox.getText().trim(); if ("".equals(branchName)) { nameTxtBox.setFocus(true); return; } final String rev = irevTxtBox.getText().trim(); if ("".equals(rev)) { irevTxtBox.setText("HEAD"); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { irevTxtBox.selectAll(); irevTxtBox.setFocus(true); } }); return; } addBranch.setEnabled(false); ProjectApi.createBranch(getProjectKey(), branchName, rev, new GerritCallback<BranchInfo>() { @Override public void onSuccess(BranchInfo branch) { showAddedBranch(branch); query = new Query(match).start(start).run(); } @Override public void onFailure(Throwable caught) { addBranch.setEnabled(true); selectAllAndFocus(nameTxtBox); new ErrorDialog(caught.getMessage()).center(); } }); }
Source:
public Map<String, Object> state() { Map<String, Object> state = new HashMap<>(); state.put(Constants.HAWKULAR_APM_TRACEID, traceContext.getTraceId()); Object reportingLevelFromTags = ReportingLevel.parse(getTags().get(Tags.SAMPLING_PRIORITY.getKey())); if (reportingLevelFromTags != null) { state.put(Constants.HAWKULAR_APM_LEVEL, reportingLevelFromTags); } else if (traceContext.getReportingLevel() != null) { state.put(Constants.HAWKULAR_APM_LEVEL, traceContext.getReportingLevel().toString()); } Object transactionFromTags = getTags().get(Constants.PROP_TRANSACTION_NAME); if (traceContext.getTransaction() != null) { state.put(Constants.HAWKULAR_APM_TXN, traceContext.getTransaction()); } else if (transactionFromTags != null) { state.put(Constants.HAWKULAR_APM_TXN, transactionFromTags); } return state; }

Target:
public Map<String, Object> state() { Map<String, Object> state = new HashMap<>(); state.put(Constants.HAWKULAR_APM_TRACEID, traceContext.getTraceId()); Object reportingLevelFromTags = ReportingLevel.parse(getTags().get(Tags.SAMPLING_PRIORITY.getKey())); if (reportingLevelFromTags != null) { state.put(Constants.HAWKULAR_APM_LEVEL, reportingLevelFromTags); } else if (traceContext.getReportingLevel() != null) { state.put(Constants.HAWKULAR_APM_LEVEL, traceContext.getReportingLevel().toString()); } if (traceContext.getTransaction() != null) { state.put(Constants.HAWKULAR_APM_TXN, traceContext.getTransaction()); } else { Object transactionFromTags = getTags().get(Constants.PROP_TRANSACTION_NAME); if (transactionFromTags != null) { state.put(Constants.HAWKULAR_APM_TXN, transactionFromTags); } } return state; }
Source:
public void getJudgment_NOT_NULL_TEXT_CONTENT() { Judgment judgment = TestInMemoryObjectFactory.createSimpleCcJudgment(); JudgmentTextContent textContent = new JudgmentTextContent(); textContent.setRawTextContent("raw content"); judgment.setTextContent(textContent); judgmentRepository.save(judgment); Judgment actualJudgment = judgmentRepository.findOneAndInitialize(judgment.getId()); assertNotNull("judgment text content is null", actualJudgment.getTextContent()); assertEquals("raw content", actualJudgment.getTextContent().getRawTextContent()); }

Target:
public void getJudgment_NOT_NULL_TEXT_CONTENT() { Judgment judgment = TestInMemoryObjectFactory.createSimpleNacJudgment(); JudgmentTextContent textContent = new JudgmentTextContent(); textContent.setRawTextContent("raw content"); judgment.setTextContent(textContent); judgmentRepository.save(judgment); Judgment actualJudgment = judgmentRepository.findOneAndInitialize(judgment.getId()); assertNotNull("judgment text content is null", actualJudgment.getTextContent()); assertEquals("raw content", actualJudgment.getTextContent().getRawTextContent()); }
Source:
private List<StoreKey> addPutMessagesToReplicasOfPartition(PartitionId partitionId, List<Host> hosts, int count) throws MessageFormatException, IOException { List<StoreKey> ids = new ArrayList<>(); for (int i = 0; i < count; i++) { short accountId = Utils.getRandomShort(TestUtils.RANDOM); short containerId = Utils.getRandomShort(TestUtils.RANDOM); short blobIdVersion = CommonTestUtils.getCurrentBlobIdVersion(); BlobId id = new BlobId(blobIdVersion, BlobId.BlobIdType.NATIVE, ClusterMapUtils.UNKNOWN_DATACENTER_ID, accountId, containerId, partitionId); ids.add(id); Pair<ByteBuffer, MessageInfo> putMsgInfo = getPutMessage(id, accountId, containerId, i % 2 == 0 ? true : false); for (Host host : hosts) { host.addMessage(partitionId, putMsgInfo.getSecond(), putMsgInfo.getFirst().duplicate()); } } return ids; }

Target:
private List<StoreKey> addPutMessagesToReplicasOfPartition(PartitionId partitionId, List<Host> hosts, int count) throws MessageFormatException, IOException { List<StoreKey> ids = new ArrayList<>(); for (int i = 0; i < count; i++) { short accountId = Utils.getRandomShort(TestUtils.RANDOM); short containerId = Utils.getRandomShort(TestUtils.RANDOM); short blobIdVersion = CommonTestUtils.getCurrentBlobIdVersion(); boolean toEncrypt = i % 2 == 0; BlobId id = new BlobId(blobIdVersion, BlobId.BlobIdType.NATIVE, ClusterMapUtils.UNKNOWN_DATACENTER_ID, accountId, containerId, partitionId, toEncrypt); ids.add(id); Pair<ByteBuffer, MessageInfo> putMsgInfo = getPutMessage(id, accountId, containerId, toEncrypt); for (Host host : hosts) { host.addMessage(partitionId, putMsgInfo.getSecond(), putMsgInfo.getFirst().duplicate()); } } return ids; }
Source:
public static OrcReaderOptions createDefaultTestConfig() { return new OrcReaderOptions( new DataSize(1, MEGABYTE), new DataSize(1, MEGABYTE), new DataSize(1, MEGABYTE), false); }

Target:
public static OrcReaderOptions createDefaultTestConfig() { return createTestingReaderOptions(false); }
Source:
public GlobalMetricsConfigurationBuilder metrics() { globalConfig.metrics().gauges(true); return globalConfig.metrics(); }

Target:
public GlobalMetricsConfigurationBuilder metrics() { return globalConfig.metrics(); }
Source:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseDetailsBundle courseDetails; CourseInfo output; try { courseDetails = logic.getCourseDetails(courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); List<InstructorAttributes> instructors = logic.getInstructorsForCourse(courseId); String courseStudentListAsCsv = logic.getCourseStudentListAsCsv(courseId, userInfo.id); output = new CourseInfo(instructor, courseDetails, instructors, courseStudentListAsCsv); } catch (EntityDoesNotExistException e) { return new JsonResult("No course with given instructor is found.", HttpStatus.SC_NOT_FOUND); } return new JsonResult(output); }

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseDetailsBundle courseDetails; CourseInfo output; try { courseDetails = logic.getCourseDetails(courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); List<InstructorAttributes> instructors = logic.getInstructorsForCourse(courseId); output = new CourseInfo(instructor, courseDetails, instructors); } catch (EntityDoesNotExistException e) { return new JsonResult("No course with given instructor is found.", HttpStatus.SC_NOT_FOUND); } return new JsonResult(output); }
Source:
protected String replaceNicsMacSequenceInBootArgs(String oldMacSequence, String newMacSequence, VirtualMachineTO vmSpec) { String bootArgs = vmSpec.getBootArgs(); if (!StringUtils.isEmpty(bootArgs) && !StringUtils.isEmpty(oldMacSequence) && !StringUtils.isEmpty(newMacSequence)) { return bootArgs.replace(oldMacSequence, newMacSequence); } return ""; }

Target:
protected String replaceNicsMacSequenceInBootArgs(String oldMacSequence, String newMacSequence, VirtualMachineTO vmSpec) { String bootArgs = vmSpec.getBootArgs(); if (!StringUtils.isBlank(bootArgs) && !StringUtils.isBlank(oldMacSequence) && !StringUtils.isBlank(newMacSequence)) { return bootArgs.replace(oldMacSequence, newMacSequence); } return ""; }
Source:
protected ZkClient(IZkConnection zkConnection, int connectionTimeout, long operationRetryTimeout, PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey, String monitorInstanceName, boolean monitorRootPathOnly) { if (zkConnection == null) { throw new NullPointerException("Zookeeper connection is null!"); } _syncOnNewSession = true; _connection = zkConnection; _pathBasedZkSerializer = zkSerializer; _operationRetryTimeoutInMillis = operationRetryTimeout; _isNewSessionEventFired = false; _asyncCallRetryThread = new ZkAsyncRetryThread(zkConnection.getServers()); _asyncCallRetryThread.start(); connect(connectionTimeout, this); try { if (monitorKey != null && !monitorKey.isEmpty() && monitorType != null && !monitorType .isEmpty()) { _monitor = new ZkClientMonitor(monitorType, monitorKey, monitorInstanceName, monitorRootPathOnly, _eventThread); _monitor.register(); } else { LOG.info("ZkClient monitor key or type is not provided. Skip monitoring."); } } catch (JMException e) { LOG.error("Error in creating ZkClientMonitor", e); } }

Target:
protected ZkClient(IZkConnection zkConnection, int connectionTimeout, long operationRetryTimeout, PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey, String monitorInstanceName, boolean monitorRootPathOnly) { if (zkConnection == null) { throw new NullPointerException("Zookeeper connection is null!"); } _connection = zkConnection; _pathBasedZkSerializer = zkSerializer; _operationRetryTimeoutInMillis = operationRetryTimeout; _isNewSessionEventFired = false; _asyncCallRetryThread = new ZkAsyncRetryThread(zkConnection.getServers()); _asyncCallRetryThread.start(); connect(connectionTimeout, this); try { if (monitorKey != null && !monitorKey.isEmpty() && monitorType != null && !monitorType .isEmpty()) { _monitor = new ZkClientMonitor(monitorType, monitorKey, monitorInstanceName, monitorRootPathOnly, _eventThread); _monitor.register(); } else { LOG.info("ZkClient monitor key or type is not provided. Skip monitoring."); } } catch (JMException e) { LOG.error("Error in creating ZkClientMonitor", e); } }
Source:
public static ArrayList<String> getMafs(String maf_file) { if (!isMafFile(maf_file)) throw new RuntimeException("maf file not found"); ArrayList<String> list = null; try { list = new ArrayList<String>(); File file = new File(maf_file); Scanner sc = new Scanner(file); while (sc.hasNextLine()) { String line = sc.nextLine(); if (!line.startsWith("#")) list.add(line); } sc.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } return list; }

Target:
public static ArrayList<String> getMafs(String maf_file) { if (!isMafFile(maf_file)) { throw new RuntimeException("maf file not found"); } ArrayList<String> list = null; try { list = new ArrayList<String>(); File file = new File(maf_file); Scanner sc = new Scanner(file); while (sc.hasNextLine()) { String line = sc.nextLine(); if (!line.startsWith("#")) { list.add(line); } } sc.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } return list; }
Source:
public static void setFeatureValue(FeatureStructure aFS, Feature aFeature, Object aValue) { switch (aFeature.getRange().getName()) { case CAS.TYPE_NAME_STRING: aFS.setStringValue(aFeature, aValue == null ? null : aValue.toString()); break; case CAS.TYPE_NAME_BOOLEAN: aFS.setBooleanValue(aFeature, Boolean.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_FLOAT: aFS.setFloatValue(aFeature, Float.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_INTEGER: aFS.setIntValue(aFeature, Integer.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_BYTE: aFS.setByteValue(aFeature, Byte.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_DOUBLE: aFS.setDoubleValue(aFeature, Double.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_LONG: aFS.setLongValue(aFeature, Long.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_SHORT: aFS.setShortValue(aFeature, Short.valueOf(aValue.toString())); break; default: } }

Target:
public static void setFeatureValue(FeatureStructure aFS, Feature aFeature, Object aValue) { switch (aFeature.getRange().getName()) { case CAS.TYPE_NAME_STRING: aFS.setStringValue(aFeature, aValue == null ? null : aValue.toString()); break; case CAS.TYPE_NAME_BOOLEAN: aFS.setBooleanValue(aFeature, Boolean.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_FLOAT: aFS.setFloatValue(aFeature, Float.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_INTEGER: aFS.setIntValue(aFeature, Integer.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_BYTE: aFS.setByteValue(aFeature, Byte.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_DOUBLE: aFS.setDoubleValue(aFeature, Double.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_LONG: aFS.setLongValue(aFeature, Long.valueOf(aValue.toString())); break; case CAS.TYPE_NAME_SHORT: aFS.setShortValue(aFeature, Short.valueOf(aValue.toString())); break; default: return; } }
Source:
protected void runOneIteration() throws Exception { logger.info("closing idle connections..."); reapableConnectionManager.closeIdleConnections(clientConfig.getMaxConnectionIdleTime(), clientConfig.getMaxConnectionIdleTimeDurationTimeUnit()); }

Target:
protected void runOneIteration() throws Exception { logger.debug("closing idle connections..."); reapableConnectionManager.closeIdleConnections(clientConfig.getMaxConnectionIdleTime(), clientConfig.getMaxConnectionIdleTimeDurationTimeUnit()); }
Source:
public static String initDef(String className, String body, List<Pair<TypeDescriptor, String>> params, Boolean stateMachine) { StringBuilder source = new StringBuilder(""); source.append(ModifierNames.NoReturn + " "); source.append(className + "::" + GenerationNames.initFunctionName(className) + "("); source.append(PrivateFunctionalTemplates.paramList(params) + ")"); source.append("\n{\n"); source.append(GenerationNames.InitializerFixFunctionNames.InitPorts + "();\n"); if (stateMachine) { source.append(GenerationNames.InitializerFixFunctionNames.InitStateMachine + "();\n"); } source.append(body + "\n"); source.append("}\n"); return source.toString(); }

Target:
public static String initDef(String className, String body, List<Pair<TypeDescriptor, String>> params, Boolean stateMachine) { StringBuilder source = new StringBuilder(""); source.append(ModifierNames.NoReturn + " "); source.append(className + "::" + GenerationNames.initFunctionName(className) + "("); source.append(PrivateFunctionalTemplates.paramList(params) + ")" + "\n{\n"); source.append(GenerationNames.InitializerFixFunctionNames.InitPorts + "();\n"); if (stateMachine) { source.append(GenerationNames.InitializerFixFunctionNames.InitStateMachine + "();\n"); } source.append(body + "\n" + "}\n"); return source.toString(); }
Source:
public DistributedRuntimeUDFContext createRuntimeContext(MetricGroup metrics) { Environment env = getEnvironment(); return new IterativeRuntimeUdfContext(env.getTaskInfo(), getUserCodeClassLoader(), getExecutionConfig(), env.getDistributedCacheEntries(), this.accumulatorMap, metrics, ExternalResourceUtils.getExternalResourceInfo(env.getExternalResourceDrivers(), env.getTaskManagerInfo().getConfiguration())); }

Target:
public DistributedRuntimeUDFContext createRuntimeContext(MetricGroup metrics) { Environment env = getEnvironment(); return new IterativeRuntimeUdfContext(env.getTaskInfo(), getUserCodeClassLoader(), getExecutionConfig(), env.getDistributedCacheEntries(), this.accumulatorMap, metrics, env.getExternalResourceInfoProvider()); }
Source:
public static String getOriginalFromTempFilename (String filename) { if (filename.endsWith(".tmp")) { return filename.substring(0, filename.length() - TEMP_LEN); } else { return filename; } }

Target:
public static String getOriginalFromTempFilename (String filename) { if (filename.endsWith(TEMP_FILE_EXT)) { return filename.substring(0, filename.length() - TEMP_LEN); } else { return filename; } }
Source:
public SortedSet<String> getCurrentChildren(String fullPath) { TreeNode node = find(fullPath); if ( node == null || node.nodeState.get() != NodeState.LIVE ) { return null; } ConcurrentMap<String, TreeNode> map = node.children.get(); SortedSet<String> result; if ( map == null ) { result = Collections.emptySortedSet(); } else { result = ImmutableSortedSet.copyOf(map.keySet()); } return node.nodeState.get() == NodeState.LIVE ? result : null; }

Target:
public Map<String, ChildData> getCurrentChildren(String fullPath) { TreeNode node = find(fullPath); if ( node == null || node.nodeState.get() != NodeState.LIVE ) { return null; } ConcurrentMap<String, TreeNode> map = node.children.get(); Map<String, ChildData> result; if ( map == null ) { result = ImmutableMap.of(); } else { ImmutableMap.Builder<String, ChildData> builder = ImmutableMap.builder(); for ( Map.Entry<String, TreeNode> entry : map.entrySet() ) { TreeNode childNode = entry.getValue(); ChildData childData = new ChildData(childNode.path, childNode.stat.get(), childNode.data.get()); if ( childNode.nodeState.get() == NodeState.LIVE ) { builder.put(entry.getKey(), childData); } } result = builder.build(); } return node.nodeState.get() == NodeState.LIVE ? result : null; }
Source:
protected Operation prepareOperation() { MapOperationProvider operationProvider = getMapOperationProvider(parameters.name); MapOperation op; if (parameters.ttl == DEFAULT_TTL) { op = operationProvider.createPutIfAbsentOperation(parameters.name, parameters.key, parameters.value); } else { op = operationProvider.createPutIfAbsentWithExpiryOperation(parameters.name, parameters.key, parameters.value, parameters.ttl, DEFAULT_MAX_IDLE); } op.setThreadId(parameters.threadId); return op; }

Target:
protected Operation prepareOperation() { MapOperationProvider operationProvider = getMapOperationProvider(parameters.name); MapOperation op = operationProvider.createPutIfAbsentOperation(parameters.name, parameters.key, parameters.value, parameters.ttl, DEFAULT_MAX_IDLE); op.setThreadId(parameters.threadId); return op; }
Source:
public static MultiFactorAuthenticationService createServiceFrom(final HttpServletRequest request, final HttpClient httpClient, final List<String> supportedLevelsOfAuthentication) { LOGGER.debug("Attempting to extract multifactor authentication parameters from the request"); final String targetService = request.getParameter(CONST_PARAM_TARGET_SERVICE); final String loa = request.getParameter(CONST_PARAM_LOA); final String serviceToUse = StringUtils.hasText(targetService) ? targetService : request.getParameter(CONST_PARAM_SERVICE); if (!StringUtils.hasText(serviceToUse)) { LOGGER.debug("Request has no service associated with it."); return null; } if (!StringUtils.hasText(loa)) { LOGGER.debug("Request has no associated with it.", CONST_PARAM_LOA); return null; } if (!supportedLevelsOfAuthentication.contains(loa)) { LOGGER.debug("Multifactor authentication service does not support parameter value [{}].", CONST_PARAM_LOA, loa); return null; } final String id = cleanupUrl(serviceToUse); final String artifactId = request.getParameter(CONST_PARAM_TICKET); final MultiFactorAuthenticationService svc = new MultiFactorAuthenticationService(id, serviceToUse, artifactId, httpClient, loa); LOGGER.debug("Created multifactor authentication request for with as [{}].", svc.getId(), CONST_PARAM_LOA, svc.getLOA()); return svc; }

Target:
public static MultiFactorAuthenticationService createServiceFrom(final HttpServletRequest request, final HttpClient httpClient, final List<String> supportedLevelsOfAuthentication) { LOGGER.debug("Attempting to extract multifactor authentication parameters from the request"); final String targetService = request.getParameter(CONST_PARAM_TARGET_SERVICE); final String loa = request.getParameter(CONST_PARAM_LOA); final String serviceToUse = StringUtils.hasText(targetService) ? targetService : request.getParameter(CONST_PARAM_SERVICE); if (!StringUtils.hasText(serviceToUse)) { LOGGER.debug("Request has no request parameter [{}]", CONST_PARAM_SERVICE); return null; } if (!StringUtils.hasText(loa)) { LOGGER.debug("Request has no request parameter [{}]", CONST_PARAM_LOA); return null; } if (!supportedLevelsOfAuthentication.contains(loa)) { LOGGER.debug("Multifactor authentication service does not support parameter value [{}].", CONST_PARAM_LOA, loa); return null; } final String id = cleanupUrl(serviceToUse); final String artifactId = request.getParameter(CONST_PARAM_TICKET); final MultiFactorAuthenticationService svc = new MultiFactorAuthenticationService(id, serviceToUse, artifactId, httpClient, loa); LOGGER.debug("Created multifactor authentication request for with as [{}].", svc.getId(), CONST_PARAM_LOA, svc.getLoa()); return svc; }
Source:
public boolean isActive(FeatureState featureState, FeatureUser user) { ApplicationContext applicationContext = ContextClassLoaderApplicationContextHolder.get(); if (applicationContext == null) { return false; } Environment environment = applicationContext.getEnvironment(); return environment.getProperty(getPropertyName(featureState), Boolean.TYPE, false); }

Target:
public boolean isActive(FeatureState featureState, FeatureUser user) { ApplicationContext applicationContext = ContextClassLoaderApplicationContextHolder.get(); if (applicationContext == null) { throw new IllegalStateException("ApplicationContext could not be found, which can occur if there is no " + "bean for TogglzApplicationContextBinderApplicationListener when TogglzAutoConfiguration is not " + "being used"); } Environment environment = applicationContext.getEnvironment(); return environment.getProperty(getPropertyName(featureState), Boolean.TYPE, false); }
Source:
public File renameInvalidSource() throws StorageException { File sourcedFile = sourceFile(here); File renamedFile = new File(here, String.format("%s%s", sourcedFile.getName(), ".error")); if (!sourcedFile.renameTo(renamedFile)) { throw new StorageException("Error renaming file"); } return renamedFile; }

Target:
public File renameInvalidSource() throws StorageException { File sourceFile = sourceFile(here); File renamedFile = new File(here, String.format("%s.error", sourceFile.getName())); if (!sourceFile.renameTo(renamedFile)) { throw new StorageException("Error renaming file"); } return renamedFile; }
Source:
public <T extends OAuth2AuthorizedClient> T loadAuthorizedClient(String clientRegistrationId, String principalName) { Assert.hasText(clientRegistrationId, "clientRegistrationId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); SqlParameterValue[] parameters = new SqlParameterValue[] { new SqlParameterValue(Types.VARCHAR, clientRegistrationId), new SqlParameterValue(Types.VARCHAR, principalName) }; try (LobCreator lobCreator = this.lobHandler.getLobCreator()) { PreparedStatementSetter pss = new LobCreatorArgumentPreparedStatementSetter(lobCreator, parameters); List<OAuth2AuthorizedClient> result = this.jdbcOperations.query(LOAD_AUTHORIZED_CLIENT_SQL, pss, this.authorizedClientRowMapper); return !result.isEmpty() ? (T) result.get(0) : null; } }

Target:
public <T extends OAuth2AuthorizedClient> T loadAuthorizedClient(String clientRegistrationId, String principalName) { Assert.hasText(clientRegistrationId, "clientRegistrationId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); SqlParameterValue[] parameters = new SqlParameterValue[] { new SqlParameterValue(Types.VARCHAR, clientRegistrationId), new SqlParameterValue(Types.VARCHAR, principalName) }; PreparedStatementSetter pss = new ArgumentPreparedStatementSetter(parameters); List<OAuth2AuthorizedClient> result = this.jdbcOperations.query(LOAD_AUTHORIZED_CLIENT_SQL, pss, this.authorizedClientRowMapper); return !result.isEmpty() ? (T) result.get(0) : null; }
Source:
public void deploy(MavenProject project, String container, RuntimeStrategy strategy) throws MojoFailureException { KieContainerResource kieContainer = new KieContainerResource(); kieContainer.setContainerId(container); ReleaseId releaseId = new ReleaseId(); releaseId.setGroupId(project.getGroupId()); releaseId.setArtifactId(project.getArtifactId()); releaseId.setVersion(project.getVersion()); kieContainer.setReleaseId(releaseId); KieServerConfigItem configItem = new KieServerConfigItem(); configItem.setName("RuntimeStrategy"); configItem.setValue(strategy.name()); configItem.setType("BPM"); kieContainer.addConfigItem(configItem); ServiceResponse<KieContainerResource> serviceResponse = client.createContainer(container, kieContainer); ServiceResponse.ResponseType type = serviceResponse.getType(); String msg = serviceResponse.getMsg(); LOG.info("Deploy Response: {}", serviceResponse); if (ServiceResponse.ResponseType.FAILURE.equals(type)) { throw new MojoFailureException(msg); } }

Target:
public void deploy(MavenProject project, String container, RuntimeStrategy strategy) throws MojoFailureException { KieContainerResource kieContainer = new KieContainerResource(); kieContainer.setContainerId(container); ReleaseId releaseId = new ReleaseId(); releaseId.setGroupId(project.getGroupId()); releaseId.setArtifactId(project.getArtifactId()); releaseId.setVersion(project.getVersion()); kieContainer.setReleaseId(releaseId); if (strategy != null) { KieServerConfigItem configItem = new KieServerConfigItem(); configItem.setName("RuntimeStrategy"); configItem.setValue(strategy.name()); configItem.setType("BPM"); kieContainer.addConfigItem(configItem); } ServiceResponse<KieContainerResource> serviceResponse = client.createContainer(container, kieContainer); ServiceResponse.ResponseType type = serviceResponse.getType(); String msg = serviceResponse.getMsg(); LOG.info("Deploy Response: {}", serviceResponse); if (ServiceResponse.ResponseType.FAILURE.equals(type)) { throw new MojoFailureException(msg); } }
Source:
public ScheduleBootstrapper scheduleBootstrapper() { return new ScheduleBootstrapper( executorService(10, "ScheduleBootstrapper"), workers.scheduleBootstrapTaskFactory() ); }

Target:
public ScheduleBootstrapper scheduleBootstrapper() { return new ScheduleBootstrapper( executorService(NUMBER_OF_SCHEDULE_BOOTSTRAP_THREADS, "ScheduleBootstrapper"), workers.scheduleBootstrapTaskFactory() ); }
Source:
public SqlJsonPrettyFunction() { super("JSON_PRETTY", SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(SqlTypeName.VARCHAR, 20), null, OperandTypes.ANY, SqlFunctionCategory.SYSTEM); }

Target:
public SqlJsonPrettyFunction() { super("JSON_PRETTY", SqlKind.OTHER_FUNCTION, ReturnTypes.VARCHAR_2000, null, OperandTypes.ANY, SqlFunctionCategory.SYSTEM); }
Source:
public JSchUIConnectionManager(IRemoteServices services) { fConnMgr = (JSchConnectionManager) services.getConnectionManager(); fConnMgr.setDefaultAuthenticatorFactory(new IUserAuthenticatorFactory() { @Override public IUserAuthenticator createUserAuthenticator(IRemoteConnection conn) { return new RemoteAuthenticator(conn); } }); }

Target:
public JSchUIConnectionManager(IRemoteServices services) { fConnMgr = (JSchConnectionManager) services.getConnectionManager(); }
Source:
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Preconditions.checkNotNull(sender, "Sender cannot be null"); Preconditions.checkNotNull(args, "Arguments cannot be null"); Preconditions.checkNotNull(alias, "Alias cannot be null"); switch (args.length) { case 1: return StringUtil.copyPartialMatches(args[0], SUBCOMMANDS, new ArrayList<>(SUBCOMMANDS.size())); case 2: switch (SUBCOMMAND_MAP.get(args[0])) { case PROPERTY: return StringUtil .copyPartialMatches(args[1], System.getProperties().stringPropertyNames(), new ArrayList<>( System.getProperties().stringPropertyNames() .size())); case WORLD: if (sender instanceof Player) { Collection<String> worlds = getWorldNames(); return StringUtil .copyPartialMatches(args[1], worlds, new ArrayList<>(worlds.size())); } default: } default: } return Collections.emptyList(); }

Target:
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Preconditions.checkNotNull(sender, "Sender cannot be null"); Preconditions.checkNotNull(args, "Arguments cannot be null"); Preconditions.checkNotNull(alias, "Alias cannot be null"); switch (args.length) { case 1: return StringUtil.copyPartialMatches(args[0], SUBCOMMANDS, new ArrayList<>(SUBCOMMANDS.size())); case 2: switch (SUBCOMMAND_MAP.get(args[0])) { case PROPERTY: Set<String> propertyNames = System.getProperties().stringPropertyNames(); return StringUtil.copyPartialMatches(args[1], propertyNames, new ArrayList<>(propertyNames.size())); case WORLD: if (sender instanceof Player) { Collection<String> worlds = getWorldNames(); return StringUtil.copyPartialMatches(args[1], worlds, new ArrayList<>(worlds.size())); } default: } default: } return Collections.emptyList(); }
Source:
public SiteRequestCondition combine(SiteRequestCondition other) { Set<String> combinedIncludedSites = new ImmutableSet.Builder<String>() .addAll(includedSites) .addAll(other.includedSites) .build(); Set<String> combinedExcludedSites = new ImmutableSet.Builder<String>() .addAll(excludedSites) .addAll(other.excludedSites) .build(); return new SiteRequestCondition(siteSet, siteResolver, combinedIncludedSites, combinedExcludedSites); }

Target:
public SiteRequestCondition combine(SiteRequestCondition other) { Set<String> combinedIncludedSites = new ImmutableSet.Builder<String>() .addAll(includedSites) .addAll(other.includedSites) .build(); Set<String> combinedExcludedSites = new ImmutableSet.Builder<String>() .addAll(excludedSites) .addAll(other.excludedSites) .build(); return create(siteSet, siteResolver, combinedIncludedSites, combinedExcludedSites); }
Source:
public void removeAll(final Iterable<? extends K> keys) { statusTransitioner.checkAvailable(); checkNonNull(keys); Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>> removalFunction = memoize(new Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>>() { @Override public Iterable<? extends Map.Entry<? extends K, ? extends V>> apply(Iterable<? extends Map.Entry<? extends K, ? extends V>> entries) { if (cacheWriter != null) { try { cacheWriter.deleteAll(new KeysIterable(entries)); } catch (Exception e) { throw newCacheWriterException(e); } } return new NullValuesIterable(keys); } }); try { store.bulkCompute(keys, removalFunction); } catch (CacheAccessException e) { try { removalFunction.apply(new NullValuesIterable(keys)); } finally { attemptRecovery(keys, e); } } catch (CacheWriterException e) { attemptRecovery(keys, e); throw e; } }

Target:
public void removeAll(final Iterable<? extends K> keys) { statusTransitioner.checkAvailable(); checkNonNull(keys); final Map<K, ? extends V> entriesToRemove = new HashMap<K, V>(); for (K key: keys) { entriesToRemove.put(key, null); } Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>> removalFunction = new Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>>() { @Override public Iterable<? extends Map.Entry<? extends K, ? extends V>> apply(Iterable<? extends Map.Entry<? extends K, ? extends V>> entries) { Iterable<Map.Entry<K, V>> ret = new NullValuesIterable(entries); for (Map.Entry<K, V> entry: ret) { entriesToRemove.remove(entry.getKey()); } if (cacheWriter != null) { try { cacheWriter.deleteAll(new KeysIterable(entries)); } catch (Exception e) { throw newCacheWriterException(e); } } return ret; } }; try { store.bulkCompute(keys, removalFunction); } catch (CacheAccessException e) { try { if (!entriesToRemove.isEmpty()) { removalFunction.apply(entriesToRemove.entrySet()); } } finally { removeKeysWithStrategy(keys, e); } } catch (CacheWriterException e) { removeKeysWithStrategy(keys, e); throw e; } }
Source:
public void itDoesntCountInstancesOverLimitInOnDemandLateTasks() { initOnDemandRequest(); SingularityRequest request = requestResource.getRequest(requestId, singularityUser).getRequest(); requestResource.postRequest(request.toBuilder().setInstances(Optional.of(2)).build(), singularityUser); initFirstDeploy(); configuration.setDeltaAfterWhichTasksAreLateMillis(TimeUnit.MILLISECONDS.toMillis(10)); requestResource.scheduleImmediately( singularityUser, request.getId(), new SingularityRunNowRequestBuilder() .setRunAt(System.currentTimeMillis()) .build() ); scheduler.drainPendingQueue(); SingularityState state = stateManager.getState(true, false); System.out.println(state); Assert.assertEquals(0, state.getActiveTasks()); Assert.assertEquals(1, state.getScheduledTasks()); launchTask(request, firstDeploy, 1, TaskState.TASK_RUNNING); state = stateManager.getState(true, false); System.out.println(state); Assert.assertEquals(1, state.getActiveTasks()); Assert.assertEquals(1, state.getScheduledTasks()); Assert.assertEquals(1, state.getOnDemandLateTasks()); Assert.assertEquals(0, state.getLateTasks()); launchTask(request, firstDeploy, 2, TaskState.TASK_RUNNING); state = stateManager.getState(true, false); System.out.println(state); Assert.assertEquals(2, state.getActiveTasks()); Assert.assertEquals(1, state.getScheduledTasks()); Assert.assertEquals(0, state.getOnDemandLateTasks()); Assert.assertEquals(0, state.getLateTasks()); configuration.setDeltaAfterWhichTasksAreLateMillis(TimeUnit.SECONDS.toMillis(30)); }

Target:
public void itDoesntCountInstancesOverLimitInOnDemandLateTasks() { initOnDemandRequest(); SingularityRequest request = requestResource.getRequest(requestId, singularityUser).getRequest(); requestResource.postRequest(request.toBuilder().setInstances(Optional.of(2)).build(), singularityUser); initFirstDeploy(); configuration.setDeltaAfterWhichTasksAreLateMillis(0); requestResource.scheduleImmediately( singularityUser, request.getId(), new SingularityRunNowRequestBuilder() .setRunAt(System.currentTimeMillis()) .build() ); scheduler.drainPendingQueue(); SingularityState state = stateManager.getState(true, false); System.out.println(state); Assert.assertEquals(0, state.getActiveTasks()); Assert.assertEquals(1, state.getScheduledTasks()); launchTask(request, firstDeploy, 1, TaskState.TASK_RUNNING); state = stateManager.getState(true, false); System.out.println(state); Assert.assertEquals(1, state.getActiveTasks()); Assert.assertEquals(1, state.getScheduledTasks()); Assert.assertEquals(1, state.getOnDemandLateTasks()); Assert.assertEquals(0, state.getLateTasks()); launchTask(request, firstDeploy, 2, TaskState.TASK_RUNNING); state = stateManager.getState(true, false); System.out.println(state); Assert.assertEquals(2, state.getActiveTasks()); Assert.assertEquals(1, state.getScheduledTasks()); Assert.assertEquals(0, state.getOnDemandLateTasks()); Assert.assertEquals(0, state.getLateTasks()); configuration.setDeltaAfterWhichTasksAreLateMillis(TimeUnit.SECONDS.toMillis(30)); }
Source:
public String getImagePath() { return NAME + "_icon32.png"; }

Target:
public String getImagePath() { return getImagePath(DefinitionImageType.PALETTE_ICON_32X32); }
Source:
public String getExtraHostsString() { if (getExtraHosts() == null) { return ""; } else { return Joiner.on("\n").join(getExtraHosts()); } }

Target:
public String getExtraHostsString() { if (CollectionUtils.isEmpty(getExtraHosts())) { return ""; } else { return Joiner.on("\n").join(getExtraHosts()); } }
Source:
private PromiseHttpAsyncClient getPromiseHttpAsyncClient(Request request) { log.info( "Creating new HttpAsyncClient" ); final CloseableHttpAsyncClient nonCachingHttpClient; try { final HttpAsyncClientBuilder clientBuilder = createClientBuilder(); nonCachingHttpClient = clientBuilder.build(); nonCachingHttpClient.start(); } catch ( IOReactorException e ) { throw new RuntimeException( "Reactor " + httpClientOptions.getThreadPrefix() + "not set up correctly" , e ); } return new SettableFuturePromiseHttpPromiseAsyncClient<C>(nonCachingHttpClient, threadLocalContextManager, callbackExecutor); }

Target:
private PromiseHttpAsyncClient getPromiseHttpAsyncClient(Request request) { log.trace( "Creating new HttpAsyncClient" ); final CloseableHttpAsyncClient nonCachingHttpClient; try { final HttpAsyncClientBuilder clientBuilder = createClientBuilder(); nonCachingHttpClient = clientBuilder.build(); nonCachingHttpClient.start(); } catch ( IOReactorException e ) { throw new RuntimeException( "Reactor " + httpClientOptions.getThreadPrefix() + "not set up correctly" , e ); } return new SettableFuturePromiseHttpPromiseAsyncClient<C>(nonCachingHttpClient, threadLocalContextManager, callbackExecutor); }
Source:
private void checkNotHoldsLock(Object lock) { checkState(!Thread.holdsLock(lock), "Cannot execute this method while holding a lock"); }

Target:
private static void checkNotHoldsLock(Object lock) { checkState(!Thread.holdsLock(lock), "Cannot execute this method while holding a lock"); }
Source:
public void set(Subscription s) { if (s == null) { throw new IllegalArgumentException("Subscription can not be null"); } State oldState; State newState; do { oldState = state.get(); if (oldState.isUnsubscribed) { s.unsubscribe(); return; } else { newState = oldState.set(s); } } while (!state.compareAndSet(oldState, newState)); oldState.subscription.unsubscribe(); }

Target:
public void set(Subscription s) { if (s == null) { throw new IllegalArgumentException("Subscription can not be null"); } State oldState; State newState; final AtomicReference<State> localState = this.state; do { oldState = localState.get(); if (oldState.isUnsubscribed) { s.unsubscribe(); return; } else { newState = oldState.set(s); } } while (!localState.compareAndSet(oldState, newState)); oldState.subscription.unsubscribe(); }
Source:
public void insertRow(final String tableName, final HBaseColumn[] columns, final Object[] values, final int indexOfIdColumn) { if (tableName == null || columns == null || values == null || indexOfIdColumn >= values.length || values[indexOfIdColumn] == null) { throw new IllegalArgumentException( "Can't insert a row without having (correct) tableName, columns, values or indexOfIdColumn"); } if (columns.length != values.length) { throw new IllegalArgumentException("The amount of columns don't match the amount of values"); } try (final Table table = _connection.getTable(TableName.valueOf(tableName))) { final Put put = new Put(getValueAsByteArray(values[indexOfIdColumn])); for (int i = 0; i < columns.length; i++) { if (i != indexOfIdColumn) { final byte[] columnFamily = Bytes.toBytes(columns[i].getColumnFamily()); byte[] qualifier = null; if (columns[i].getQualifier() != null) { qualifier = Bytes.toBytes(columns[i].getQualifier()); } else { qualifier = Bytes.toBytes(new String("")); } final byte[] value = getValueAsByteArray(values[i]); if (value == null) { logger.warn("The value of column '{}:{}' is null. This insertion is skipped", columns[i] .getColumnFamily() .toString(), columns[i].getQualifier().toString()); } else { put.addColumn(columnFamily, qualifier, value); } } } table.put(put); } catch (IOException e) { throw new MetaModelException(e); } }

Target:
public void insertRow(final String tableName, final HBaseColumn[] columns, final Object[] values, final int indexOfIdColumn) { if (tableName == null || columns == null || values == null || indexOfIdColumn >= values.length || values[indexOfIdColumn] == null) { throw new IllegalArgumentException( "Can't insert a row without having (correct) tableName, columns, values or indexOfIdColumn"); } if (columns.length != values.length) { throw new IllegalArgumentException("The amount of columns don't match the amount of values"); } try (final Table table = _connection.getTable(TableName.valueOf(tableName))) { final Put put = new Put(getValueAsByteArray(values[indexOfIdColumn])); for (int i = 0; i < columns.length; i++) { if (i != indexOfIdColumn) { final byte[] columnFamily = Bytes.toBytes(columns[i].getColumnFamily()); byte[] qualifier = null; if (columns[i].getQualifier() != null) { qualifier = Bytes.toBytes(columns[i].getQualifier()); } else { qualifier = Bytes.toBytes(new String("")); } final byte[] value = getValueAsByteArray(values[i]); if (value == null) { logger.info("The value of column '{}' is null. This insertion is skipped", columns[i] .getName()); } else { put.addColumn(columnFamily, qualifier, value); } } } table.put(put); } catch (IOException e) { throw new MetaModelException(e); } }
Source:
CompletableFuture<Void> asyncCompleteLocalTransaction(AdvancedCache<?, ?> cache, long timeout) { return blockingHandler.runBlockingOperation(() -> { try { rollbackLocalTransaction(cache, xid, timeout); } catch (HeuristicMixedException e) { hasCommits = true; hasRollbacks = true; } catch (Throwable t) { hasErrors = true; } }, this).toCompletableFuture(); }

Target:
CompletionStage<Void> asyncCompleteLocalTransaction(AdvancedCache<?, ?> cache, long timeout) { return blockingManager.runBlocking(() -> { try { rollbackLocalTransaction(cache, xid, timeout); } catch (HeuristicMixedException e) { hasCommits = true; hasRollbacks = true; } catch (Throwable t) { hasErrors = true; } }, this); }
Source:
public void receiveMessage(PubsubMessage message, AckReplyConsumer replyConsumer) { final ByteString data = message.getData(); final String messageId = message.getMessageId(); log.debug("Received ID:{} with content: {}", messageId, data.toStringUtf8()); final byte[] bytes = data.toByteArray(); try { consumer.consume(bytes); reporter.reportMessageSize(bytes.length); consumed.increment(); replyConsumer.ack(); } catch (ConsumerSchemaValidationException e) { reporter.reportConsumerSchemaError(); log.error("ID:{} - {}", messageId, e.getMessage(), e); replyConsumer.ack(); } catch (Exception e) { errors.incrementAndGet(); log.error("ID:{} - Failed to consume", messageId, e); reporter.reportMessageError(); } }

Target:
public void receiveMessage(PubsubMessage message, AckReplyConsumer replyConsumer) { final ByteString data = message.getData(); final String messageId = message.getMessageId(); log.debug("Received ID:{} with content: {}", messageId, data.toStringUtf8()); final byte[] bytes = data.toByteArray(); try { consumer.consume(bytes); reporter.reportMessageSize(bytes.length); consumed.increment(); replyConsumer.ack(); } catch (ConsumerSchemaValidationException e) { reporter.reportConsumerSchemaError(); log.error("ID:{} - {}", messageId, e.getMessage(), e); replyConsumer.ack(); } catch (Exception e) { errors.incrementAndGet(); log.error("ID:{} - Failed to consume", messageId, e); reporter.reportMessageError(); replyConsumer.nack(); } }
Source:
public void formatsTextToHtml() throws Exception { final String meta = new MarkdownTxtmark().html( "**hi**, _dude_!\r\n\n b**o\n \n \n o**m\n" ); MatcherAssert.assertThat( String.format("<x>%s</x>", meta), Matchers.describedAs( meta, XhtmlMatchers.hasXPaths( "/x/p/strong[.='hi']", "/x/p/em[.='dude']", "/x/pre/code[.=' b**o\n\n\no**m\n']" ) ) ); }

Target:
public void formatsTextToHtml() throws Exception { final String meta = new MarkdownTxtmark().html( MarkdownTxtmarkTest.join( "**hi**, _dude_!", "", " b**o", " ", " o**m", "" ) ); MatcherAssert.assertThat( String.format("<x>%s</x>", meta), Matchers.describedAs( meta, XhtmlMatchers.hasXPaths( "/x/p/strong[.='hi']", "/x/p/em[.='dude']", MarkdownTxtmarkTest.join( "/x/pre/code[.=' b**o", "", "", "o**m']" ) ) ) ); }
Source:
public void verifyMonetizationModuleAdsenseShown() { Assertion.assertTrue(checkIfElementOnPage(adsenseContainer)); Assertion.assertTrue(checkIfElementOnPage(adsenseIns)); PageObjectLogging.log("verifyMonetizationModuleAdsenseShown", "Monetization module is shown (adsense)", true); waitForElementByElement(adsenseContainer); PageObjectLogging.log("verifyMonetizationModuleAdsenseShown", "Monetization module is visible (adsense)", true); }

Target:
public void verifyMonetizationModuleAdsenseShown() { Assertion.assertTrue(checkIfElementOnPage(adsenseContainer)); Assertion.assertTrue(checkIfElementOnPage(adsenseIns)); waitForElementByElement(adsenseContainer); PageObjectLogging.log("verifyMonetizationModuleAdsenseShown", "Monetization module is visible (adsense)", true); }
Source:
public void acknowledgeTaskResults(TaskId taskId, OutputBufferId bufferId, long sequenceId) { requireNonNull(taskId, "taskId is null"); requireNonNull(bufferId, "bufferId is null"); Preconditions.checkArgument(sequenceId >= 0, "sequenceId is negative"); tasks.getUnchecked(taskId).acknowledgeTaskResults(bufferId, sequenceId); }

Target:
public void acknowledgeTaskResults(TaskId taskId, OutputBufferId bufferId, long sequenceId) { requireNonNull(taskId, "taskId is null"); requireNonNull(bufferId, "bufferId is null"); checkArgument(sequenceId >= 0, "sequenceId is negative"); tasks.getUnchecked(taskId).acknowledgeTaskResults(bufferId, sequenceId); }
Source:
public void onEnvironmentShutdown() { if ( main != null ) { try { main.destroy(); } catch ( Exception e ) { e.printStackTrace(); } } }

Target:
public void onEnvironmentShutdown() { if ( main != null ) { try { main.destroy(); } catch ( Exception e ) { logger.error( "Error during Karaf shutdown", e ); } } }