auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public OpenUrlAction(DialogService dialogService, StateManager stateManager) { this.dialogService = dialogService; this.stateManager = stateManager; BooleanBinding fieldIsSet = ActionHelper.isFieldSetForSelectedEntry(StandardField.URL, stateManager) .or(ActionHelper.isFieldSetForSelectedEntry(StandardField.DOI, stateManager) .or(ActionHelper.isFieldSetForSelectedEntry(StandardField.URI, stateManager) .or(ActionHelper.isFieldSetForSelectedEntry(StandardField.EPRINT, stateManager)))); this.executable.bind(ActionHelper.needsEntriesSelected(1, stateManager).and(fieldIsSet)); }

Target:
public OpenUrlAction(DialogService dialogService, StateManager stateManager) { this.dialogService = dialogService; this.stateManager = stateManager; BooleanExpression fieldIsSet = ActionHelper.isAnyFieldSetForSelectedEntry( List.of(StandardField.URL, StandardField.DOI, StandardField.URI, StandardField.EPRINT), stateManager); this.executable.bind(ActionHelper.needsEntriesSelected(1, stateManager).and(fieldIsSet)); }
Source:
public void run() { String resp; while(!Thread.interrupted() && !client.isClosed()) { try { if(inStream.ready() && (resp = bufIn.readLine()) != null) { responseMessageHandler.handleResponse(resp + "\n", comm); } } catch (SocketException e) { e.printStackTrace(); System.exit(-1); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } } }

Target:
public void run() { String resp; while(!Thread.interrupted() && !client.isClosed()) { try { if(inStream.ready() && (resp = bufIn.readLine()) != null) { responseMessageHandler.handleResponse(resp + "\n", comm); } } catch (SocketException e) { e.printStackTrace(); return; } catch (IOException e) { e.printStackTrace(); return; } } }
Source:
public ExportConfiguration getConfiguration(FormStatus form) { return Optional.ofNullable(customConfigurations.get(form.getFormDefinition().getFormId())) .orElse(ExportConfiguration.empty()) .fallingBackTo(defaultConfiguration, form); }

Target:
public ExportConfiguration getConfiguration(FormStatus form) { return Optional.ofNullable(customConfigurations.get(form.getFormDefinition().getFormId())) .orElse(ExportConfiguration.empty(form)) .fallingBackTo(defaultConfiguration); }
Source:
LineTcpMeasurementEvent createRebalanceEvent(int fromThreadId, int toThreadId, String tableName) { clear(); threadId = REBALANCE_EVENT_ID; rebalanceFromThreadId = fromThreadId; rebalanceToThreadId = toThreadId; rebalanceTableName = tableName; return this; }

