auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<Attribute> getRequiredAttributes(PerunSession sess, List<Service> services, Group group) throws InternalErrorException { if(!CacheManager.isCacheDisabled() && !perun.getCacheManager().wasCacheUpdatedInTransaction()) { List<Integer> attrIds = new ArrayList<>(); for (Service service : services) { attrIds.addAll(getRequiredAttributeIds(service)); } List<Attribute> attrs = perun.getCacheManager().getAttributesByIds(attrIds, new Holder(group.getId(), Holder.HolderType.GROUP)); return this.setValuesOfAttributes(sess, attrs, group, null); } try { return jdbc.query("select " + getAttributeMappingSelectQuery("grp") + " from attr_names " + "join service_required_attrs on id=service_required_attrs.attr_id and service_required_attrs.service_id " + Compatibility.getStructureForInClause() + "left join group_attr_values grp on id=grp.attr_id and group_id=? " + "where namespace in (?,?,?,?)", new SingleBeanAttributeRowMapper<>(sess, this, group), services.stream().map(Service::getId).collect(Collectors.toList()), group.getId(), AttributesManager.NS_GROUP_ATTR_CORE, AttributesManager.NS_GROUP_ATTR_DEF, AttributesManager.NS_GROUP_ATTR_OPT, AttributesManager.NS_GROUP_ATTR_VIRT); } catch (EmptyResultDataAccessException ex) { return new ArrayList<>(); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }

Target:
public List<Attribute> getRequiredAttributes(PerunSession sess, List<Service> services, Group group) { if(!CacheManager.isCacheDisabled() && !perun.getCacheManager().wasCacheUpdatedInTransaction()) { Set<Integer> attrIds = new HashSet<>(); for (Service service : services) { attrIds.addAll(getRequiredAttributeIds(service)); } List<Attribute> attrs = perun.getCacheManager().getAttributesByIds(new ArrayList<>(attrIds), new Holder(group.getId(), Holder.HolderType.GROUP)); return this.setValuesOfAttributes(sess, attrs, group, null); } try { return jdbc.query("select " + getAttributeMappingSelectQuery("grp") + " from attr_names " + "join service_required_attrs on id=service_required_attrs.attr_id and service_required_attrs.service_id " + Compatibility.getStructureForInClause() + "left join group_attr_values grp on id=grp.attr_id and group_id=? " + "where namespace in (?,?,?,?)", new SingleBeanAttributeRowMapper<>(sess, this, group), services.stream().map(Service::getId).collect(Collectors.toList()), group.getId(), AttributesManager.NS_GROUP_ATTR_CORE, AttributesManager.NS_GROUP_ATTR_DEF, AttributesManager.NS_GROUP_ATTR_OPT, AttributesManager.NS_GROUP_ATTR_VIRT); } catch (EmptyResultDataAccessException ex) { return new ArrayList<>(); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
private static Optional<TimeValue> getTimeValue(Optional<TimeValue> primaryValue, Optional<TimeValue> safetyValue) { if (!primaryValue.isPresent()) { return safetyValue; } return primaryValue; }

Target:
private Optional<TimeValue> getTimeValue(Optional<TimeValue> primaryValue, Optional<TimeValue> safetyValue) { if (!primaryValue.isPresent()) { return safetyValue; } return primaryValue; }
Source:
private Integer getLookupAttributeIndex( EditorAttribute editorAttribute, EditorEntityType editorEntityType) { String editorAttributeId = editorAttribute.getId(); List<EditorAttributeIdentifier> lookupAttributes = editorEntityType.getLookupAttributes(); int index = IntStream.range(0, lookupAttributes.size()) .map(idx -> lookupAttributes.get(idx).getId().equals(editorAttributeId) ? idx : -1) .reduce(Integer::max) .orElse(-1); return index != -1 ? index : null; }

Target:
private Integer getLookupAttributeIndex( EditorAttribute editorAttribute, EditorEntityType editorEntityType) { String editorAttributeId = editorAttribute.getId(); int index = editorEntityType .getLookupAttributes() .stream() .map(EditorAttributeIdentifier::getId) .collect(toList()) .indexOf(editorAttributeId); return index != -1 ? index : null; }
Source:
public void testNoSDRbuildingAddition() { Record record = factory.newRecord(); DataField df = factory.newDataField("856", ' ', ' '); df.addSubfield(factory.newSubfield('u', "<LINK_1>")); record.addVariableField(df); df = factory.newDataField("856", ' ', ' '); df.addSubfield(factory.newSubfield('u', "<LINK_0>")); record.addVariableField(df); solrFldMapTest.assertSolrFldHasNoValue(record, fldName, "SDR"); }

Target:
public void testNoSDRbuildingAddition() { Record record = factory.newRecord(); DataField df = factory.newDataField("856", ' ', ' '); df.addSubfield(factory.newSubfield('u', "<LINK_1>")); record.addVariableField(df); df = factory.newDataField("856", ' ', ' '); df.addSubfield(factory.newSubfield('u', "<LINK_0>")); record.addVariableField(df); solrFldMapTest.assertSolrFldHasNoValue(record, fldName, "SDR"); solrFldMapTest.assertSolrFldHasNoValue(record, fldName, "Stanford Digital Repository"); }
Source:
public void setUp() { TmfEventMatching.registerMatchObject(new TcpEventMatching()); TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); }

Target:
public static void setUp() { TmfEventMatching.registerMatchObject(new TcpEventMatching()); TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); }
Source:
private void writeMeetings() { nextSheet("Meetings", 2, 1, false); nextRow(); nextHeaderCell("Topic"); nextHeaderCell("Duration"); nextHeaderCell("Speakers"); nextHeaderCell("Content"); nextHeaderCell("Required attendance list"); nextHeaderCell("Preferred attendance list"); for (Meeting meeting : solution.getMeetingList()) { nextRow(); nextCell().setCellValue(meeting.getTopic()); nextCell().setCellValue(meeting.getDurationInGrains() * TimeGrain.GRAIN_LENGTH_IN_MINUTES); nextCell().setCellValue(meeting.getSpeakerList() == null ? "" : String.join(", ", meeting.getSpeakerList().stream() .map(speaker -> speaker.getFullName()) .collect(toList()))); nextCell().setCellValue(meeting.getContent() == null ? "" : meeting.getContent()); nextCell().setCellValue( String.join(", ", meeting.getRequiredAttendanceList().stream() .map(requiredAttendance -> requiredAttendance.getPerson().getFullName()) .collect(toList()))); nextCell().setCellValue( String.join(", ", meeting.getPreferredAttendanceList().stream() .map(preferredAttendance -> preferredAttendance.getPerson().getFullName()) .collect(toList()))); } autoSizeColumnsWithHeader(); }

Target:
private void writeMeetings() { nextSheet("Meetings", 1, 1, false); nextRow(); nextHeaderCell("Topic"); nextHeaderCell("Group"); nextHeaderCell("Duration"); nextHeaderCell("Speakers"); nextHeaderCell("Content"); nextHeaderCell("Required attendance list"); nextHeaderCell("Preferred attendance list"); for (Meeting meeting : solution.getMeetingList()) { nextRow(); nextCell().setCellValue(meeting.getTopic()); nextCell().setCellValue(meeting.isEntireGroupMeeting() ? "Y" : ""); nextCell().setCellValue(meeting.getDurationInGrains() * TimeGrain.GRAIN_LENGTH_IN_MINUTES); nextCell().setCellValue(meeting.getSpeakerList() == null ? "" : meeting.getSpeakerList().stream() .map(Person::getFullName) .collect(joining(", "))); nextCell().setCellValue(meeting.getContent() == null ? "" : meeting.getContent()); nextCell().setCellValue( meeting.getRequiredAttendanceList().stream() .map(requiredAttendance -> requiredAttendance.getPerson().getFullName()) .collect(joining(", "))); nextCell().setCellValue( meeting.getPreferredAttendanceList().stream() .map(preferredAttendance -> preferredAttendance.getPerson().getFullName()) .collect(joining(", "))); } setColumnsWidthHeader(5000); }
Source:
public VMImage getImage(final String id) { String[] fields = VMImageToImage.decodeFieldsFromUniqueId(id); boolean custom = fields.length == 6 ? true : false; if (custom) { String storage = fields[2]; String vhd = fields[3]; VMImage ref = VMImage.create(azureGroup, storage, vhd, null, "", fields[4], fields[5]); String key = api.getStorageAccountApi(azureGroup).getKeys(storage).key1(); if (BlobHelper.customImageExists(storage, key)) return ref; else return null; } String location = fields[0]; String publisher = fields[1]; String offer = fields[2]; String sku = fields[3]; OSImageApi osImageApi = api.getOSImageApi(location); List<Version> versions = osImageApi.listVersions(publisher, offer, sku); if (!versions.isEmpty()) { return VMImage.create(publisher, offer, sku, versions.get(0).name(), location); } return null; }

Target:
public VMImage getImage(final String id) { VMImage image = VMImageToImage.decodeFieldsFromUniqueId(id); if (image.custom()) { String key = api.getStorageAccountApi(azureGroup).getKeys(image.storage()).key1(); if (BlobHelper.customImageExists(image.storage(), key)) return image; else return null; } String location = image.location(); String publisher = image.publisher(); String offer = image.offer(); String sku = image.sku(); OSImageApi osImageApi = api.getOSImageApi(location); List<Version> versions = osImageApi.listVersions(publisher, offer, sku); if (!versions.isEmpty()) { return VMImage.create(publisher, offer, sku, versions.get(0).name(), location); } return null; }
Source:
public static OrcTester quickOrcTester() { OrcTester orcTester = new OrcTester(); orcTester.structTestsEnabled = true; orcTester.mapTestsEnabled = true; orcTester.listTestsEnabled = true; orcTester.nullTestsEnabled = true; orcTester.missingStructFieldsTestsEnabled = true; orcTester.skipBatchTestsEnabled = true; orcTester.formats = ImmutableSet.of(ORC_12, ORC_11); orcTester.compressions = ImmutableSet.of(ZLIB); return orcTester; }

Target:
public static OrcTester quickOrcTester() { OrcTester orcTester = new OrcTester(); orcTester.structTestsEnabled = true; orcTester.mapTestsEnabled = true; orcTester.listTestsEnabled = true; orcTester.nullTestsEnabled = true; orcTester.missingStructFieldsTestsEnabled = true; orcTester.skipBatchTestsEnabled = true; orcTester.formats = ImmutableSet.of(ORC_12, ORC_11, DWRF); orcTester.compressions = ImmutableSet.of(ZLIB); return orcTester; }
Source:
private void saveLocalFile() { mFile.setFileName(mNewName); if (mFile.isDown()) { boolean isAvailableOffline = mFile.getAvailableOfflineStatus() == OCFile.AvailableOfflineStatus.AVAILABLE_OFFLINE; if (isAvailableOffline) { pauseObservation(); } String oldPath = mFile.getStoragePath(); File f = new File(oldPath); String parentStoragePath = f.getParent(); if (!parentStoragePath.endsWith(File.separator)) parentStoragePath += File.separator; if (f.renameTo(new File(parentStoragePath + mNewName))) { String newPath = parentStoragePath + mNewName; mFile.setStoragePath(newPath); if (isAvailableOffline) { resumeObservation(); } getStorageManager().deleteFileInMediaScan(oldPath); FileDataStorageManager.triggerMediaScan(newPath); } } getStorageManager().saveFile(mFile); }

Target:
private void saveLocalFile() { mFile.setFileName(mNewName); if (mFile.isDown()) { boolean isAvailableOffline = mFile.getAvailableOfflineStatus() == OCFile.AvailableOfflineStatus.AVAILABLE_OFFLINE; if (isAvailableOffline) { pauseObservation(); } String oldPath = mFile.getStoragePath(); File f = new File(oldPath); String parentStoragePath = f.getParent(); if (!parentStoragePath.endsWith(File.separator)) parentStoragePath += File.separator; if (f.renameTo(new File(parentStoragePath + mNewName))) { String newPath = parentStoragePath + mNewName; mFile.setStoragePath(newPath); if (isAvailableOffline) { resumeObservation(); } getStorageManager().deleteFileInMediaScan(oldPath); getStorageManager().triggerMediaScan(newPath); } } getStorageManager().saveFile(mFile); }
Source:
public void execute(JobExecutionContext jobExecutionContext) { LOGGER.info("executing..."); try { JobDetail jobDetail = jobExecutionContext.getJobDetail(); JobDataMap jobDataMap = jobDetail.getJobDataMap(); String jobId = jobDetail.getKey().getName(); String eventType = jobDataMap.getString(SchedulerConstants.EVENT_TYPE_KEY_NAME); Map<String, Object> params = jobDataMap.getWrappedMap(); params.remove(SchedulerConstants.EVENT_TYPE_KEY_NAME); params.put(SchedulerConstants.JOB_ID_KEY, jobId); params.put(TasksEventParser.CUSTOM_PARSER_EVENT_KEY, SchedulerEventParser.PARSER_NAME); MotechEvent motechEvent = new MotechEvent(eventType, params); LOGGER.info("Sending Motech Event Message: " + motechEvent); SchedulerContext schedulerContext; try { schedulerContext = jobExecutionContext.getScheduler().getContext(); } catch (SchedulerException e) { LOGGER.error("Can not execute job. Can not get Scheduler Context", e); return; } ApplicationContext applicationContext = (ApplicationContext) schedulerContext.get("applicationContext"); EventRelay eventRelay = applicationContext.getBean(EventRelay.class); eventRelay.sendEventMessage(motechEvent); } catch (RuntimeException e) { LOGGER.error("Job execution failed.", e); } }

Target:
public void execute(JobExecutionContext jobExecutionContext) { LOGGER.info("executing..."); try { JobDetail jobDetail = jobExecutionContext.getJobDetail(); JobDataMap jobDataMap = jobDetail.getJobDataMap(); String jobId = jobDetail.getKey().getName(); String eventType = jobDataMap.getString(SchedulerConstants.EVENT_TYPE_KEY_NAME); Map<String, Object> params = jobDataMap.getWrappedMap(); params.remove(SchedulerConstants.EVENT_TYPE_KEY_NAME); params.put(MotechSchedulerService.JOB_ID_KEY, jobId); params.put(TasksEventParser.CUSTOM_PARSER_EVENT_KEY, SchedulerEventParser.PARSER_NAME); MotechEvent motechEvent = new MotechEvent(eventType, params); LOGGER.info("Sending Motech Event Message: " + motechEvent); SchedulerContext schedulerContext; try { schedulerContext = jobExecutionContext.getScheduler().getContext(); } catch (SchedulerException e) { LOGGER.error("Can not execute job. Can not get Scheduler Context", e); return; } ApplicationContext applicationContext = (ApplicationContext) schedulerContext.get("applicationContext"); EventRelay eventRelay = applicationContext.getBean(EventRelay.class); eventRelay.sendEventMessage(motechEvent); } catch (RuntimeException e) { LOGGER.error("Job execution failed.", e); } }
Source:
private void fireInvokeCallback(final Invoker<?> invoker, final Invocation invocation) { final ConsumerMethodModel.AsyncMethodInfo asyncMethodInfo = getAsyncMethodInfo(invoker, invocation); if (asyncMethodInfo == null) return; final Method onInvokeMethod = asyncMethodInfo.getOninvokeMethod(); final Object onInvokeInst = asyncMethodInfo.getOninvokeInstance(); if (onInvokeMethod == null && onInvokeInst == null) { return; } if (onInvokeMethod == null || onInvokeInst == null) { throw new IllegalStateException("service:" + invoker.getUrl().getServiceKey() + " has a oninvoke callback config , but no such " + (onInvokeMethod == null ? "method" : "instance") + " found. url:" + invoker.getUrl()); } if (!onInvokeMethod.isAccessible()) { onInvokeMethod.setAccessible(true); } Object[] params = invocation.getArguments(); try { onInvokeMethod.invoke(onInvokeInst, params); } catch (InvocationTargetException e) { fireThrowCallback(invoker, invocation, e.getTargetException()); } catch (Throwable e) { fireThrowCallback(invoker, invocation, e); } }

Target:
private void fireInvokeCallback(final Invoker<?> invoker, final Invocation invocation) { final ConsumerMethodModel.AsyncMethodInfo asyncMethodInfo = getAsyncMethodInfo(invoker, invocation); if (asyncMethodInfo == null) { return; } final Method onInvokeMethod = asyncMethodInfo.getOninvokeMethod(); final Object onInvokeInst = asyncMethodInfo.getOninvokeInstance(); if (onInvokeMethod == null && onInvokeInst == null) { return; } if (onInvokeMethod == null || onInvokeInst == null) { throw new IllegalStateException("service:" + invoker.getUrl().getServiceKey() + " has a oninvoke callback config , but no such " + (onInvokeMethod == null ? "method" : "instance") + " found. url:" + invoker.getUrl()); } if (!onInvokeMethod.isAccessible()) { onInvokeMethod.setAccessible(true); } Object[] params = invocation.getArguments(); try { onInvokeMethod.invoke(onInvokeInst, params); } catch (InvocationTargetException e) { fireThrowCallback(invoker, invocation, e.getTargetException()); } catch (Throwable e) { fireThrowCallback(invoker, invocation, e); } }
Source:
private void checkDirectoryForXmlFiles(final String name, final String xmlModelName) { final Class clazz; try { clazz = Class.forName(xmlModelName); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } final Path directory = Paths.get(ConfigFileConstants.getFilePathString(), name); if (!Files.exists(directory)) { return; } try (final DirectoryStream<Path> stream = Files.newDirectoryStream(directory, "*.xml")) { for (final Path entry : stream) { try { JaxbUtils.unmarshal(clazz, entry.toFile(), true); } catch (final Exception e) { throw new ConfigCheckValidationException(e); } } } catch (final IOException e) { throw new ConfigCheckValidationException(e); } }

Target:
private void checkDirectoryForXmlFiles(final String name, final String xmlModelName) { final Path directory = Paths.get(ConfigFileConstants.getFilePathString(), name); if (!Files.exists(directory)) { return; } final Class clazz; try { clazz = Class.forName(xmlModelName); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } try (final DirectoryStream<Path> stream = Files.newDirectoryStream(directory, "*.xml")) { for (final Path entry : stream) { try { JaxbUtils.unmarshal(clazz, entry.toFile(), true); } catch (final Exception e) { throw new ConfigCheckValidationException("File " + entry.toString() + " not valid!", e); } } } catch (final IOException e) { throw new ConfigCheckValidationException(e); } }
Source:
public YearWeek minusWeeks(long weeksToSubtract) { if (weeksToSubtract == 0) { return this; } if (weeksToSubtract < 0) { return plusWeeks(-weeksToSubtract); } YearWeek yearWeek = this; while (weeksToSubtract-- > 0) { if (yearWeek.week > 1) { yearWeek = YearWeek.of(yearWeek.year, yearWeek.week - 1); } else { yearWeek = YearWeek.of(yearWeek.year - 1, weekRange(yearWeek.year - 1)); } } return yearWeek; }

Target:
public YearWeek minusWeeks(long weeksToSubtract) { if (weeksToSubtract == 0) { return this; } LocalDate mondayOfWeek = atDay(DayOfWeek.MONDAY).minusWeeks(weeksToSubtract); return YearWeek.from(mondayOfWeek); }
Source:
private void analyzeXPathForRuleChain(final XPathEvaluator xpathEvaluator) { final Expression expr = xpathExpression.getInternalExpression(); boolean useRuleChain = true; List<Expression> subexpressions = new ArrayList<>(); SplitUnions unions = new SplitUnions(); unions.visit(expr); if (unions.getExpressions().isEmpty()) { subexpressions.add(expr); } else { subexpressions.addAll(unions.getExpressions()); } for (Expression subexpression : subexpressions) { RuleChainAnalyzer rca = new RuleChainAnalyzer(xpathEvaluator.getConfiguration()); Expression modified = rca.visit(subexpression); if (rca.getRootElement() != null) { addExpressionForNode(rca.getRootElement(), modified); } else { useRuleChain = false; break; } } if (useRuleChain) { super.ruleChainVisits.addAll(nodeNameToXPaths.keySet()); } else { nodeNameToXPaths.clear(); if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Unable to use RuleChain for XPath: " + xpath); } } addExpressionForNode(AST_ROOT, xpathExpression.getInternalExpression()); }

Target:
private void analyzeXPathForRuleChain(final XPathEvaluator xpathEvaluator) { final Expression expr = xpathExpression.getInternalExpression(); boolean useRuleChain = true; Iterable<Expression> subexpressions = RuleChainAnalyzer.splitUnions(expr); for (Expression subexpression : subexpressions) { RuleChainAnalyzer rca = new RuleChainAnalyzer(xpathEvaluator.getConfiguration()); Expression modified = rca.visit(subexpression); if (rca.getRootElement() != null) { addExpressionForNode(rca.getRootElement(), modified); } else { useRuleChain = false; break; } } if (useRuleChain) { super.ruleChainVisits.addAll(nodeNameToXPaths.keySet()); } else { nodeNameToXPaths.clear(); if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Unable to use RuleChain for XPath: " + xpath); } } addExpressionForNode(AST_ROOT, xpathExpression.getInternalExpression()); }
Source:
public static VdcParameter create(String name, Class javaType, String guidStr) { Guid guid = new Guid(guidStr); if (parametersMap.containsKey(guid)) { throw new InvalidParameterGuidException(name, guidStr, parametersMap.get(guid)); } parametersMap.put(guid, new VdcParameter(name, javaType, guid)); return parametersMap.get(guid); }

Target:
public static VdcParameter create(String name, Class javaType, String guidStr) { Guid guid = new Guid(guidStr); synchronized (parametersMap) { if (parametersMap.containsKey(guid)) { throw new InvalidParameterGuidException(name, parametersMap.get(guid)); } parametersMap.put(guid, new VdcParameter(name, javaType, guid)); } return parametersMap.get(guid); }
Source:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (url == null || (!url.startsWith(HTTP) && !url.startsWith(HTTPS))) { response.sendError(response.SC_NOT_FOUND, "Cannot proxy, no URL is configured."); } else { URLConnection connection; try { connection = createConnection(new URL(mergeQuery(url, request.getQueryString()))); } catch(Exception e) { throw new ServletException(e); } connection.connect(); try { if (connection instanceof HttpURLConnection) { response.setStatus(((HttpURLConnection)connection).getResponseCode()); } for (Map.Entry<String, List<String>> entry : connection.getHeaderFields().entrySet()) { if (entry.getKey() != null) { boolean first = true; for (String value : entry.getValue()) { if (first) { first = false; response.setHeader(entry.getKey(), value); } else { response.addHeader(entry.getKey(), value); } } } } copy(connection.getInputStream(), response.getOutputStream()); } finally { if (connection instanceof HttpURLConnection) { ((HttpURLConnection)connection).disconnect(); } } } }

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (url == null) { response.sendError(response.SC_NOT_FOUND, "Cannot proxy, no URL is configured."); } else { URLConnection connection; try { connection = createConnection(new URL(mergeQuery(url, request.getQueryString()))); } catch(Exception e) { throw new ServletException(e); } connection.connect(); try { if (connection instanceof HttpURLConnection) { response.setStatus(((HttpURLConnection)connection).getResponseCode()); } for (Map.Entry<String, List<String>> entry : connection.getHeaderFields().entrySet()) { if (entry.getKey() != null) { boolean first = true; for (String value : entry.getValue()) { if (first) { first = false; response.setHeader(entry.getKey(), value); } else { response.addHeader(entry.getKey(), value); } } } } copy(connection.getInputStream(), response.getOutputStream()); } finally { if (connection instanceof HttpURLConnection) { ((HttpURLConnection)connection).disconnect(); } } } }
Source:
private static @Nullable TmfEventsTable getExperimentEventTable( final TmfExperiment experiment, final Composite parent, final int cacheSize) { String commonTraceType = getCommonTraceType(experiment); if (commonTraceType != null) { return getEventTable(experiment.getTraces()[0], parent, cacheSize); } ITmfTrace[] traces = experiment.getTraces(); Set<TmfEventTableColumn> cols = new LinkedHashSet<>(); boolean wantsDefaultCols = false; for (ITmfTrace trace : traces) { if (TmfTraceTypeUIUtils.getEventTableColumns(trace) == null) { wantsDefaultCols = true; break; } } if (wantsDefaultCols) { cols.addAll(TmfEventsTable.DEFAULT_COLUMNS); } for (ITmfTrace trace : traces) { Collection<? extends TmfEventTableColumn> traceCols = TmfTraceTypeUIUtils.getEventTableColumns(trace); if (traceCols != null) { cols.addAll(traceCols); } } return new TmfEventsTable(parent, cacheSize, cols); }

Target:
private static @NonNull TmfEventsTable getExperimentEventTable( final TmfExperiment experiment, final Composite parent, final int cacheSize) { String commonTraceType = getCommonTraceType(experiment); if (commonTraceType != null) { return getEventTable(experiment.getTraces()[0], parent, cacheSize); } ITmfTrace[] traces = experiment.getTraces(); Set<TmfEventTableColumn> cols = new LinkedHashSet<>(); for (ITmfTrace trace : traces) { Collection<? extends TmfEventTableColumn> traceCols = TmfTraceTypeUIUtils.getEventTableColumns(trace); if (traceCols == null) { cols.addAll(TmfEventsTable.DEFAULT_COLUMNS); } else { cols.addAll(traceCols); } } return new TmfEventsTable(parent, cacheSize, cols); }
Source:
public void put(TraceEventType eventType, TraceEventWrapper beginWrapper, long beginTime, String eventId) { if (TraceEventType.DURATION_BEGIN.equals(eventType)) { m_durationEvents.addLast(new Pair<TraceEventWrapper, Long>(beginWrapper, beginTime)); return; } if (TraceEventType.ASYNC_BEGIN.equals(eventType)) { m_asyncEvents.put(eventId, new Pair<TraceEventWrapper, Long>(beginWrapper, beginTime)); return; } return; }

Target:
public void put(TraceEventType eventType, TraceEventWrapper beginWrapper, long beginTime, String eventId) { if (TraceEventType.DURATION_BEGIN.equals(eventType)) { m_durationEvents.addLast(Pair.of(beginWrapper, beginTime)); return; } if (TraceEventType.ASYNC_BEGIN.equals(eventType)) { m_asyncEvents.put(eventId, Pair.of(beginWrapper, beginTime)); return; } return; }
Source:
private Scanner createMockScanner(final TreeMap<Key,Value> data) { final ScannerState state = new ScannerState(); Scanner scanner = createMock(Scanner.class); expect(scanner.iterator()).andAnswer(new IAnswer<Iterator<Entry<Key,Value>>>() { @Override public Iterator<Entry<Key,Value>> answer() throws Throwable { Iterator<Entry<Key,Value>> iter = data.entrySet().iterator(); iter = Iterators.filter(iter, state.getScanPredicate()::test); return iter; } }).anyTimes(); state.rangeCapture = Capture.newInstance(); scanner.setRange(capture(state.rangeCapture)); expectLastCall().anyTimes(); scanner.fetchColumn(anyObject(Text.class), anyObject(Text.class)); expectLastCall().anyTimes(); scanner.fetchColumnFamily(anyObject(Text.class)); expectLastCall().anyTimes(); replay(scanner); return scanner; }

Target:
private Scanner createMockScanner(final TreeMap<Key,Value> data) { final ScannerState state = new ScannerState(); Scanner scanner = createMock(Scanner.class); expect(scanner.iterator()).andAnswer(new IAnswer<Iterator<Entry<Key,Value>>>() { @Override public Iterator<Entry<Key,Value>> answer() throws Throwable { Iterator<Entry<Key,Value>> iter = data.entrySet().iterator(); final Predicate<Entry<Key,Value>> scanPredicate = state.getScanPredicate(); iter = Iterators.filter(iter, scanPredicate::test); return iter; } }).anyTimes(); state.rangeCapture = Capture.newInstance(); scanner.setRange(capture(state.rangeCapture)); expectLastCall().anyTimes(); scanner.fetchColumn(anyObject(Text.class), anyObject(Text.class)); expectLastCall().anyTimes(); scanner.fetchColumnFamily(anyObject(Text.class)); expectLastCall().anyTimes(); replay(scanner); return scanner; }
Source:
public void testInsertWhileNotEnable() { store.setValue(EclipsePreferenceConstants.SHOW_CONTRIBUTION_ANNOTATIONS, false); final User ALICE_TEST_USER = new User(new JID("ALICE_TEST_USER@test"), false, false, null); manager.insertAnnotation(model, 5, 7, ALICE_TEST_USER); assertEquals(0, getAnnotationCount(model)); }

Target:
public void testInsertWhileNotEnable() { store.setValue(EclipsePreferenceConstants.SHOW_CONTRIBUTION_ANNOTATIONS, false); manager.insertAnnotation(model, 5, 7, ALICE_TEST_USER); assertEquals(0, getAnnotationCount(model)); }
Source:
private static HolidayCalendarId create(String name) { if (!name.contains("+")) { return CACHE.computeIfAbsent(name, n -> new HolidayCalendarId(name)); } List<HolidayCalendarId> ids = Splitter.on('+').splitToList(name).stream() .filter(n -> !n.equals(HolidayCalendarIds.NO_HOLIDAYS.getName())) .map(n -> HolidayCalendarId.of(n)) .distinct() .sorted(comparing(HolidayCalendarId::getName)) .collect(toList()); String normalizedName = Joiner.on('+').join(ids); BiFunction<HolidayCalendarId, ReferenceData, HolidayCalendar> resolver = (id, refData) -> { HolidayCalendar cal = refData.queryValueOrNull(id); if (cal != null) { return cal; } cal = HolidayCalendars.NO_HOLIDAYS; for (HolidayCalendarId splitId : ids) { HolidayCalendar splitCal = refData.queryValueOrNull(splitId); if (splitCal == null) { throw new ReferenceDataNotFoundException(""); } cal = cal.combinedWith(splitCal); } return cal; }; HolidayCalendarId id = CACHE.computeIfAbsent(normalizedName, n -> new HolidayCalendarId(normalizedName, resolver)); CACHE.putIfAbsent(name, id); return id; }

Target:
private static HolidayCalendarId create(String name) { if (!name.contains("+")) { return CACHE.computeIfAbsent(name, n -> new HolidayCalendarId(name)); } List<HolidayCalendarId> ids = Splitter.on('+').splitToList(name).stream() .filter(n -> !n.equals(HolidayCalendarIds.NO_HOLIDAYS.getName())) .map(n -> HolidayCalendarId.of(n)) .distinct() .sorted(comparing(HolidayCalendarId::getName)) .collect(toList()); String normalizedName = Joiner.on('+').join(ids); BiFunction<HolidayCalendarId, ReferenceData, HolidayCalendar> resolver = (id, refData) -> { HolidayCalendar cal = refData.queryValueOrNull(id); if (cal != null) { return cal; } cal = HolidayCalendars.NO_HOLIDAYS; for (HolidayCalendarId splitId : ids) { HolidayCalendar splitCal = refData.queryValueOrNull(splitId); if (splitCal == null) { throw new ReferenceDataNotFoundException(Messages.format( "Reference data not found for '{}' of type 'HolidayCalendarId' when finding '{}'", splitId, id)); } cal = cal.combinedWith(splitCal); } return cal; }; HolidayCalendarId id = CACHE.computeIfAbsent(normalizedName, n -> new HolidayCalendarId(normalizedName, resolver)); CACHE.putIfAbsent(name, id); return id; }
Source:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select" + " mm.id" + " from manual_measures mm" + " where" + " mm.component_uuid is null" + " or not exists (" + " select" + " 1" + " from projects p" + " where" + " p.uuid = mm.component_uuid" + " and p.scope = ?" + " and p.qualifier in (?,?,?,?)" + " )") .setString(1, SCOPE_PROJECT) .setString(2, QUALIFIER_PROJECT) .setString(3, QUALIFIER_VIEW) .setString(4, QUALIFIER_MODULE) .setString(5, QUALIFIER_SUBVIEW); massUpdate.update("delete from manual_measures where id = ?"); massUpdate.rowPluralName("orphan properties"); massUpdate.execute(CleanOrphanRowsInManualMeasures::handle); }

Target:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select" + " mm.id" + " from manual_measures mm" + " where" + " mm.component_uuid is null" + " or not exists (" + " select" + " 1" + " from projects p" + " where" + " p.uuid = mm.component_uuid" + " and p.scope = ?" + " and p.qualifier in (?,?,?,?)" + " and p.enabled = ?" + " )") .setString(1, SCOPE_PROJECT) .setString(2, QUALIFIER_PROJECT) .setString(3, QUALIFIER_VIEW) .setString(4, QUALIFIER_MODULE) .setString(5, QUALIFIER_SUBVIEW) .setBoolean(6, true); massUpdate.update("delete from manual_measures where id = ?"); massUpdate.rowPluralName("orphan properties"); massUpdate.execute(CleanOrphanRowsInManualMeasures::handle); }
Source:
private static boolean isIntegerType(GoType type) { return intTypeNames.contains(type.getText()); }

Target:
private static boolean isIntegerType(GoType type) { if (type.getTypeReferenceExpression() == null) { return false; } return intTypeNames.contains(type.getTypeReferenceExpression().getText()); }
Source:
public void untag(final String... tags) throws IOException { final List<String> args = new ArrayList<String>(); args.add("remove"); args.add(this.jid); for (final String tag: tags) { args.add(tag); } this.client.call( LuaCommand.TAG.toString(), args); }

Target:
public void untag(final String... tags) throws IOException { final List<String> args = new ArrayList<>(); args.add("remove"); args.add(this.jid); Collections.addAll(args, tags); this.client.call( LuaCommand.TAG.toString(), args); }
Source:
public Double getValue() { try { estimator.accumulate(cx); } catch (ExecException ex) { throw new RuntimeException("Error while accumulating sample frequency: " + ex); } return estimator.getEntropy(); }

Target:
public Double getValue() { try { this.estimator.accumulate(this.cx); } catch (ExecException ex) { throw new RuntimeException("Error while accumulating sample frequency: " + ex); } return this.estimator.getEntropy(); }
Source:
private void setActionPerformer(View view, ViewAction<T> action) { if (action.getTriggerType() == TriggerType.CLICK) { new ClickActionPerformer<T>(action).setupListener(view); } else if (action.getTriggerType() == TriggerType.LONG_CLICK) { new LongClickActionPerformer<T>(action).setupListener(view); } else if (action.getTriggerType() == TriggerType.TOUCH || action.getTriggerType() == TriggerType.TOUCH_DOWN || action.getTriggerType() == TriggerType.TOUCH_UP) { new TouchActionPerformer<T>(action).setupListener(view); } else if (action.getTriggerType() == TriggerType.ITEM_CLICK) { new ItemClickActionPerformer<T>(action).setupListener(view); } }

Target:
private void setActionPerformer(View view, ViewAction<T> action) { if (action.getTriggerType() == TriggerType.CLICK) { new ClickActionPerformer<T>(action).setupListener(view); } else if (action.getTriggerType() == TriggerType.LONG_CLICK) { new LongClickActionPerformer<T>(action).setupListener(view); } else if (action.getTriggerType() == TriggerType.TOUCH || action.getTriggerType() == TriggerType.TOUCH_DOWN || action.getTriggerType() == TriggerType.TOUCH_UP) { new TouchActionPerformer<T>(action).setupListener(view); } else if (action.getTriggerType() == TriggerType.CLICK_LIST_ITEM) { new ListItemClickActionPerformer<T>(action).setupListener(view); } }
Source:
private DataInputAssociation input(Object value) { DataInput target = readInputFrom(inputDefinition.name(), typeDef); Assignment assignment = assignment(value.toString(), target.getId()); DataInputAssociation dataInputAssociation = associationOf(assignment, target); return dataInputAssociation; }

Target:
private DataInputAssociation input(Object value) { DataInput target = readInputFrom(inputDefinition.name(), typeDef); Assignment assignment = assignment(value.toString(), target.getId()); DataInputAssociation association = associationOf(assignment, target); return association; }
Source:
public void activate() { logger.debug("neohub activated"); }

Target:
public void activate() { }
Source:
public void testGetValueFromFilterConfig() { final TestConfigurationFilter filter = new TestConfigurationFilter(); final MockServletContext ctx = new MockServletContext(); ctx.addInitParameter("service", "<LINK_1>"); final MockFilterConfig filterConfig = new MockFilterConfig(ctx); filterConfig.addInitParameter(AbstractConfigurationFilter.PARAM_NAME_CONFIG_FILE, CONFIG_FILE_PATH); filterConfig.addInitParameter("serverName", "<LINK_0>"); assertEquals(filter.getPropertyFromInitParams(filterConfig, "serverName", null), "<LINK_0>"); assertNotNull(filter.getPropertyFromInitParams(filterConfig, "service", null)); }

Target:
public void testGetValueFromFilterConfig() { final TestConfigurationFilter filter = new TestConfigurationFilter(); final MockServletContext ctx = new MockServletContext(); ctx.addInitParameter("service", "<LINK_1>"); final MockFilterConfig filterConfig = new MockFilterConfig(ctx); filterConfig.addInitParameter(AbstractConfigurationFilter.PARAM_NAME_CONFIG_FILE, CONFIG_FILE_PATH); filterConfig.addInitParameter("serverName", "<LINK_0>"); assertEquals(filter.getPropertyFromInitParams(filterConfig, "serverName", null), filterConfig.getInitParameter("serverName")); assertEquals(filter.getPropertyFromInitParams(filterConfig, "service", null), ctx.getInitParameter("service")); }
Source:
public HadoopIndexTask(@JsonProperty("config") HadoopDruidIndexerConfig config) { super( String.format("index_hadoop_%s_interval_%s", config.getDataSource(), new DateTime().now()), config.getDataSource(), JodaUtils.umbrellaInterval(config.getIntervals()) ); if (config.isUpdaterJobSpecSet()) { throw new IllegalArgumentException("UpDaterJobSpec is defined"); } this.config = config; }

Target:
public HadoopIndexTask( @JsonProperty("config") HadoopDruidIndexerConfig config ) { super( String.format("index_hadoop_%s_%s", config.getDataSource(), new DateTime()), config.getDataSource(), JodaUtils.umbrellaInterval(config.getIntervals()) ); Preconditions.checkArgument(config.getSegmentOutputDir() == null, "segmentOutputPath must be absent"); Preconditions.checkArgument(config.getJobOutputDir() == null, "workingPath must be absent"); Preconditions.checkArgument(!config.isUpdaterJobSpecSet(), "updaterJobSpec must be absent"); this.config = config; }
Source:
static boolean isMemberAccessibleFrom(int modifier, @Nonnull JClassOrInterface declaringType, @CheckForNull JType accessedVia, @Nonnull JDefinedClassOrInterface accessor) { if (JModifier.isPublic(modifier)) { return true; } if (accessor.isSameType(declaringType)) { return true; } if (JModifier.isPrivate(modifier)) { return accessor == declaringType; } if (declaringType.getEnclosingPackage() == accessor.getEnclosingPackage()) { return true; } if (!JModifier.isProtected(modifier)) { return false; } if (!accessor.canBeSafelyUpcast(declaringType)) { return false; } if (JModifier.isStatic(modifier)) { return true; } return accessedVia instanceof JReferenceType && ((JReferenceType) accessedVia).canBeSafelyUpcast(accessor); }

Target:
static boolean isMemberAccessibleFrom(int modifier, @Nonnull JClassOrInterface declaringType, @CheckForNull JType accessedVia, @Nonnull JDefinedClassOrInterface accessor) { if (JModifier.isPublic(modifier)) { return true; } if (accessor.isSameType(declaringType)) { return true; } if (JModifier.isPrivate(modifier)) { return false; } if (declaringType.getEnclosingPackage() == accessor.getEnclosingPackage()) { return true; } if (!JModifier.isProtected(modifier)) { return false; } if (!accessor.canBeSafelyUpcast(declaringType)) { return false; } if (JModifier.isStatic(modifier)) { return true; } return accessedVia instanceof JReferenceType && ((JReferenceType) accessedVia).canBeSafelyUpcast(accessor); }
Source:
public Action<?, ?> datalakeFullResoreInProgress() { return new AbstractSdxAction<>(SdxEvent.class) { @Override protected SdxContext createFlowContext(FlowParameters flowParameters, StateContext<FlowState, FlowEvent> stateContext, SdxEvent payload) { return SdxContext.from(flowParameters, payload); } @Override protected void doExecute(SdxContext context, SdxEvent payload, Map<Object, Object> variables) { LOGGER.info("Full datalake restore is in progress for ", payload.getResourceId()); String operationId = (String) variables.get(OPERATION_ID); sdxDatabaseDrService.updateDatabaseStatusEntry(operationId, SdxOperationStatus.SUCCEEDED, null); sendEvent(context, DatalakeFullRestoreWaitRequest.from(context, operationId)); String restoreId = (String) variables.get(RESTORE_ID); sdxDatabaseDrService.updateDatabaseStatusEntry(operationId, SdxOperationStatus.SUCCEEDED, null); sendEvent(context, DatalakeFullRestoreWaitRequest.from(context, restoreId)); } @Override protected Object getFailurePayload(SdxEvent payload, Optional<SdxContext> flowContext, Exception ex) { return DatalakeDatabaseRestoreFailedEvent.from(payload, ex); } }; }

Target:
public Action<?, ?> datalakeFullResoreInProgress() { return new AbstractSdxAction<>(SdxEvent.class) { @Override protected SdxContext createFlowContext(FlowParameters flowParameters, StateContext<FlowState, FlowEvent> stateContext, SdxEvent payload) { return SdxContext.from(flowParameters, payload); } @Override protected void doExecute(SdxContext context, SdxEvent payload, Map<Object, Object> variables) { LOGGER.info("Full datalake restore is in progress for ", payload.getResourceId()); String operationId = (String) variables.get(OPERATION_ID); String restoreId = (String) variables.get(RESTORE_ID); sdxDatabaseDrService.updateDatabaseStatusEntry(operationId, SdxOperationStatus.SUCCEEDED, null); sendEvent(context, DatalakeFullRestoreWaitRequest.from(context, restoreId)); } @Override protected Object getFailurePayload(SdxEvent payload, Optional<SdxContext> flowContext, Exception ex) { return DatalakeDatabaseRestoreFailedEvent.from(payload, ex); } }; }
Source:
public Attribute<?> getAttribute() throws OseeCoreException { Attribute<?> attribute = null; Collection<Attribute<Object>> localAttributes = getArtifact().getAttributes(getAttributeType()); for (Attribute<Object> localAttribute : localAttributes) { if (localAttribute.getId() == attrId) { attribute = localAttribute; } } return attribute; }

Target:
public Attribute<?> getAttribute() throws OseeCoreException { return getArtifact().getAttributeById(attrId, false); }
Source:
public static int findOpenPort() { try (ServerSocket socket = new ServerSocket(0)) { return socket.getLocalPort(); } catch (IOException e) { return 3000; } }

Target:
public static int findOpenPort() throws IOException { try (ServerSocket socket = new ServerSocket(0)) { return socket.getLocalPort(); } }
Source:
public void testEquals() { ABCD cp1 = new ABCD(); ABCD cp2 = cp1; assertThat(cp1.equals(cp2), is(true)); }

Target:
public void testEquals() { ABCD cp1 = new ABCD(); ABCD cp2 = new ABCD(); ABCD cp3 = cp1; assertThat(cp1.equals(cp2), is(true)); assertThat(cp1.equals(cp3), is(true)); }
Source:
public void testCellScannerStream() { Set<RowColumnValue> rowCols = new HashSet<>(); Set<RowColumnValue> empty = new HashSet<>(); rowCols.add(new RowColumnValue("r1", new Column("f1", "q1"), "v1")); rowCols.add(new RowColumnValue("r1", new Column("f2", "q3"), "v2")); rowCols.add(new RowColumnValue("r2", new Column("f1", "q1"), "v3")); rowCols.add(new RowColumnValue("r2", new Column("f1", "q2"), "v4")); rowCols.add(new RowColumnValue("r4", new Column("f2", "q5"), "v5")); CellScannerImpl cellScanStream = new CellScannerImpl(rowCols); rowCols.stream().filter(rcv -> rcv.getColumn().getsFamily().equals("f2")) .collect(Collectors.toSet()); cellScanStream.stream().filter(rcv -> rcv.getColumn().getsFamily().equals("f2")) .collect(Collectors.toSet()); Assert.assertNotEquals(empty, cellScanStream.stream().collect(Collectors.toSet())); Assert.assertEquals(rowCols, cellScanStream.stream().collect(Collectors.toSet())); Assert.assertEquals(rowCols.size(), cellScanStream.stream().count()); }

Target:
public void testCellScannerStream() { Set<RowColumnValue> rowCols = new HashSet<>(); Set<RowColumnValue> empty = new HashSet<>(); rowCols.add(new RowColumnValue("r1", new Column("f1", "q1"), "v1")); rowCols.add(new RowColumnValue("r1", new Column("f2", "q3"), "v2")); rowCols.add(new RowColumnValue("r2", new Column("f1", "q1"), "v3")); rowCols.add(new RowColumnValue("r2", new Column("f1", "q2"), "v4")); rowCols.add(new RowColumnValue("r4", new Column("f2", "q5"), "v5")); CellScannerImpl cellScanner = new CellScannerImpl(rowCols); Set<RowColumnValue> expected = rowCols.stream().filter(rcv -> rcv.getColumn().getsFamily().equals("f2")) .collect(Collectors.toSet()); Set<RowColumnValue> actualSubSet = cellScanner.stream().filter(rcv -> rcv.getColumn().getsFamily().equals("f2")) .collect(Collectors.toSet()); Assert.assertNotEquals(empty, actualSubSet); Assert.assertNotEquals(empty, cellScanner.stream().collect(Collectors.toSet())); Assert.assertEquals(rowCols, cellScanner.stream().collect(Collectors.toSet())); Assert.assertEquals(expected, actualSubSet); }
Source:
public static String getSignatureInFormat(final ScriptType scriptType, final String signStr, final String certStr, String messageDigestAlgo, String provider) throws ScriptSignatureException { if ((scriptType == null) || (signStr == null) || signStr.isEmpty() || (certStr == null) || certStr.isEmpty()) throw new ScriptSignatureException("One or more parameters are null or empty"); if ((messageDigestAlgo == null) || messageDigestAlgo.isEmpty() || "default".equalsIgnoreCase(messageDigestAlgo)) messageDigestAlgo = DEFAULT_MESSAGE_DIGEST_ALGO; if ((provider == null) || provider.isEmpty()) provider = DEFAULT_SIGNATURE_PROVIDER; final String LINE_DELIMETER = AbstractCodeFactory.LINE_DELIMITER; final String begin = LINE_DELIMETER + BEGIN_STRING, end = END_STRING + LINE_DELIMETER, signatureParam = "Hash:" + messageDigestAlgo + " Provider:" + provider; final StringBuffer strBuf = new StringBuffer(); strBuf.append(begin); strBuf.append(LINE_DELIMETER); strBuf.append(signatureParam); strBuf.append(LINE_DELIMETER); strBuf.append(LINE_DELIMETER); strBuf.append(signStr); strBuf.append(LINE_DELIMETER); strBuf.append(LINE_DELIMETER); int i = 0; for (final String s : certStr.split("")) { strBuf.append(s); i++; if ((i % 48) == 0) strBuf.append(LINE_DELIMETER); } if ((i % 48) != 0) strBuf.append(LINE_DELIMETER); strBuf.append(LINE_DELIMETER); strBuf.append(end); return strBuf.toString(); }

Target:
public static String getSignatureInFormat(final ScriptType scriptType, final String signStr, final String certStr, String messageDigestAlgo, String provider) throws ScriptSignatureException { if ((scriptType == null) || (signStr == null) || signStr.isEmpty() || (certStr == null) || certStr.isEmpty()) throw new ScriptSignatureException("One or more parameters are null or empty"); if ((messageDigestAlgo == null) || messageDigestAlgo.isEmpty() || "default".equalsIgnoreCase(messageDigestAlgo)) messageDigestAlgo = DEFAULT_MESSAGE_DIGEST_ALGO; if ((provider == null) || provider.isEmpty()) provider = DEFAULT_SIGNATURE_PROVIDER; final String LINE_DELIMETER = AbstractCodeFactory.LINE_DELIMITER; final String begin = AbstractCodeFactory.LINE_DELIMITER + BEGIN_STRING, end = END_STRING + AbstractCodeFactory.LINE_DELIMITER, signatureParam = "Hash:" + messageDigestAlgo + " Provider:" + provider; final StringBuffer strBuf = new StringBuffer(); strBuf.append(begin); strBuf.append(AbstractCodeFactory.LINE_DELIMITER); strBuf.append(signatureParam); strBuf.append(AbstractCodeFactory.LINE_DELIMITER + AbstractCodeFactory.LINE_DELIMITER); strBuf.append(signStr); strBuf.append(AbstractCodeFactory.LINE_DELIMITER + AbstractCodeFactory.LINE_DELIMITER); int i = 0; while (i < (certStr.length() - MAX_LENGTH)) { strBuf.append(certStr.substring(i, i + MAX_LENGTH)); strBuf.append(AbstractCodeFactory.LINE_DELIMITER); i += MAX_LENGTH; } strBuf.append(certStr.substring(i)); if (i != MAX_LENGTH) strBuf.append(AbstractCodeFactory.LINE_DELIMITER); strBuf.append(AbstractCodeFactory.LINE_DELIMITER); strBuf.append(end); return strBuf.toString(); }
Source:
public @Nonnull EnvVars getEnvironment(@Nonnull TaskListener listener) throws IOException, InterruptedException { Computer c = Computer.currentComputer(); Node n = c==null ? null : c.getNode(); EnvVars env = getParent().getEnvironment(n,listener); for (EnvironmentContributor ec : EnvironmentContributor.all().reverseView()) ec.buildEnvironmentFor(this,env,listener); if (!(this instanceof AbstractBuild)) { for (EnvironmentContributingAction a : getActions(EnvironmentContributingAction.class)) { a.buildEnvironment(this, env); } } env.putAll(getCharacteristicEnvVars()); return env; }

Target:
public @Nonnull EnvVars getEnvironment(@Nonnull TaskListener listener) throws IOException, InterruptedException { Computer c = Computer.currentComputer(); Node n = c==null ? null : c.getNode(); EnvVars env = getParent().getEnvironment(n,listener); for (EnvironmentContributor ec : EnvironmentContributor.all().reverseView()) ec.buildEnvironmentFor(this,env,listener); for (EnvironmentContributingAction a : getActions(EnvironmentContributingAction.class)) { a.buildEnvironment(this, env); } env.putAll(getCharacteristicEnvVars()); return env; }
Source:
public void onDroneEvent(DroneInterfaces.DroneEventsType event, Drone drone) { if(event.equals(DroneInterfaces.DroneEventsType.STATE)){ if(drone.getState().isCollisionImminent()){ mPool.play(beepBeep,1f,1f,1,1,1f); }else{ mPool.stop(beepBeep); } } }

Target:
public void onDroneEvent(DroneInterfaces.DroneEventsType event, Drone drone) { if(event == DroneInterfaces.DroneEventsType.STATE){ if(drone.getState().isCollisionImminent()){ mPool.play(beepBeep,1f,1f,1,1,1f); }else{ mPool.stop(beepBeep); } } }