Target:
void createRebalanceEvent(int fromThreadId, int toThreadId, String tableName) { clear(); threadId = REBALANCE_EVENT_ID; rebalanceFromThreadId = fromThreadId; rebalanceToThreadId = toThreadId; rebalanceTableName = tableName; }
Source:
public void execute() { String courseId = getRequestParamValue(ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(ParamsNames.COURSE_ID, courseId); String feedbackSessionName = getRequestParamValue(ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertPostParamNotNull(ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); String email = getRequestParamValue(ParamsNames.RESPONDENT_EMAIL); Assumption.assertPostParamNotNull(ParamsNames.RESPONDENT_EMAIL, email); String isInstructorString = getRequestParamValue(ParamsNames.RESPONDENT_IS_INSTRUCTOR); Assumption.assertPostParamNotNull(ParamsNames.RESPONDENT_IS_INSTRUCTOR, isInstructorString); String isToBeRemovedString = getRequestParamValue(ParamsNames.RESPONDENT_IS_TO_BE_REMOVED); Assumption.assertPostParamNotNull(ParamsNames.RESPONDENT_IS_TO_BE_REMOVED, isToBeRemovedString); boolean isInstructor = Boolean.parseBoolean(isInstructorString); boolean isToBeRemoved = Boolean.parseBoolean(isToBeRemovedString); try { if (isInstructor) { if (isToBeRemoved) { logic.deleteInstructorRespondent(email, feedbackSessionName, courseId); } else { logic.addInstructorRespondent(email, feedbackSessionName, courseId); } } else { if (isToBeRemoved) { logic.deleteStudentRespondent(email, feedbackSessionName, courseId); } else { logic.addStudentRespondent(email, feedbackSessionName, courseId); } } } catch (InvalidParametersException | EntityDoesNotExistException e) { log.severe("Failed to " + (isToBeRemoved ? "remove" : "append") + " " + (isInstructor ? "instructor" : "student") + " respondent"); } }

Target:
public void execute() { String courseId = getRequestParamValue(ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(ParamsNames.COURSE_ID, courseId); String feedbackSessionName = getRequestParamValue(ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertPostParamNotNull(ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); String email = getRequestParamValue(ParamsNames.RESPONDENT_EMAIL); Assumption.assertPostParamNotNull(ParamsNames.RESPONDENT_EMAIL, email); String isInstructorString = getRequestParamValue(ParamsNames.RESPONDENT_IS_INSTRUCTOR); Assumption.assertPostParamNotNull(ParamsNames.RESPONDENT_IS_INSTRUCTOR, isInstructorString); String isToBeRemovedString = getRequestParamValue(ParamsNames.RESPONDENT_IS_TO_BE_REMOVED); Assumption.assertPostParamNotNull(ParamsNames.RESPONDENT_IS_TO_BE_REMOVED, isToBeRemovedString); boolean isInstructor = Boolean.parseBoolean(isInstructorString); boolean isToBeRemoved = Boolean.parseBoolean(isToBeRemovedString); try { if (isInstructor) { if (isToBeRemoved) { logic.deleteInstructorRespondent(email, feedbackSessionName, courseId); } else { logic.addInstructorRespondent(email, feedbackSessionName, courseId); } } else { if (isToBeRemoved) { logic.deleteStudentRespondent(email, feedbackSessionName, courseId); } else { logic.addStudentRespondent(email, feedbackSessionName, courseId); } } } catch (InvalidParametersException | EntityDoesNotExistException e) { log.severe("Failed to " + (isToBeRemoved ? "remove" : "append") + " " + (isInstructor ? "instructor" : "student") + " respondent: " + TeammatesException.toStringWithStackTrace(e)); } }
Source:
public LabelTypes getLabelTypes() { if (labels == null) { List<LabelType> all = getProjectControl().getLabelTypes().getLabelTypes(); final Set<String> labelNames = Sets.<String> newHashSetWithExpectedSize(all.size()); for (Map.Entry<String, List<PermissionRule>> p : relevant .getDeclaredPermissions()) { if (Permission.isLabel(p.getKey())) { labelNames.add(Permission.extractLabel(p.getKey())); } } List<LabelType> r = Lists.newArrayListWithCapacity(all.size()); for (LabelType l : all) { if (labelNames.contains(l.getName())) { r.add(l); } } labels = new LabelTypes(r); } return labels; }

Target:
public LabelTypes getLabelTypes() { if (labels == null) { List<LabelType> all = getProjectControl().getLabelTypes().getLabelTypes(); Set<String> labelNames = Sets.<String> newHashSetWithExpectedSize(all.size()); for (Map.Entry<String, List<PermissionRule>> p : relevant .getDeclaredPermissions()) { if (Permission.isLabel(p.getKey())) { labelNames.add(Permission.extractLabel(p.getKey())); } } List<LabelType> r = Lists.newArrayListWithCapacity(all.size()); for (LabelType l : all) { if (labelNames.contains(l.getName())) { r.add(l); } } labels = new LabelTypes(r); } return labels; }
Source:
public GetProvisioningStateResponseHandler(DateCodecFactory dateCodec) { super(dateCodec); }

Target:
GetProvisioningStateResponseHandler(DateCodecFactory dateCodec) { super(dateCodec); }
Source:
public ConsoleAnnotator<Object> annotate(Object context, MarkupText text) { Run<?, ?> build; if (context instanceof Run) { build = (Run<?, ?>) context; } else if (context instanceof FlowNode) { FlowExecutionOwner owner = ((FlowNode) context).getExecution().getOwner(); if (owner == null) { return null; } Queue.Executable executable; try { executable = owner.getExecutable(); } catch (IOException x) { LOGGER.log(Level.FINE, null, x); return null; } if (executable instanceof Run) { build = (Run) executable; } else { return null; } } else { return null; } long buildStartTime = build.getStartTimeInMillis(); String html = text.toString(true); int start; if (html.startsWith("<span class=\"pipeline-new-node\" ")) { start = html.indexOf('>') + 1; } else { start = 0; } if (html.startsWith("[", start)) { int end = html.indexOf(']', start); if (end != -1) { Date date = GlobalDecorator.UTC_MILLIS.get().parse(html, new ParsePosition(start + 1)); if (date != null) { long millisSinceEpoch = date.getTime(); Timestamp timestamp = new Timestamp(millisSinceEpoch - buildStartTime, millisSinceEpoch); TimestampFormat format = TimestampFormatProvider.get(); format.markup(text, timestamp); text.addMarkup(0, 26, "<span style=\"display: none\">", "</span>"); } } } return this; }

Target:
public ConsoleAnnotator<Object> annotate(Object context, MarkupText text) { Run<?, ?> build; if (context instanceof Run) { build = (Run<?, ?>) context; } else if (context instanceof FlowNode) { FlowExecutionOwner owner = ((FlowNode) context).getExecution().getOwner(); if (owner == null) { return null; } Queue.Executable executable; try { executable = owner.getExecutable(); } catch (IOException x) { LOGGER.log(Level.FINE, null, x); return null; } if (executable instanceof Run) { build = (Run) executable; } else { return null; } } else { return null; } long buildStartTime = build.getStartTimeInMillis(); String html = text.toString(true); int start; if (html.startsWith("<span class=\"pipeline-new-node\" ")) { start = html.indexOf('>') + 1; } else { start = 0; } if (html.startsWith("[", start)) { int end = html.indexOf(']', start); if (end != -1) { try { long millisSinceEpoch = ZonedDateTime.parse(html.substring(start + 1, end), GlobalDecorator.UTC_MILLIS).toInstant().toEpochMilli(); Timestamp timestamp = new Timestamp(millisSinceEpoch - buildStartTime, millisSinceEpoch); TimestampFormat format = TimestampFormatProvider.get(); format.markup(text, timestamp); text.addMarkup(0, 26, "<span style=\"display: none\">", "</span>"); } catch (DateTimeParseException x) { } } } return this; }
Source:
public Map createVolume(String sdUUID, String spUUID, String imgUUID, String size, Integer volFormat, Integer preallocate, Integer diskType, String volUUID, String desc, String srcImgUUID, String srcVolUUID) { try { DataCenter dataCenter = getDataCenterById(spUUID); StorageDomain storageDomain = dataCenter.getStorageDomainMap().get(sdUUID); final Volume volume = new Volume(); volume.setId(volUUID); volume.setSize(size); volume.setVolFormat(volFormat); volume.setPreallocate(preallocate); volume.setDiskType(diskType); volume.setImgUUID(imgUUID); volume.setDesc(desc); volume.setSrcImgUUID(srcImgUUID); volume.setSrcVolUUID(srcVolUUID); log.info("Adding volume: for sp: {}, sd: {}", new Object[] { volUUID, spUUID, sdUUID }); storageDomain.getVolumes().put(volUUID, volume); updateDataCenter(dataCenter); final Map resultMap = getOKStatus(); final Task task = new Task(getUuid()); resultMap.put("uuid", task.getId()); syncTask((Host) VdsmManager.getInstance().getSpmHost(spUUID), task); TaskProcessor.getInstance().addTask(new TaskRequest(TaskType.FINISH_CREATE_VOLUME, 3000l, task)); return resultMap; } catch (Exception e) { throw error(e); } }

Target:
public Map createVolume(String sdUUID, String spUUID, String imgUUID, String size, Integer volFormat, Integer preallocate, Integer diskType, String volUUID, String desc, String srcImgUUID, String srcVolUUID) { try { DataCenter dataCenter = getDataCenterById(spUUID); StorageDomain storageDomain = dataCenter.getStorageDomainMap().get(sdUUID); final Volume volume = new Volume(); volume.setId(volUUID); volume.setSize(size); volume.setVolFormat(volFormat); volume.setPreallocate(preallocate); volume.setDiskType(diskType); volume.setImgUUID(imgUUID); volume.setDesc(desc); volume.setSrcImgUUID(srcImgUUID); volume.setSrcVolUUID(srcVolUUID); log.info("Adding volume: for sp: {}, sd: {}", new Object[] { volUUID, spUUID, sdUUID }); storageDomain.getVolumes().put(volUUID, volume); updateDataCenter(dataCenter); final Map resultMap = getOKStatus(); final Task task = new Task(getUuid()); resultMap.put("uuid", task.getId()); syncTask(VdsmManager.getInstance().getSpmHost(spUUID), task); TaskProcessor.getInstance().addTask(new TaskRequest(TaskType.FINISH_CREATE_VOLUME, 3000l, task)); return resultMap; } catch (Exception e) { throw error(e); } }
Source:
public Serializable execute(TaskResult... results) throws IOException, ExecutionException, InterruptedException { List<String> filesRelativePathName = new ArrayList<>(); File file = new File(inputPath); containerURL = AzureStorageConnectorUtils.createContainerURL(accountName, accountKey, containerName); if (file.exists()) { if (file.isDirectory()) { if (optionalBlobName.isPresent()) { filesRelativePathName = recursiveFolderUpload(inputPath, optionalBlobName.get(), true); } else { filesRelativePathName = recursiveFolderUpload(inputPath, "", false); } } else { if (optionalBlobName.isPresent()) { uploadFile(file, optionalBlobName.get()); } else { uploadFile(file, file.getName()); } filesRelativePathName.add(file.getPath()); } } else { throw new FileNotFoundException("The input file cannot be found at " + inputPath); } return (Serializable) filesRelativePathName; }

Target:
public Serializable execute(TaskResult... results) throws IOException, ExecutionException, InterruptedException { List<String> filesRelativePathName = new ArrayList<>(); File file = new File(inputPath); containerURL = AzureStorageConnectorUtils.createContainerURL(storageAccount, accountKey, containerName); if (file.exists()) { if (file.isDirectory()) { if (optionalBlobName.isPresent()) { filesRelativePathName = recursiveFolderUpload(inputPath, optionalBlobName.get(), true); } else { filesRelativePathName = recursiveFolderUpload(inputPath, "", false); } } else { uploadFile(file, optionalBlobName.orElse(file.getName())); filesRelativePathName.add(file.getPath()); } } else { throw new FileNotFoundException("The input file cannot be found at " + inputPath); } return (Serializable) filesRelativePathName; }
Source:
public void refreshDataCenterInfoIfRequired() { String existingAddress = instanceInfo.getHostName(); String newAddress; if (config instanceof RefreshableInstanceConfig) { newAddress = ((RefreshableInstanceConfig) config).resolveDefaultAddress(true); } else { newAddress = config.getHostName(true); } String newIp = config.getIpAddress(); if (newAddress != null && !newAddress.equals(existingAddress)) { logger.warn("The address changed from : => {}", existingAddress, newAddress); InstanceInfo.Builder builder = new InstanceInfo.Builder(instanceInfo); builder.setHostName(newAddress).setIPAddr(newIp).setDataCenterInfo(config.getDataCenterInfo()); instanceInfo.setIsDirty(); } String existingSpotInstanceAction = instanceInfo.getMetadata().get(AmazonInfo.MetaDataKey.spotInstanceAction.name); DataCenterInfo dataCenterInfo = config.getDataCenterInfo(); if (dataCenterInfo instanceof AmazonInfo) { AmazonInfo amazonInfo = (AmazonInfo) dataCenterInfo; String newSpotInstanceAction = amazonInfo.getMetadata().get(AmazonInfo.MetaDataKey.spotInstanceAction.name); if (newSpotInstanceAction != null && !newSpotInstanceAction.equals(existingSpotInstanceAction)) { logger.warn(String.format("The spot instance termination action changed from: %s => %s", existingSpotInstanceAction, newSpotInstanceAction)); InstanceInfo.Builder builder = new InstanceInfo.Builder(instanceInfo); builder.setDataCenterInfo(config.getDataCenterInfo()); instanceInfo.setIsDirty(); } } }

Target:
public void refreshDataCenterInfoIfRequired() { String existingAddress = instanceInfo.getHostName(); String existingSpotInstanceAction = null; if (instanceInfo.getDataCenterInfo() instanceof AmazonInfo) { existingSpotInstanceAction = ((AmazonInfo) instanceInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.spotInstanceAction); } String newAddress; if (config instanceof RefreshableInstanceConfig) { newAddress = ((RefreshableInstanceConfig) config).resolveDefaultAddress(true); } else { newAddress = config.getHostName(true); } String newIp = config.getIpAddress(); if (newAddress != null && !newAddress.equals(existingAddress)) { logger.warn("The address changed from : => {}", existingAddress, newAddress); updateInstanceInfo(newAddress, newIp); } if (config.getDataCenterInfo() instanceof AmazonInfo) { String newSpotInstanceAction = ((AmazonInfo) config.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.spotInstanceAction); if (newSpotInstanceAction != null && !newSpotInstanceAction.equals(existingSpotInstanceAction)) { logger.info(String.format("The spot instance termination action changed from: %s => %s", existingSpotInstanceAction, newSpotInstanceAction)); updateInstanceInfo(null , null ); } } }
Source:
public void init() throws IOException { resultPath = tempFolder().newFolder().toURI().toString(); clear(); env().setParallelism(3); env().enableCheckpointing(100); rows = new ArrayList<>(); for (int i = 0; i < 100; i++) { rows.add(Row.of(i, String.valueOf(i % 10), String.valueOf(i))); } DataStream<Row> stream = new DataStream<>(env().getJavaEnv().addSource( new ParallelFiniteTestSource<>(rows), new RowTypeInfo( new TypeInformation[] {Types.INT, Types.STRING, Types.STRING}, new String[] {"a", "b", "c"}))); tEnv().createTemporaryView("my_table", stream); }

Target:
public void init() throws IOException { resultPath = tempFolder().newFolder().toURI().toString(); env().setParallelism(3); env().enableCheckpointing(100); List<Row> rows = new ArrayList<>(); for (int i = 0; i < 100; i++) { rows.add(Row.of(i, String.valueOf(i % 10), String.valueOf(i))); } this.expectedRows = new ArrayList<>(); this.expectedRows.addAll(rows); this.expectedRows.addAll(rows); this.expectedRows.sort(Comparator.comparingInt(o -> (Integer) o.getField(0))); DataStream<Row> stream = new DataStream<>(env().getJavaEnv().addSource( new ParallelFiniteTestSource<>(rows), new RowTypeInfo( new TypeInformation[] {Types.INT, Types.STRING, Types.STRING}, new String[] {"a", "b", "c"}))); tEnv().createTemporaryView("my_table", stream); }
Source:
public void testGetProjcetMembers3() throws Exception { CreateAccount CA = new CreateAccount(1); CA.exe(); AddUserToRole addUserToRole = new AddUserToRole(mCP, CA); addUserToRole.exe_PO(); AccountHelper ah = new AccountHelper(mConfig.getUserSession()); ah.removeAssignRole(CA.getAccountList().get(0).getId(), mCP.getAllProjects().get(0).getId(), ScrumEnum.SCRUMROLE_PRODUCTOWNER); addUserToRole.exe_SM(); String projectName = this.mIProject.getName(); request.setHeader("Referer", "?PID=" + projectName); addRequestParameter("_dc", String.valueOf(System.currentTimeMillis())); request.getSession().setAttribute("UserSession", mConfig.getUserSession()); actionPerform(); verifyNoActionErrors(); verifyNoActionMessages(); String actualResponseText = response.getWriterBuffer().toString(); assertEquals(getExpectedProjectMember(CA.getAccountList().get(0)), actualResponseText); }

Target:
public void testGetProjcetMembers3() throws Exception { CreateAccount CA = new CreateAccount(1); CA.exe(); AddUserToRole AUTR = new AddUserToRole(mCP, CA); AUTR.exe_PO(); AccountHelper accountHelper = new AccountHelper(mConfig.getUserSession()); accountHelper.removeAssignRole(CA.getAccountList().get(0).getId(), mCP.getAllProjects().get(0).getId(), ScrumEnum.SCRUMROLE_PRODUCTOWNER); AUTR.exe_SM(); String projectName = this.mIProject.getName(); request.setHeader("Referer", "?PID=" + projectName); addRequestParameter("_dc", String.valueOf(System.currentTimeMillis())); request.getSession().setAttribute("UserSession", mConfig.getUserSession()); actionPerform(); verifyNoActionErrors(); verifyNoActionMessages(); String actualResponseText = response.getWriterBuffer().toString(); assertEquals(getExpectedProjectMember(CA.getAccountList().get(0)), actualResponseText); }
Source:
public void setUp() { try { final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null); final File test = new File(FileLocator.toFileURL(location).toURI()); fTrace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null); TmfSignalManager.deregister(fTrace); fTrace.indexTrace(true); } catch (final TmfTraceException e) { e.printStackTrace(); } catch (final URISyntaxException e) { e.printStackTrace(); } catch (final IOException e) { e.printStackTrace(); } }

Target:
public void setUp() { try { final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null); final File test = new File(FileLocator.toFileURL(location).toURI()); fTrace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null); TmfSignalManager.deregister(fTrace); fTrace.indexTrace(true); } catch (final TmfTraceException e) { fail("Exception setting up the trace: " + e.getMessage()); } catch (final URISyntaxException e) { fail("URI syntax exception: " + e.getMessage()); } catch (final IOException e) { fail("I/O exception while setting up the test: " + e.getMessage()); } }
Source:
private void onTopologyChanged() { if (topologyListener == null) { TracingService.logErrorInSpan(getContext().getCurrentSpan(), "IllegalStateException: topologyListener should not be null when calling onTopologyChanged method"); throw new IllegalStateException( "topologyListener should not be null when calling onTopologyChanged method"); } reactOnTopologyChange(); }

Target:
private void onTopologyChanged() { if (topologyListener == null) { throw new IllegalStateException( "topologyListener should not be null when calling onTopologyChanged method"); } reactOnTopologyChange(); }
Source:
ExportArguments(XWikiContext context) { XWikiRequest request = context.getRequest(); this.description = request.get("description"); this.name = request.get("name"); if (StringUtils.isBlank(name)) { this.name = context.getDoc().getFullName(); } String[] pagesParam = request.getParameterValues("pages"); String checkedPagesParam = request.get("checked-pages"); if (!StringUtils.isEmpty(checkedPagesParam)) { this.checkedPages = checkedPagesParam.split("&"); } else { this.checkedPages = pagesParam; } String otherPagesRequestValue = request.get("other-pages"); this.otherPages = Boolean.valueOf(otherPagesRequestValue); this.uncheckedPages = null; if (!StringUtils.isEmpty(request.get("unchecked-pages"))) { this.uncheckedPages = request.get("unchecked-pages").split(PAGE_SEPARATOR); } }

Target:
ExportArguments(XWikiContext context) throws XWikiException { XWikiRequest request = context.getRequest(); this.description = request.get("description"); this.name = request.get("name"); if (StringUtils.isBlank(name)) { this.name = context.getDoc().getFullName(); } String[] pages = request.getParameterValues("pages"); String[] excludes = request.getParameterValues("excludes"); this.exportPages = new LinkedHashMap<>(); if (pages != null) { for (int i = 0; i < pages.length; i++) { List<String> excludedPages; if (excludes != null && i < excludes.length) { excludedPages = this.decodePages(excludes[i], context); } else { excludedPages = Collections.emptyList(); } this.exportPages.put(pages[i], excludedPages); } } }
Source:
public Collection<Feature> getEnabledFeatures() { if (enabledFeatures == null && parent != null) return parent.getEnabledFeatures(); return enabledFeatures; }

Target:
public Collection<Feature> getEnabledFeatures() { if(initialized) { return enabledFeatures; } Set<Feature> set = new HashSet<Feature>(); if (parent != null) set.addAll(parent.getEnabledFeatures()); set.addAll(enabledFeatures); return set; }
Source:
boolean isAePrecaptureRequired(TakePictureState state) { if (isCamera2LegacyDevice()) { return false; } switch (getFlashMode()) { case FLASH_MODE_ON: return true; case FLASH_MODE_AUTO: return state.mPreCaptureState.getAeState() == AeState.FLASH_REQUIRED; case FLASH_MODE_OFF: return false; } throw new AssertionError(getFlashMode()); }

Target:
boolean isAePrecaptureRequired(TakePictureState state) { switch (getFlashMode()) { case FLASH_MODE_ON: return true; case FLASH_MODE_AUTO: return state.mPreCaptureState.getAeState() == AeState.FLASH_REQUIRED; case FLASH_MODE_OFF: return false; } throw new AssertionError(getFlashMode()); }
Source:
private List<Interval> parseInterval(List<String> intervalExpressions) { Preconditions.checkState(intervalExpressions != null && intervalExpressions.size() == 1, "Cannot parse range expressions from query: %s", intervalExpressions); long startTime = MIN_START_TIME; long endTime = MAX_END_TIME; String intervalExpression = intervalExpressions.get(0); String[] s = intervalExpression.substring(1, intervalExpression.length() - 1).split("\\s+"); if (!s[0].equals("*")) { startTime = _timeFormatSpec.fromFormatToMillis(s[0]); if (intervalExpression.startsWith("(")) { startTime++; } } if (!s[1].equals("*")) { endTime = _timeFormatSpec.fromFormatToMillis(s[1]); if (intervalExpression.endsWith(")")) { endTime--; } } if (startTime > endTime) { return Collections.emptyList(); } return Collections.singletonList(new Interval(startTime, endTime)); }

Target:
private List<Interval> parseInterval(List<String> intervalExpressions) { Preconditions.checkState(intervalExpressions != null && intervalExpressions.size() == 1, "Cannot parse range expressions from query: %s", intervalExpressions); long startTime = MIN_START_TIME; long endTime = MAX_END_TIME; String intervalExpression = intervalExpressions.get(0); boolean startInclusive = intervalExpression.charAt(0) == START_INCLUSIVE; boolean endInclusive = intervalExpression.charAt(intervalExpression.length() - 1) == END_INCLUSIVE; String interval = intervalExpression.substring(1, intervalExpression.length() - 1); String[] split = StringUtils.split(interval, DELIMITER); if (split.length != 2) { split = StringUtils.split(interval, LEGACY_DELIMITER); } if (!split[0].equals(UNBOUNDED)) { startTime = startInclusive? _timeFormatSpec.fromFormatToMillis(split[0]) + 1 : _timeFormatSpec.fromFormatToMillis(split[0]); } if (!split[1].equals(UNBOUNDED)) { endTime = endInclusive ? _timeFormatSpec.fromFormatToMillis(split[1]) - 1 : _timeFormatSpec.fromFormatToMillis(split[1]); } if (startTime > endTime) { return Collections.emptyList(); } return Collections.singletonList(new Interval(startTime, endTime)); }
Source:
public static Optional<CompressionCodec> getCompressionCodec(TextInputFormat inputFormat, Path file) throws NoSuchFieldException, IllegalAccessException { if (inputFormat == null || file == null) { return Optional.empty(); } Field field = inputFormat.getClass().getDeclaredField("compressionCodecs"); if (field == null) { return Optional.empty(); } field.setAccessible(true); CompressionCodecFactory compressionCodecs = (CompressionCodecFactory) field.get(inputFormat); return Optional.ofNullable(compressionCodecs.getCodec(file)); }

Target:
public static Optional<CompressionCodec> getCompressionCodec(TextInputFormat inputFormat, Path file) { CompressionCodecFactory compressionCodecFactory; try { compressionCodecFactory = (CompressionCodecFactory) COMPRESSION_CODECS_FIELD.get(inputFormat); } catch (IllegalAccessException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Failed to find compressionCodec for inputFormat: " + inputFormat.getClass().getName(), e); } if (compressionCodecFactory == null) { return Optional.empty(); } return Optional.ofNullable(compressionCodecFactory.getCodec(file)); }
Source:
public static PrePushHook prePush(Repository repo, PrintStream outputStream) { if (LfsFactory.getInstance().isAvailable()) { PrePushHook hook = LfsFactory.getInstance().getPrePushHook(repo, outputStream); if (hook != null) { if (hook.isNativeHookPresent()) { (outputStream == null ? System.out : outputStream).println( MessageFormat .format(JGitText.get().lfsHookConflict, repo)); } return hook; } } return new PrePushHook(repo, outputStream); }

Target:
public static PrePushHook prePush(Repository repo, PrintStream outputStream) { if (LfsFactory.getInstance().isAvailable()) { PrePushHook hook = LfsFactory.getInstance().getPrePushHook(repo, outputStream); if (hook != null) { if (hook.isNativeHookPresent()) { PrintStream ps = outputStream; if (ps == null) { ps = System.out; } ps.println(MessageFormat .format(JGitText.get().lfsHookConflict, repo)); } return hook; } } return new PrePushHook(repo, outputStream); }
Source:
private Users mapUsers(List<LdapUser> entities) { Users collection = new Users(); for (LdapUser entity : entities) { User user = map(entity); user = addLinks(user, true); user = modifyDomain(user); collection.getUsers().add(user); } return collection; }

Target:
private Users mapUsers(List<LdapUser> entities) { Users collection = new Users(); for (LdapUser entity : entities) { User user = map(entity); user = populate(user, entity); user = addLinks(user, true); collection.getUsers().add(user); } return collection; }
Source:
private Map<String, Long> getNavMarker(boolean current) { Collection<Source> sources = client.getAllSources(); HashMap<String, Long> newMarker = Maps. newHashMap(); for (Source source : sources) { String id = source.getIdentity(); Long sourceExtractIteration = source.getSourceExtractIteration(); if (sourceExtractIteration == null) { sourceExtractIteration = 0L; } newMarker.put(id, sourceExtractIteration); } return newMarker; }

Target:
private Map<String, Long> getNavMarker(boolean current) { Collection<Source> sources = client.getAllSources(); HashMap<String, Long> newMarker = Maps. newHashMap(); for (Source source : sources) { String id = source.getIdentity(); Long sourceExtractIteration = !current ? 0L : source.getSourceExtractIteration() != null ? source.getSourceExtractIteration() : 0L; newMarker.put(id, sourceExtractIteration); } return newMarker; }
Source:
public Map<String, String> asMap(Locale locale) { Assert.notNull(locale, "locale is null"); if (codeListTable.containsRow(locale)) { if (logger.isDebugEnabled()) { logger.debug("Found codelist for specified locale '{}'.", locale); } return codeListTable.row(locale); } Locale langOnlyLocale = new Locale(locale.getLanguage()); if (codeListTable.containsRow(langOnlyLocale)) { if (logger.isDebugEnabled()) { logger.debug( "Found codelist for specified locale '{}' (language only).", locale); } return codeListTable.row(langOnlyLocale); } if (locale.equals(fallbackTo)) { throw new IllegalStateException("No codelist found for specified locale and fail to fallback"); } if (logger.isDebugEnabled()) { logger.debug( "There is no codelist for specified locale '{}'. Use '{}' as fallback.", locale, fallbackTo); } return asMap(fallbackTo); }

Target:
public Map<String, String> asMap(Locale locale) { Assert.notNull(locale, "locale is null"); Locale resolvedLocale = resolveLocale(locale); return codeListTable.row(resolvedLocale); }
Source:
public Builder(@NotNull Request req) { if(req == null) { throw new NullPointerException("`req` cannot be null"); } this.id = req.getId(); this.transportHeaders.put( TransportHeaders.ARG_SCHEME_KEY, req.getTransportHeaders().get(TransportHeaders.ARG_SCHEME_KEY) ); }

Target:
public Builder(@NotNull Request req) { this.id = req.getId(); this.transportHeaders.put( TransportHeaders.ARG_SCHEME_KEY, req.getTransportHeaders().get(TransportHeaders.ARG_SCHEME_KEY) ); }
Source:
void complete(BitmapHunter hunter) { Action action = hunter.getAction(); List<Action> joined = hunter.getActions(); boolean hasMultiple = joined != null && !joined.isEmpty(); boolean shouldDeliver = action != null || hasMultiple; if (!shouldDeliver) { return; } Uri uri = hunter.getData().uri; Exception exception = hunter.getException(); Bitmap result = hunter.getResult(); LoadedFrom from = hunter.getLoadedFrom(); if (action != null) { deliverAction(result, from, action); } if (hasMultiple) { for (int i = 0, n = joined.size(); i < n; i++) { Action join = joined.get(i); deliverAction(result, from, join); } } if (listener != null && exception != null) { listener.onImageLoadFailed(this, uri, exception); } }

Target:
void complete(BitmapHunter hunter) { Action single = hunter.getAction(); List<Action> joined = hunter.getActions(); boolean hasMultiple = joined != null && !joined.isEmpty(); boolean shouldDeliver = single != null || hasMultiple; if (!shouldDeliver) { return; } Uri uri = hunter.getData().uri; Exception exception = hunter.getException(); Bitmap result = hunter.getResult(); LoadedFrom from = hunter.getLoadedFrom(); if (single != null) { deliverAction(result, from, single); } if (hasMultiple) { for (int i = 0, n = joined.size(); i < n; i++) { Action join = joined.get(i); deliverAction(result, from, join); } } if (listener != null && exception != null) { listener.onImageLoadFailed(this, uri, exception); } }
Source:
public void commit(Map<DatastreamTask, String> checkpoints) { LOG.info("Commit called with checkpoints " + checkpoints.toString()); Validate.notNull(checkpoints, "Checkpoints should not be null"); checkpoints.forEach((key, value) -> { _zkAdapter.setDatastreamTaskStateForKey(key, CHECKPOINT_KEY_NAME, value); if (key.getDatastreamDestination().hasConnectionString()) { String topicName = key.getDatastreamDestination().getConnectionString(); _dynamicMetricsManager.createOrUpdateCounter(this.getClass(), topicName, NUM_CHECKPOINT_COMMITS, 1); } }); }

Target:
public void commit(Map<DatastreamTask, String> checkpoints) { LOG.info("Commit called with checkpoints " + checkpoints.toString()); Validate.notNull(checkpoints, "Checkpoints should not be null"); long startTime = System.currentTimeMillis(); checkpoints.forEach((key, value) -> { _zkAdapter.setDatastreamTaskStateForKey(key, CHECKPOINT_KEY_NAME, value); _numCheckpointCommits.inc(); }); _checkpointCommitLatency.update(System.currentTimeMillis() - startTime); }
Source:
public static AvailabilitySetProperties create(final int platformUpdateDomainCount, final int platformFaultDomainCount, List<AvailabilitySetVirtualMachine> virtualMachines) { return new AutoValue_AvailabilitySet_AvailabilitySetProperties(platformUpdateDomainCount, platformFaultDomainCount, virtualMachines); }

Target:
public static AvailabilitySetProperties create(final int platformUpdateDomainCount, final int platformFaultDomainCount, List<AvailabilitySetVirtualMachine> virtualMachines) { return new AutoValue_AvailabilitySet_AvailabilitySetProperties(platformUpdateDomainCount, platformFaultDomainCount, virtualMachines == null ? null : ImmutableList.copyOf(virtualMachines)); }
Source:
private long countByComplexFiltersHelper(Criteria existingCriteria, List<VariantEntityRepositoryFilter> filters) { List<Criteria> criteriaList = getFiltersCriteria(filters); if (existingCriteria != null) { criteriaList.add(existingCriteria); } Criteria criteria = new Criteria().andOperator(criteriaList.toArray(new Criteria[criteriaList.size()])); Aggregation aggregation = Aggregation.newAggregation( Aggregation.match(criteria), Aggregation.group().count().as("count") ); AggregationResults<VariantAggregationCount> aggregationResults = mongoTemplate.aggregate(aggregation, VariantEntity.class, VariantAggregationCount.class); return aggregationResults.getMappedResults().size() > 0 ? aggregationResults.getMappedResults().get(0).getCount() : 0; }

Target:
private long countByComplexFiltersHelper(Criteria existingCriteria, List<VariantEntityRepositoryFilter> filters) { List<Criteria> criteriaList = getFiltersCriteria(filters); criteriaList.add(existingCriteria); Criteria criteria = new Criteria().andOperator(criteriaList.toArray(new Criteria[criteriaList.size()])); Aggregation aggregation = Aggregation.newAggregation( Aggregation.match(criteria), Aggregation.group().count().as("count") ); AggregationResults<VariantAggregationCount> aggregationResults = mongoTemplate.aggregate(aggregation, VariantEntity.class, VariantAggregationCount.class); return aggregationResults.getMappedResults().size() > 0 ? aggregationResults.getMappedResults().get(0).getCount() : 0; }
Source:
public boolean canMoveToMaintenance(VDS vds) { if (!Config.<Boolean>getValue(ConfigValues.MaintenanceVdsIgnoreExternalVms)) { return vds.getVmCount() == 0 && !isAnyVmRunOnVdsInDb(vds.getId()); } Optional<VM> runningVm = vmDao.getAllRunningForVds(vds.getId()) .stream() .filter(vm -> !vm.isExternalVm()) .findFirst(); return !runningVm.isPresent() && !isAnyVmRunOnVdsInDb(vds.getId()); }

Target:
public boolean canMoveToMaintenance(VDS vds) { if (!Config.<Boolean>getValue(ConfigValues.MaintenanceVdsIgnoreExternalVms)) { return vds.getVmCount() == 0 && !isAnyVmRunOnVdsInDb(vds.getId()); } return !anyNonExternalVmRunning(vds); }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("_key", _key) .add("_value", _value) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("Key", _key) .add("Value", _value) .toString(); }
Source:
public void register(String jobName, Collection<Step> steps) { Assert.notNull(jobName, "The job name cannot be null."); Assert.notNull(steps, "The job steps cannot be null."); unregisterStepsFromJob(jobName); synchronized (this.map) { final Map<String, Step> jobSteps = new HashMap<String, Step>(); for (Step step : steps) { jobSteps.put(step.getName(), step); } this.map.put(jobName, jobSteps); } }

Target:
public void register(String jobName, Collection<Step> steps) throws DuplicateJobException { Assert.notNull(jobName, "The job name cannot be null."); Assert.notNull(steps, "The job steps cannot be null."); final Map<String, Step> jobSteps = new HashMap<String, Step>(); for (Step step : steps) { jobSteps.put(step.getName(), step); } final Object previousValue = map.putIfAbsent(jobName, jobSteps); if (previousValue != null) { throw new DuplicateJobException("A job configuration with this name [" + jobName + "] was already registered"); } }
Source:
public static List<GeneratorSwitch> getGeneratorSwitches(Stream<Project> projects, List<Folder> contentFolders) { Stream<Project> projectsWithSourceFolder = projects.filter(λ -> Objects.nonNull(λ.getGeneratorSource())); Stream<Pair<Folder, Folder>> foldersWithSources = projectsWithSourceFolder .flatMap(λ -> λ.getFolders().stream().map(μ -> Pair.of(μ, λ.getGeneratorSource()))); Stream<Folder> allowedFolders = foldersWithSources.filter(λ -> !λ.getLeft().equals(λ.getRight())) .map(λ -> λ.getLeft()); Stream<Folder> generatableFolders = allowedFolders.filter(λ -> λ.getDerivative().isPresent() || λ.getDpi().isPresent() || λ.getImageScale().isPresent() || λ.getImageSize().isPresent()); Stream<GeneratorSwitch> taskGenerators = generatableFolders.map(λ -> new GeneratorSwitch(λ, contentFolders)); return new LinkedList<GeneratorSwitch>() { { taskGenerators.forEach(this::add); } }; }

Target:
public static List<GeneratorSwitch> getGeneratorSwitches(Stream<Project> projects, List<Folder> contentFolders) { Stream<Project> projectsWithSourceFolder = projects.filter(λ -> Objects.nonNull(λ.getGeneratorSource())); Stream<Folder> allowedFolders = dropOwnSourceFolders(projectsWithSourceFolder); Stream<Folder> generatableFolders = allowedFolders.filter(λ -> λ.getDerivative().isPresent() || λ.getDpi().isPresent() || λ.getImageScale().isPresent() || λ.getImageSize().isPresent()); Stream<GeneratorSwitch> taskGenerators = generatableFolders.map(λ -> new GeneratorSwitch(λ, contentFolders)); List<GeneratorSwitch> result = taskGenerators.collect(Collectors.toCollection(LinkedList::new)); return result; }
Source:
public DefaultTreeModel updateModel(Map<VirtualFile, Collection<LocalIssuePointer>> map, Predicate<VirtualFile> filePredicate) { this.filePredicate = filePredicate; index.getAllFiles().stream() .filter(f -> !map.containsKey(f)) .forEach(this::removeFile); for (Map.Entry<VirtualFile, Collection<LocalIssuePointer>> e : map.entrySet()) { setFileIssues(e.getKey(), e.getValue(), filePredicate); } return model; }

Target:
public DefaultTreeModel updateModel(Map<VirtualFile, Collection<LocalIssuePointer>> map, Predicate<VirtualFile> filePredicate) { this.filePredicate = filePredicate; index.getAllFiles().removeIf(f -> !map.containsKey(f)); for (Map.Entry<VirtualFile, Collection<LocalIssuePointer>> e : map.entrySet()) { setFileIssues(e.getKey(), e.getValue(), filePredicate); } return model; }
Source:
private Type actualIteratorTypeArgument(Type type) { if (!(type instanceof ParameterizedType)) { throw new IllegalArgumentException("Not supported type " + type.toString()); } ParameterizedType parameterizedType = (ParameterizedType) type; if (!Iterator.class.equals(parameterizedType.getRawType())) { throw new IllegalArgumentException("Not an iterator type " + parameterizedType.getRawType().toString()); } return ((ParameterizedType) type).getActualTypeArguments()[0]; }

Target:
private static Type actualIteratorTypeArgument(Type type) { if (!(type instanceof ParameterizedType)) { throw new IllegalArgumentException("Not supported type " + type.toString()); } ParameterizedType parameterizedType = (ParameterizedType) type; if (!Iterator.class.equals(parameterizedType.getRawType())) { throw new IllegalArgumentException("Not an iterator type " + parameterizedType.getRawType().toString()); } return ((ParameterizedType) type).getActualTypeArguments()[0]; }
Source:
public Void visitSpatialJoin(SpatialJoinNode node, Set<Symbol> boundSymbols) { node.getLeft().accept(this, boundSymbols); node.getRight().accept(this, boundSymbols); Set<Symbol> leftInputs = createInputs(node.getLeft(), boundSymbols); Set<Symbol> rightInputs = createInputs(node.getRight(), boundSymbols); Set<Symbol> allInputs = ImmutableSet.<Symbol>builder() .addAll(leftInputs) .addAll(rightInputs) .build(); Set<Symbol> predicateSymbols = SymbolsExtractor.extractUnique(node.getFilter()); checkArgument( allInputs.containsAll(predicateSymbols), "Symbol from filter (%s) not in sources (%s)", predicateSymbols, allInputs); int leftMaxPosition = -1; Optional<Integer> rightMinPosition = Optional.empty(); Set<Symbol> leftSymbols = new HashSet<>(node.getLeft().getOutputSymbols()); for (int i = 0; i < node.getOutputSymbols().size(); i++) { Symbol symbol = node.getOutputSymbols().get(i); if (leftSymbols.contains(symbol)) { leftMaxPosition = i; } else if (!rightMinPosition.isPresent()) { rightMinPosition = Optional.of(i); } } checkState(!rightMinPosition.isPresent() || rightMinPosition.get() > leftMaxPosition, "Not all left output symbols are before right output symbols"); return null; }

Target:
public Void visitSpatialJoin(SpatialJoinNode node, Set<Symbol> boundSymbols) { node.getLeft().accept(this, boundSymbols); node.getRight().accept(this, boundSymbols); Set<Symbol> leftInputs = createInputs(node.getLeft(), boundSymbols); Set<Symbol> rightInputs = createInputs(node.getRight(), boundSymbols); Set<Symbol> allInputs = ImmutableSet.<Symbol>builder() .addAll(leftInputs) .addAll(rightInputs) .build(); Set<Symbol> predicateSymbols = SymbolsExtractor.extractUnique(node.getFilter()); checkArgument( allInputs.containsAll(predicateSymbols), "Symbol from filter (%s) not in sources (%s)", predicateSymbols, allInputs); checkLeftOutputSymbolsBeforeRight(node.getLeft().getOutputSymbols(), node.getOutputSymbols()); return null; }
Source:
private String selectActionsAndSteps() { if (DbConnectionFactory.isMySql()) { return MYSQL_SELECT_ACTIONS_AND_STEPS; } else if (DbConnectionFactory.isPostgres()) { return POSTGRES_SELECT_ACTIONS_AND_STEPS; } else if (DbConnectionFactory.isMsSql()) { return MSSQL_SELECT_ACTIONS_AND_STEPS; } else if (DbConnectionFactory.isOracle()) { return ORACLE_SELECT_ACTIONS_AND_STEPS; } else { return null; } }

Target:
private String selectActionsAndSteps() { String sql = null; if (DbConnectionFactory.isMySql()) { sql = MYSQL_SELECT_ACTIONS_AND_STEPS; } else if (DbConnectionFactory.isPostgres()) { sql = POSTGRES_SELECT_ACTIONS_AND_STEPS; } else if (DbConnectionFactory.isMsSql()) { sql = MSSQL_SELECT_ACTIONS_AND_STEPS; } else if (DbConnectionFactory.isOracle()) { sql = ORACLE_SELECT_ACTIONS_AND_STEPS; } return sql; }
Source:
protected static void cleanProjects() { new ShellMenuItem(new WithTextMatcher("Project"), new RegexMatcher("Clean.*")).select(); new WaitUntil(new ShellIsActive("Clean")); new PushButton("OK").click(); new WaitWhile(new ShellIsActive("Clean")); new WaitWhile(new JobIsRunning()); }

Target:
protected static void cleanProjects() { new ShellMenuItem(new WithTextMatcher("Project"), new RegexMatcher("Clean.*")).select(); new WaitUntil(new ShellIsAvailable("Clean")); new PushButton("OK").click(); new WaitWhile(new ShellIsAvailable("Clean")); new WaitWhile(new JobIsRunning()); }
Source:
if(isUniversalBuffer) { bufferClsName = "org.msgpack.core.buffer.MessageBufferU"; unsafe = null; ARRAY_BYTE_BASE_OFFSET = 16; ARRAY_BYTE_INDEX_SCALE = 1; }

Target:
if(isUniversalBuffer) { bufferClsName = UNIVERSAL_MESSAGE_BUFFER; }
Source:
public static byte[] getRowKey(long txnId) { long beginTS = txnId & SIConstants.TRANSANCTION_ID_MASK; byte[] rowKey = new byte[9]; rowKey[0] = (byte)((beginTS / SIConstants.TRASANCTION_INCREMENT) & (TRANSACTION_TABLE_BUCKET_COUNT-1)); rowKey[0] = (byte)(2); Bytes.longToBytes(beginTS, rowKey, 1); return rowKey; }

Target:
public static byte[] getRowKey(long txnId) { long beginTS = txnId & SIConstants.TRANSANCTION_ID_MASK; byte[] rowKey = new byte[9]; rowKey[0] = (byte)((beginTS / SIConstants.TRASANCTION_INCREMENT) & (TRANSACTION_TABLE_BUCKET_COUNT-1)); Bytes.longToBytes(beginTS, rowKey, 1); return rowKey; }
Source:
public String getInitiateCollectionActivityDocumentUrl(String proposalNumber, String invoiceNumber) { String initiateUrl = KRADConstants.EMPTY_STRING; Properties parameters = new Properties(); parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.DOC_HANDLER_METHOD); if (!org.apache.commons.lang.StringUtils.isBlank(proposalNumber)) { parameters.put(ArPropertyConstants.ContractsGrantsCollectionActivityDocumentFields.SELECTED_PROPOSAL_NUMBER, proposalNumber); } parameters.put(ArPropertyConstants.ContractsGrantsCollectionActivityDocumentFields.SELECTED_INVOICE_DOCUMENT_NUMBER, invoiceNumber); parameters.put(KFSConstants.PARAMETER_COMMAND, KFSConstants.INITIATE_METHOD); parameters.put(KFSConstants.DOCUMENT_TYPE_NAME, ArConstants.ArDocumentTypeCodes.CONTRACTS_GRANTS_COLLECTION_ACTIVTY); final String baseUrl = !org.apache.commons.lang.StringUtils.isBlank(proposalNumber) ? getBaseContractsGrantsCollectionActivityDocumentUrl() : KFSConstants.EMPTY_STRING; initiateUrl = UrlFactory.parameterizeUrl(baseUrl, parameters); return initiateUrl; }

Target:
public String getInitiateCollectionActivityDocumentUrl(String proposalNumber, String invoiceNumber) { String initiateUrl = KRADConstants.EMPTY_STRING; Properties parameters = new Properties(); parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.DOC_HANDLER_METHOD); if (StringUtils.hasText(proposalNumber)) { parameters.put(ArPropertyConstants.ContractsGrantsCollectionActivityDocumentFields.SELECTED_PROPOSAL_NUMBER, proposalNumber); } parameters.put(ArPropertyConstants.ContractsGrantsCollectionActivityDocumentFields.SELECTED_INVOICE_DOCUMENT_NUMBER, invoiceNumber); parameters.put(KFSConstants.PARAMETER_COMMAND, KFSConstants.INITIATE_METHOD); parameters.put(KFSConstants.DOCUMENT_TYPE_NAME, ArConstants.ArDocumentTypeCodes.CONTRACTS_GRANTS_COLLECTION_ACTIVTY); final String baseUrl = StringUtils.hasText(proposalNumber) ? getBaseContractsGrantsCollectionActivityDocumentUrl() : KFSConstants.EMPTY_STRING; initiateUrl = UrlFactory.parameterizeUrl(baseUrl, parameters); return initiateUrl; }
Source:
private Map<String, String> getTraceProperties() { for (ITmfTrace openedTrace : TmfTraceManager.getInstance().getOpenedTraces()) { for (ITmfTrace singleTrace : TmfTraceManager.getTraceSet(openedTrace)) { if (this.getLocation().toString().matches("(.*)" + singleTrace.getPath())) { if (singleTrace instanceof ITmfTraceProperties) { ITmfTraceProperties traceProperties = (ITmfTraceProperties) singleTrace; return traceProperties.getTraceProperties(); } } } } return new HashMap<String, String>(); }

Target:
private Map<String, String> getTraceProperties() { for (ITmfTrace openedTrace : TmfTraceManager.getInstance().getOpenedTraces()) { for (ITmfTrace singleTrace : TmfTraceManager.getTraceSet(openedTrace)) { if (this.getLocation().toString().endsWith(singleTrace.getPath())) { if (singleTrace instanceof ITmfTraceProperties) { ITmfTraceProperties traceProperties = (ITmfTraceProperties) singleTrace; return traceProperties.getTraceProperties(); } } } } return new HashMap<String, String>(); }