auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ObjectName createName(String type, String domain, String name) { try { ObjectName objectName; Hashtable<String, String> properties = new Hashtable<>(); properties.put("name", name); properties.put("type", type); objectName = new ObjectName(domain, properties); boolean retry = false; if (objectName.isDomainPattern()) { domain = ObjectName.quote(domain); retry = true; } if (objectName.isPropertyValuePattern("name")) { properties.put("name", ObjectName.quote(name)); retry = true; } if (objectName.isPropertyValuePattern("type")) { properties.put("type", ObjectName.quote(type)); retry = true; } if (retry) { objectName = new ObjectName(domain, properties); } return objectName; } catch (MalformedObjectNameException e) { try { return new ObjectName(domain, "name", ObjectName.quote(name)); } catch (MalformedObjectNameException e1) { LOGGER.warn("Unable to register {}", type, name, e1); throw new RuntimeException(e1); } } }

Target:
public ObjectName createName(String type, String domain, String name) { try { ObjectName objectName; Hashtable<String, String> properties = new Hashtable<>(); properties.put("name", name); properties.put("type", type); objectName = new ObjectName(domain, properties); if (objectName.isDomainPattern()) { domain = ObjectName.quote(domain); } if (objectName.isPropertyValuePattern("name")) { properties.put("name", ObjectName.quote(name)); } if (objectName.isPropertyValuePattern("type")) { properties.put("type", ObjectName.quote(type)); } objectName = new ObjectName(domain, properties); return objectName; } catch (MalformedObjectNameException e) { try { return new ObjectName(domain, "name", ObjectName.quote(name)); } catch (MalformedObjectNameException e1) { LOGGER.warn("Unable to register {}", type, name, e1); throw new RuntimeException(e1); } } }
Source:
public TabModelProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider) { this.eventBus = eventBus; this.popupHandler = new ModelBoundPopupHandler<M>(this, eventBus); this.popupHandler.setDefaultConfirmPopupProvider(defaultConfirmPopupProvider); eventBus.addHandler(UiCommonInitEvent.getType(), new UiCommonInitHandler() { @Override public void onUiCommonInit(UiCommonInitEvent event) { TabModelProvider.this.onCommonModelChange(); } }); eventBus.addHandler(CleanupModelEvent.getType(), new CleanupModelEvent.CleanupModelHandler() { @Override public void onCleanupModel(CleanupModelEvent event) { if (getCommonModel() != null && getModel() != null) { getModel().setEventBus(null); } } }); }

Target:
public TabModelProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider) { this.eventBus = eventBus; this.popupHandler = new ModelBoundPopupHandler<M>(this, eventBus); this.popupHandler.setDefaultConfirmPopupProvider(defaultConfirmPopupProvider); eventBus.addHandler(UiCommonInitEvent.getType(), new UiCommonInitHandler() { @Override public void onUiCommonInit(UiCommonInitEvent event) { TabModelProvider.this.onCommonModelChange(); } }); eventBus.addHandler(CleanupModelEvent.getType(), new CleanupModelEvent.CleanupModelHandler() { @Override public void onCleanupModel(CleanupModelEvent event) { if (hasModel()) { getModel().setEventBus(null); } } }); }
Source:
public void start() { try { if (!stateMachine.transitionToRunning()) { return; } ListenableFuture<?> future = task.execute(statement, transactionManager, metadata, accessControl, stateMachine, parameters); Futures.addCallback(future, new FutureCallback<Object>() { @Override public void onSuccess(@Nullable Object result) { stateMachine.transitionToFinishing(); } @Override public void onFailure(Throwable throwable) { fail(throwable); } }); } catch (Throwable e) { fail(e); if (!(e instanceof RuntimeException)) { throw e; } } }

Target:
public void start() { try { if (!stateMachine.transitionToRunning()) { return; } ListenableFuture<?> future = task.execute(statement, transactionManager, metadata, accessControl, stateMachine, parameters); Futures.addCallback(future, new FutureCallback<Object>() { @Override public void onSuccess(@Nullable Object result) { stateMachine.transitionToFinishing(); } @Override public void onFailure(Throwable throwable) { fail(throwable); } }); } catch (Throwable e) { fail(e); throwIfInstanceOf(e, Error.class); } }
Source:
public void added(Provider<E> provider, E element) { elementWriteLock.lock(); try { final Collection<E> providerElements = providerToElements.get(provider); if (providerElements == null) { logger.warn("Cannot add an element should added for an unknown provider."); return; } if (!added(provider, element, providerElements)) { return; } } finally { elementWriteLock.unlock(); } notifyListenersAboutAddedElement(element); }

Target:
public void added(Provider<E> provider, E element) { elementWriteLock.lock(); try { final Collection<E> providerElements = providerToElements.get(provider); if (providerElements == null) { logger.warn("Cannot add \"{}\" with key \"{}\". Provider \"{}\" unknown.", element.getClass().getSimpleName(), element.getUID(), provider.getClass().getSimpleName()); return; } if (!added(provider, element, providerElements)) { return; } } finally { elementWriteLock.unlock(); } notifyListenersAboutAddedElement(element); }
Source:
private void cleanupExpiredInFlightRequests() { Iterator<Map.Entry<Integer, ChunkPutRequestInfo>> inFlightRequestsIterator = correlationIdToChunkPutRequestInfo.entrySet().iterator(); while (inFlightRequestsIterator.hasNext()) { Map.Entry<Integer, ChunkPutRequestInfo> entry = inFlightRequestsIterator.next(); if (time.milliseconds() - entry.getValue().getStartTimeMs() > routerConfig.routerRequestTimeoutMs) { operationTracker.onResponse(entry.getValue().replicaId, false); chunkException = new RouterException("Timed out waiting for responses", RouterErrorCode.OperationTimedOut); ReplicaId replica = entry.getValue().replicaId; DataNodeId dataNodeId = replica.getDataNodeId(); NonBlockingRouterMetrics.NodeLevelMetrics dataNodeBasedMetrics = routerMetrics.getDataNodeBasedMetrics(dataNodeId); dataNodeBasedMetrics.putRequestTimeoutCount.inc(); dataNodeBasedMetrics.putRequestErrorCount.inc(); dataNodeBasedMetrics.countError(RouterErrorCode.OperationTimedOut); inFlightRequestsIterator.remove(); } else { break; } } }

Target:
private void cleanupExpiredInFlightRequests() { Iterator<Map.Entry<Integer, ChunkPutRequestInfo>> inFlightRequestsIterator = correlationIdToChunkPutRequestInfo.entrySet().iterator(); while (inFlightRequestsIterator.hasNext()) { Map.Entry<Integer, ChunkPutRequestInfo> entry = inFlightRequestsIterator.next(); if (time.milliseconds() - entry.getValue().startTimeMs > routerConfig.routerRequestTimeoutMs) { operationTracker.onResponse(entry.getValue().replicaId, false); chunkException = new RouterException("Timed out waiting for responses", RouterErrorCode.OperationTimedOut); NonBlockingRouterMetrics.NodeLevelMetrics dataNodeBasedMetrics = routerMetrics.getDataNodeBasedMetrics(entry.getValue().replicaId.getDataNodeId()); dataNodeBasedMetrics.putRequestErrorCount.inc(); inFlightRequestsIterator.remove(); } else { break; } } }
Source:
@Override public void perform() { if (input != parent.getInput(i)) { input = (CascadeRelSubset) parent.getInput(i); tasks.push(this); tasks.push( new OptimizeGroup(input, upper, !(parent instanceof AbstractConverter))); return; } if (context == null) { return; } RelOptCost winner = input.getWinner(); if (winner == null) { context.lowerBoundSum = infCost; return; } if (context.lowerBoundSum != null && context.lowerBoundSum != infCost) { context.lowerBoundSum = context. lowerBoundSum.minus(context.lowerBounds.get(i)); context.lowerBoundSum = context.lowerBoundSum.plus(winner); context.lowerBounds.set(i, winner); } }

Target:
@Override public void perform() { if (input != parent.getInput(i)) { input = (CascadeRelSubset) parent.getInput(i); tasks.push(this); tasks.push( new OptimizeGroup(input, upper, !(parent instanceof AbstractConverter))); return; } if (context == null) { return; } RelOptCost winner = input.getWinnerCost(); if (winner == null) { context.lowerBoundSum = infCost; return; } if (context.lowerBoundSum != null && context.lowerBoundSum != infCost) { context.lowerBoundSum = context. lowerBoundSum.minus(context.lowerBounds.get(i)); context.lowerBoundSum = context.lowerBoundSum.plus(winner); context.lowerBounds.set(i, winner); } }
Source:
public WebDriver switchToWindowWithTitle(String title) { PageObjectLogging.log("Switching windows", "Switching to window with title: " + title, true); return driver.switchTo().window(getTabWithTitle(title)); }

Target:
public WebDriver switchToWindowWithTitle(String title) { PageObjectLogging.log("Switching windows", String.format("Switching to window with title: %s", title), true); return driver.switchTo().window(getTabWithTitle(title)); }
Source:
private AdminSearchPageData putFeedbackSessionLinkIntoMap(List<StudentAttributes> students, AdminSearchPageData data){ Logic logic = new Logic(); for(StudentAttributes student : students){ List<FeedbackSessionAttributes> feedbackSessions = logic.getFeedbackSessionsForCourse(student.course); for(FeedbackSessionAttributes fsa : feedbackSessions){ if(!fsa.isOpened()){ continue; } String submitUrl = new Url(Config.APP_URL + Const.ActionURIs.STUDENT_FEEDBACK_SUBMISSION_EDIT_PAGE) .withCourseId(student.course) .withSessionName(fsa.feedbackSessionName) .withRegistrationKey(StringHelper.encrypt(student.key)) .withStudentEmail(student.email) .toString(); if (data.studentfeedbackSessionLinksMap.get(student.getIdentificationString()) == null){ List<String> submitUtlList = new ArrayList<String>(); submitUtlList.add(submitUrl); data.studentfeedbackSessionLinksMap.put(student.getIdentificationString(), submitUtlList); } else { data.studentfeedbackSessionLinksMap.get(student.getIdentificationString()).add(submitUrl); } data.feedbackSeesionLinkToNameMap.put(submitUrl, fsa.feedbackSessionName); } } return data; }

Target:
private AdminSearchPageData putFeedbackSessionLinkIntoMap(List<StudentAttributes> students, AdminSearchPageData data){ Logic logic = new Logic(); for(StudentAttributes student : students){ List<FeedbackSessionAttributes> feedbackSessions = logic.getFeedbackSessionsForCourse(student.course); for(FeedbackSessionAttributes fsa : feedbackSessions){ data = extractDataFromFeedbackSeesion(fsa, data, student); } } return data; }
Source:
public List<HostAddress> getPreferredNodes(List<HostAddress> sortedCandidates) { if (getNodeSelectionStrategy() == SOFT_AFFINITY) { return ImmutableList.of(sortedCandidates.get(abs(path.hashCode() % sortedCandidates.size()))); } return addresses; }

Target:
public List<HostAddress> getPreferredNodes(List<HostAddress> sortedCandidates) { if (sortedCandidates == null || sortedCandidates.isEmpty()) { throw new RuntimeException("sortedCandidates is null or empty for HiveSplit"); } if (getNodeSelectionStrategy() == SOFT_AFFINITY) { return ImmutableList.of( sortedCandidates.get(path.hashCode() % sortedCandidates.size()), sortedCandidates.get((path.hashCode() + 1) % sortedCandidates.size())); } return addresses; }
Source:
TcpClientChannel(ClientChannelConfiguration cfg) throws ClientConnectionException, ClientAuthenticationException { validateConfiguration(cfg); try { sock = createSocket(cfg); out = sock.getOutputStream(); in = sock.getInputStream(); GridUnsafeDataInput dis = new GridUnsafeDataInput(); dis.inputStream(in); dataInput = dis; } catch (IOException e) { throw new ClientConnectionException(e); } handshake(cfg.getUserName(), cfg.getUserPassword()); }

Target:
TcpClientChannel(ClientChannelConfiguration cfg) throws ClientConnectionException, ClientAuthenticationException { validateConfiguration(cfg); try { sock = createSocket(cfg); out = sock.getOutputStream(); in = sock.getInputStream(); GridUnsafeDataInput dis = new GridUnsafeDataInput(); dis.inputStream(in); dataInput = dis; } catch (IOException e) { throw handleIOError("addr=" + cfg.getAddress(), e); } handshake(cfg.getUserName(), cfg.getUserPassword()); }
Source:
public void verseEight() { String expected = "This is the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built."; int verse = 8; assertEquals(expected, house.verse(verse)); }

Target:
public void verseEight() { String expected = "This is the man all tattered and torn\n" + "that kissed the maiden all forlorn\n" + "that milked the cow with the crumpled horn\n" + "that tossed the dog\n" + "that worried the cat\n" + "that killed the rat\n" + "that ate the malt\n" + "that lay in the house that Jack built."; int verse = 8; assertEquals(expected, house.verse(verse)); }
Source:
public static Pair<Set<String>, Set<String>> determineProblematicNics(List<VdsNetworkInterface> interfaces, List<Network> clusterNetworks) { Set<String> networks = new HashSet<String>(); Set<String> brokenNics = new HashSet<String>(); Map<String, Network> networksByName = NetworkUtils.networksByName(clusterNetworks); for (VdsNetworkInterface iface : interfaces) { if (isRequiredInterfaceDown(networksByName, interfaces, iface)) { brokenNics.add(NetworkUtils.stripVlan(iface)); networks.add(iface.getNetworkName()); } } return new Pair<Set<String>, Set<String>>(brokenNics, networks); }

Target:
public static Map<String, Set<String>> determineProblematicNics(List<VdsNetworkInterface> interfaces, List<Network> clusterNetworks) { Map<String, Set<String>> brokenNicsToNetworks = new HashMap<String, Set<String>>(); Map<String, Network> networksByName = NetworkUtils.networksByName(clusterNetworks); for (VdsNetworkInterface iface : interfaces) { if (isRequiredInterfaceDown(networksByName, interfaces, iface)) { String baseNicName = NetworkUtils.stripVlan(iface); Set<String> networks = brokenNicsToNetworks.get(baseNicName); if (networks == null) { networks = new HashSet<String>(); brokenNicsToNetworks.put(baseNicName, networks); } networks.add(iface.getNetworkName()); } } return brokenNicsToNetworks; }
Source:
public void destroyBlockingChannel(BlockingChannel blockingChannel) { rwlock.readLock().lock(); try { boolean changed = blockingChannelActiveConnections.remove(blockingChannel); if (!changed) { logger.error("Invalid connection being destroyed. " + "Channel does not belong to this queue. queue host port channel host port {}", host, port, blockingChannel.getRemoteHost(), blockingChannel.getRemotePort()); throw new IllegalArgumentException("Invalid connection. Channel does not belong to this queue"); } blockingChannel.disconnect(); BlockingChannel channel = null; if (portType == PortType.PLAINTEXT) { channel = new BlockingChannel(blockingChannel.getRemoteHost(), blockingChannel.getRemotePort(), config.connectionPoolReadBufferSizeBytes, config.connectionPoolWriteBufferSizeBytes, config.connectionPoolReadTimeoutMs, config.connectionPoolConnectTimeoutMs); } else if (portType == PortType.SSL) { channel = new SSLBlockingChannel(blockingChannel.getRemoteHost(), blockingChannel.getRemotePort(), config.connectionPoolReadBufferSizeBytes, config.connectionPoolWriteBufferSizeBytes, config.connectionPoolReadTimeoutMs, config.connectionPoolConnectTimeoutMs); } channel.connect(); logger.trace("Destroying connection and adding new connection for host port {}", host, port); blockingChannelAvailableConnections.add(channel); } catch (Exception e) { logger .error("Connection failure to remote host and port when destroying and recreating the connection", host, port); synchronized (lock) { numberOfConnections.decrementAndGet(); } } finally { rwlock.readLock().unlock(); } }

Target:
public void destroyBlockingChannel(BlockingChannel blockingChannel) { rwlock.readLock().lock(); try { boolean changed = blockingChannelActiveConnections.remove(blockingChannel); if (!changed) { logger.error("Invalid connection being destroyed. " + "Channel does not belong to this queue. queue host port channel host port {}", host, port.getPort(), blockingChannel.getRemoteHost(), blockingChannel.getRemotePort()); throw new IllegalArgumentException("Invalid connection. Channel does not belong to this queue"); } blockingChannel.disconnect(); BlockingChannel channel = getBlockingChannelBasedOnPortType(blockingChannel.getRemoteHost(), blockingChannel.getRemotePort()); channel.connect(); logger.trace("Destroying connection and adding new connection for host port {}", host, port.getPort()); blockingChannelAvailableConnections.add(channel); } catch (Exception e) { logger .error("Connection failure to remote host and port when destroying and recreating the connection", host, port.getPort()); synchronized (lock) { numberOfConnections.decrementAndGet(); } } finally { rwlock.readLock().unlock(); } }
Source:
public ProfileGenericDataAsyncResponse getProfileGenericData( @OrganisationIdentification final String organisationIdentification, @RequestPayload final ProfileGenericDataRequest request, @MessagePriority final String messagePriority, @ResponseUrl final String responseUrl, @ScheduleTime final String scheduleTime) throws OsgpException { LOGGER.debug("Incoming ProfileGenericDataRequest for meter: {}.", request.getDeviceIdentification()); ProfileGenericDataAsyncResponse response = null; try { final com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest dataRequest = this.monitoringMapper .map(request, com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest.class); int msgPrio = MessagePriorityEnum.getMessagePriority(messagePriority); final String correlationUid = this.monitoringService.enqueueProfileGenericDataRequestData( organisationIdentification, request.getDeviceIdentification(), dataRequest, msgPrio, this.monitoringMapper.map(scheduleTime, Long.class)); response = new ProfileGenericDataAsyncResponse(); response.setCorrelationUid(correlationUid); response.setDeviceIdentification(request.getDeviceIdentification()); this.responseUrlService.saveResponseUrlIfNeeded(correlationUid, responseUrl); } catch (final Exception e) { LOGGER.error("Exception: while requesting meter reads for device: for organisation {}.", new Object[] { e.getMessage(), request.getDeviceIdentification(), organisationIdentification }, e); this.handleException(e); } return response; }

Target:
public ProfileGenericDataAsyncResponse getProfileGenericData( @OrganisationIdentification final String organisationIdentification, @RequestPayload final ProfileGenericDataRequest request, @MessagePriority final String messagePriority, @ResponseUrl final String responseUrl, @ScheduleTime final String scheduleTime) throws OsgpException { LOGGER.debug("Incoming ProfileGenericDataRequest for meter: {}.", request.getDeviceIdentification()); ProfileGenericDataAsyncResponse response = null; try { final com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest dataRequest = this.monitoringMapper .map(request, com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataRequest.class); int msgPrio = MessagePriorityEnum.getMessagePriority(messagePriority); final String correlationUid = this.monitoringService.enqueueProfileGenericDataRequestData( organisationIdentification, request.getDeviceIdentification(), dataRequest, msgPrio, this.monitoringMapper.map(scheduleTime, Long.class)); response = new ProfileGenericDataAsyncResponse(); response.setCorrelationUid(correlationUid); response.setDeviceIdentification(request.getDeviceIdentification()); this.responseUrlService.saveResponseUrlIfNeeded(correlationUid, responseUrl); } catch (final Exception e) { LOGGER.error("Exception: while requesting profile generic data for device: for organisation {}.", new Object[] { e.getMessage(), request.getDeviceIdentification(), organisationIdentification }, e); this.handleException(e); } return response; }
Source:
public static String getDefaultEthDevice() { if (SystemUtils.IS_OS_MAC) { final String defDev = Script.runSimpleBashScript("/sbin/route -n get default 2> /dev/null | grep interface | awk '{print $2}'"); return defDev; } return Script.runSimpleBashScript("ip route | grep default | head -1 | grep -Po '(?<=dev )(\\S+)'"); }

Target:
public static String getDefaultEthDevice() { if (SystemUtils.IS_OS_MAC) { final String defDev = Script.runSimpleBashScript("/sbin/route -n get default 2> /dev/null | grep interface | awk '{print $2}'"); return defDev; } return Script.runSimpleBashScript("ip route show default 0.0.0.0/0 | head -1 | awk '{print $5}'"); }
Source:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (node.isInterface()) { return data; } boolean classHasLombok = hasLombokAnnotation(node); Map<MethodNameDeclaration, List<NameOccurrence>> methods = node.getScope().getEnclosingScope(ClassScope.class) .getMethodDeclarations(); List<ASTMethodDeclarator> getSetMethList = new ArrayList<>(methods.size()); for (MethodNameDeclaration d : methods.keySet()) { ASTMethodDeclarator mnd = d.getMethodNameDeclaratorNode(); if (isBeanAccessor(mnd)) { getSetMethList.add(mnd); } } String[] methNameArray = imagesOf(getSetMethList); Arrays.sort(methNameArray); Map<VariableNameDeclaration, List<NameOccurrence>> vars = node.getScope() .getDeclarations(VariableNameDeclaration.class); for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { VariableNameDeclaration decl = entry.getKey(); AccessNode accessNodeParent = decl.getAccessNodeParent(); if (entry.getValue().isEmpty() || accessNodeParent.isTransient() || accessNodeParent.isStatic() || classHasLombok || hasIgnoredAnnotation((Annotatable) accessNodeParent)) { continue; } String varName = StringUtils.capitalize(trimIfPrefix(decl.getImage())); boolean hasGetMethod = Arrays.binarySearch(methNameArray, "get" + varName) >= 0 || Arrays.binarySearch(methNameArray, "is" + varName) >= 0; boolean hasSetMethod = Arrays.binarySearch(methNameArray, "set" + varName) >= 0; if (!hasGetMethod || !accessNodeParent.isFinal() && !hasSetMethod) { addViolation(data, decl.getNode(), decl.getImage()); } } return super.visit(node, data); }

Target:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (node.isInterface()) { return data; } if (hasLombokAnnotation(node)) { return super.visit(node, data); } Map<MethodNameDeclaration, List<NameOccurrence>> methods = node.getScope().getEnclosingScope(ClassScope.class) .getMethodDeclarations(); List<ASTMethodDeclarator> getSetMethList = new ArrayList<>(methods.size()); for (MethodNameDeclaration d : methods.keySet()) { ASTMethodDeclarator mnd = d.getMethodNameDeclaratorNode(); if (isBeanAccessor(mnd)) { getSetMethList.add(mnd); } } String[] methNameArray = imagesOf(getSetMethList); Arrays.sort(methNameArray); Map<VariableNameDeclaration, List<NameOccurrence>> vars = node.getScope() .getDeclarations(VariableNameDeclaration.class); for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { VariableNameDeclaration decl = entry.getKey(); AccessNode accessNodeParent = decl.getAccessNodeParent(); if (entry.getValue().isEmpty() || accessNodeParent.isTransient() || accessNodeParent.isStatic() || hasIgnoredAnnotation((Annotatable) accessNodeParent)) { continue; } String varName = StringUtils.capitalize(trimIfPrefix(decl.getImage())); boolean hasGetMethod = Arrays.binarySearch(methNameArray, "get" + varName) >= 0 || Arrays.binarySearch(methNameArray, "is" + varName) >= 0; boolean hasSetMethod = Arrays.binarySearch(methNameArray, "set" + varName) >= 0; if (!hasGetMethod || !accessNodeParent.isFinal() && !hasSetMethod) { addViolation(data, decl.getNode(), decl.getImage()); } } return super.visit(node, data); }
Source:
public void testDecorate() throws Exception { final Language baseLanguage = new LanguageDataGen().languageCode("it").countryCode(null).nextPersisted(); final Language itLanguage = new LanguageDataGen().languageCode("it").countryCode("IT").nextPersisted(); final long expectedBaseId = baseLanguage.getId(); final long expectedItalyId = itLanguage.getId(); final LanguageIdParameterDecorator languageIdParameterDecorator = new LanguageIdParameterDecorator(); final long languageId1 = Long.parseLong(new CachedParameterDecorator(languageIdParameterDecorator).decorate("it_IT")); final long languageId2 = Long.parseLong(new CachedParameterDecorator(languageIdParameterDecorator).decorate("it")); Assert.assertEquals(expectedItalyId, languageId1); Assert.assertEquals(expectedBaseId, languageId2); APILocator.getLanguageAPI().deleteLanguage(baseLanguage); APILocator.getLanguageAPI().deleteLanguage(itLanguage); }

Target:
public void testDecorate() throws Exception { final String[] languageCodes = Locale.getISOLanguages(); final int languageIndex = new Random().nextInt(languageCodes.length); final String languageCode = languageCodes[languageIndex]; final Language baseLanguage = new LanguageDataGen().languageCode(languageCode).countryCode(null).nextPersisted(); final Language itLanguage = new LanguageDataGen().languageCode(languageCode).countryCode("IT").nextPersisted(); final long expectedBaseId = baseLanguage.getId(); final long expectedItalyId = itLanguage.getId(); final LanguageIdParameterDecorator languageIdParameterDecorator = new LanguageIdParameterDecorator(); final long languageId1 = Long.parseLong(new CachedParameterDecorator(languageIdParameterDecorator).decorate(languageCode + "_IT")); final long languageId2 = Long.parseLong(new CachedParameterDecorator(languageIdParameterDecorator).decorate(languageCode)); Assert.assertEquals(expectedItalyId, languageId1); Assert.assertEquals(expectedBaseId, languageId2); }
Source:
public void setRun(Run run) { if (runs.size() < 2) { runs.add(run); } else { throw new IllegalArgumentException("Cannot add more than one run to a container!"); } }

Target:
public void setRun(Run run) { if (run != null && runs.size() > 1) { throw new IllegalArgumentException("Cannot set single run on a container with multiple runs already linked!"); } else { runs = new ArrayList<>(); if (run != null) runs.add(run); } }
Source:
public StyledString getStyledText(Object element) { String text = super.getText(element); if (text.isEmpty()) { return new StyledString(text); } for (int i = 0; i < fdisabledModels.length; i++) { if (((IPluginModelBase) element).equals(fdisabledModels[i])) { return new StyledString(text, StyledString.DECORATIONS_STYLER); } } return new StyledString(text); }

Target:
public StyledString getStyledText(Object element) { String text = super.getText(element); if (text.isEmpty()) { return new StyledString(text); } if (fdisabledModels != null && fdisabledModels.contains(element)) { return new StyledString(text, StyledString.DECORATIONS_STYLER) .append(new StyledString(" (already included as a dependency)", StyledString.COUNTER_STYLER)); } return new StyledString(text); }
Source:
protected void writeVarBinding( VarBinding binding) { writer_.writeElement( VAR_TAG, MapBuilder.of( NAME_ATR, binding.getVar()).put( VALUE_ATR, String.valueOf( binding.getValue())).build()); }

Target:
protected void writeVarBinding( VarBinding binding) { writer_ .element( VAR_TAG) .attribute( NAME_ATR, binding.getVar()) .attribute( VALUE_ATR, String.valueOf( binding.getValue())) .write(); }
Source:
public Block readBlock() throws IOException { if (!rowGroupOpen) { openRowGroup(); } if (readOffset > 0) { if (presentStream != null) { readOffset = presentStream.countBitsSet(readOffset); } if (readOffset > 0) { if (dataStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is missing"); } dataStream.skip(readOffset); } } Block block; if (dataStream == null) { if (presentStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is null but present stream is missing"); } presentStream.skip(nextBatchSize); block = RunLengthEncodedBlock.create(DOUBLE, null, nextBatchSize); } else if (presentStream == null) { block = readNonNullBlock(); } else { boolean[] isNull = new boolean[nextBatchSize]; int nullCount = presentStream.getUnsetBits(nextBatchSize, isNull); if (nullCount == 0) { block = readNonNullBlock(); } else if (nullCount != nextBatchSize) { block = readNullBlock(isNull, nextBatchSize - nullCount); } else { block = readNullBlock(isNull, nextBatchSize - nullCount); } } readOffset = 0; nextBatchSize = 0; return block; }

Target:
public Block readBlock() throws IOException { if (!rowGroupOpen) { openRowGroup(); } if (readOffset > 0) { if (presentStream != null) { readOffset = presentStream.countBitsSet(readOffset); } if (readOffset > 0) { if (dataStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is missing"); } dataStream.skip(readOffset); } } Block block; if (dataStream == null) { if (presentStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is null but present stream is missing"); } presentStream.skip(nextBatchSize); block = RunLengthEncodedBlock.create(DOUBLE, null, nextBatchSize); } else if (presentStream == null) { block = readNonNullBlock(); } else { boolean[] isNull = new boolean[nextBatchSize]; int nullCount = presentStream.getUnsetBits(nextBatchSize, isNull); if (nullCount == 0) { block = readNonNullBlock(); } else if (nullCount != nextBatchSize) { block = readNullBlock(isNull, nextBatchSize - nullCount); } else { block = RunLengthEncodedBlock.create(DOUBLE, null, nextBatchSize); } } readOffset = 0; nextBatchSize = 0; return block; }
Source:
Config config() { if (atlasConfig == null) { if (config == null) { LOGGER.warn("no archaius2 binding found"); } atlasConfig = NetflixConfig.createConfig(config); } return atlasConfig; }

Target:
Config config() { if (atlasConfig == null) { atlasConfig = NetflixConfig.createConfig(config); } return atlasConfig; }
Source:
public FunctionInfo(String name, Type signature) { this.name = name; this.signature = signature; this.requiredBlocks = Collections.EMPTY_LIST; }

Target:
public FunctionInfo(String name, Type signature) { this(name, signature, Collections.EMPTY_LIST); }
Source:
static Mets readUriToMets(URI xmlFile) throws JAXBException, IOException { FileManagementInterface fileManagementModule = new KitodoServiceLoader<FileManagementInterface>( FileManagementInterface.class).loadModule(); if (fileManagementModule.fileExist(xmlFile)) { JAXBContext jaxbMetsContext = JAXBContext.newInstance(Mets.class); Unmarshaller jaxbUnmarshaller = jaxbMetsContext.createUnmarshaller(); return (Mets) jaxbUnmarshaller.unmarshal(fileManagementModule.getFile(xmlFile)); } else { throw new IOException("File was not found: " + xmlFile.getPath()); } }

Target:
static Mets readUriToMets(URI xmlFile) throws JAXBException, IOException { FileManagementInterface fileManagementModule = new KitodoServiceLoader<FileManagementInterface>( FileManagementInterface.class).loadModule(); if (fileManagementModule.fileExist(xmlFile)) { JAXBContext jaxbMetsContext = JAXBContext.newInstance(Mets.class); Unmarshaller jaxbUnmarshaller = jaxbMetsContext.createUnmarshaller(); try (InputStream inputStream = fileManagementModule.read(xmlFile)) { return (Mets) jaxbUnmarshaller.unmarshal(inputStream); } } else { throw new IOException("File was not found: " + xmlFile.getPath()); } }
Source:
static void registerOperations(ManagementResourceRegistration registry, ResourceDescriptionResolver resourceDescriptionResolver) { registry.registerOperationHandler(new SimpleOperationDefinitionBuilder("migrate", resourceDescriptionResolver) .setParameters(ADD_LEGACY_ENTRIES, DRY_RUN) .setRuntimeOnly() .setReplyValueType(ModelType.BOOLEAN) .setAccessConstraints(SensitiveTargetAccessConstraintDefinition.READ_WHOLE_CONFIG) .build(), MigrateOperation.MIGRATE_INSTANCE); registry.registerOperationHandler(new SimpleOperationDefinitionBuilder("describe-migration", resourceDescriptionResolver) .addParameter(ADD_LEGACY_ENTRIES) .setRuntimeOnly() .setAccessConstraints(SensitiveTargetAccessConstraintDefinition.READ_WHOLE_CONFIG) .build(), MigrateOperation.DESCRIBE_MIGRATION_INSTANCE); }

Target:
static void registerOperations(ManagementResourceRegistration registry, ResourceDescriptionResolver resourceDescriptionResolver) { registry.registerOperationHandler(new SimpleOperationDefinitionBuilder("migrate", resourceDescriptionResolver) .setParameters(ADD_LEGACY_ENTRIES) .setRuntimeOnly() .setAccessConstraints(SensitiveTargetAccessConstraintDefinition.READ_WHOLE_CONFIG) .build(), MigrateOperation.MIGRATE_INSTANCE); registry.registerOperationHandler(new SimpleOperationDefinitionBuilder("describe-migration", resourceDescriptionResolver) .addParameter(ADD_LEGACY_ENTRIES) .setReplyType(ModelType.LIST).setReplyValueType(ModelType.OBJECT) .setRuntimeOnly() .setAccessConstraints(SensitiveTargetAccessConstraintDefinition.READ_WHOLE_CONFIG) .build(), MigrateOperation.DESCRIBE_MIGRATION_INSTANCE); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VdsStatistics other = (VdsStatistics) obj; return (ObjectUtils.objectsEqual(id, other.id) && ObjectUtils.bigDecimalEqual(cpu_idle, other.cpu_idle) && ObjectUtils.bigDecimalEqual(cpu_load, other.cpu_load) && ObjectUtils.bigDecimalEqual(cpu_sys, other.cpu_sys) && ObjectUtils.bigDecimalEqual(cpu_user, other.cpu_user) && ObjectUtils.objectsEqual(mem_available, other.mem_available) && ObjectUtils.objectsEqual(memFree, other.memFree) && ObjectUtils.objectsEqual(mem_shared, other.mem_shared) && ObjectUtils.objectsEqual(usage_cpu_percent, other.usage_cpu_percent) && ObjectUtils.objectsEqual(usage_network_percent, other.usage_network_percent) && ObjectUtils.objectsEqual(ksm_state, other.ksm_state) && ObjectUtils.objectsEqual(ksm_pages, other.ksm_pages) && ObjectUtils.objectsEqual(ksm_cpu_percent, other.ksm_cpu_percent) && ObjectUtils.objectsEqual(swap_total, other.swap_total) && ObjectUtils.objectsEqual(swap_free, other.swap_free) && (anonymousHugePages == other.anonymousHugePages) && (highlyAvailableScore == other.highlyAvailableScore) && (highlyAvailableIsConfigured == other.highlyAvailableIsConfigured) && (highlyAvailableIsActive == other.highlyAvailableIsActive) && (highlyAvailableGlobalMaintenance == other.highlyAvailableGlobalMaintenance) && (highlyAvailableLocalMaintenance == other.highlyAvailableLocalMaintenance)); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VdsStatistics other = (VdsStatistics) obj; return (ObjectUtils.objectsEqual(id, other.id) && ObjectUtils.bigDecimalEqual(cpu_idle, other.cpu_idle) && ObjectUtils.bigDecimalEqual(cpu_load, other.cpu_load) && ObjectUtils.bigDecimalEqual(cpu_sys, other.cpu_sys) && ObjectUtils.bigDecimalEqual(cpu_user, other.cpu_user) && ObjectUtils.objectsEqual(mem_available, other.mem_available) && ObjectUtils.objectsEqual(memFree, other.memFree) && ObjectUtils.objectsEqual(mem_shared, other.mem_shared) && ObjectUtils.objectsEqual(usage_cpu_percent, other.usage_cpu_percent) && ObjectUtils.objectsEqual(usage_network_percent, other.usage_network_percent) && ObjectUtils.objectsEqual(ksm_state, other.ksm_state) && ObjectUtils.objectsEqual(ksm_pages, other.ksm_pages) && ObjectUtils.objectsEqual(ksm_cpu_percent, other.ksm_cpu_percent) && ObjectUtils.objectsEqual(swap_total, other.swap_total) && ObjectUtils.objectsEqual(swap_free, other.swap_free) && (anonymousHugePages == other.anonymousHugePages) && (highlyAvailableScore == other.highlyAvailableScore) && (highlyAvailableIsConfigured == other.highlyAvailableIsConfigured) && (highlyAvailableIsActive == other.highlyAvailableIsActive) && (highlyAvailableGlobalMaintenance == other.highlyAvailableGlobalMaintenance) && (highlyAvailableLocalMaintenance == other.highlyAvailableLocalMaintenance) && uptime == other.uptime); }
Source:
public void testIndicateMissingResponses() { ______TS("Typical case: Hide Missing Responses"); assertEquals(resultsPage.indicateMissingResponsesCheckbox.getAttribute("checked"), "true"); assertFalse(resultsPage.verifyMissingResponsesVisibility()); resultsPage.clickIndicateMissingResponses(); assertEquals(resultsPage.indicateMissingResponsesCheckbox.getAttribute("checked"), null); assertTrue(resultsPage.verifyMissingResponsesVisibility()); resultsPage.clickIndicateMissingResponses(); assertEquals(resultsPage.indicateMissingResponsesCheckbox.getAttribute("checked"), "true"); assertFalse(resultsPage.verifyMissingResponsesVisibility()); }

Target:
public void testIndicateMissingResponses() { ______TS("Typical case: Hide Missing Responses"); assertTrue(resultsPage.indicateMissingResponsesCheckbox.isSelected()); assertFalse(resultsPage.verifyMissingResponsesVisibility()); resultsPage.clickIndicateMissingResponses(); assertFalse(resultsPage.indicateMissingResponsesCheckbox.isSelected()); assertTrue(resultsPage.verifyMissingResponsesVisibility()); resultsPage.clickIndicateMissingResponses(); assertTrue(resultsPage.indicateMissingResponsesCheckbox.isSelected()); assertFalse(resultsPage.verifyMissingResponsesVisibility()); }
Source:
public SessionData(ICrypter crypter) { this.cypter= crypter; }

Target:
public SessionData(ICrypter crypter) { Args.notNull(crypter, "crypter"); this.cypter= crypter; }
Source:
public JsonElement serialize(IncomingTransferAccept src, Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); if (src.error != null) { object.addProperty(MEMBER_ERROR, src.error.code); } else { object.addProperty(MEMBER_STATUS, src.status.code); object.addProperty(MEMBER_CODE_ATTEMPTS, src.protectionCodeAttemptsAvailable); object.addProperty(MEMBER_EXT_ACTION_URI, src.extActionUri); } return object; }

Target:
public JsonElement serialize(IncomingTransferAccept src, Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); object.addProperty(MEMBER_STATUS, src.status.code); if (src.error != null) { object.addProperty(MEMBER_ERROR, src.error.code); } else { object.addProperty(MEMBER_CODE_ATTEMPTS, src.protectionCodeAttemptsAvailable); object.addProperty(MEMBER_EXT_ACTION_URI, src.extActionUri); } return object; }
Source:
public void checkFileSize(File file){ if (FileUtil.isFileToBigToUpload(file)) { long overByAmount = (file.length() - FormUploadUtil.MAX_BYTES) / 1024; notifyWarning(StringUtils.getStringRobust(getContext(), R.string.attachment_to_big_to_upload, overByAmount + "")); } else if (FileUtil.isFileOversized(file)) { notifyWarning(StringUtils.getStringRobust(getContext(), R.string.attachment_oversized, FileUtil.getFileSize(file) + "")); } }

Target:
public void checkFileSize(File file){ if (FileUtil.isFileTooBigToUpload(file)) { long overByAmount = (file.length() - FormUploadUtil.MAX_BYTES) / 1024; notifyWarning(StringUtils.getStringRobust(getContext(), R.string.attachment_to_big_to_upload, overByAmount + "")); } else if (FileUtil.isFileOversized(file)) { notifyWarning(StringUtils.getStringRobust(getContext(), R.string.attachment_oversized, FileUtil.getFileSize(file) + "")); } }
Source:
private void addPoint(Series series, ISegment segment, Map<Integer, Predicate<Map<String, String>>> predicates, @Nullable IProgressMonitor monitor) { if (!predicates.isEmpty()) { Map<@NonNull String, @NonNull String> input = getFilterInput(segment); int mask = 0; for (Map.Entry<Integer, Predicate<Map<String, String>>> mapEntry : predicates.entrySet()) { Predicate<Map<String, String>> value = Objects.requireNonNull(mapEntry.getValue()); boolean status = value.test(input); Integer property = Objects.requireNonNull(mapEntry.getKey()); if(status && property != IFilterProperty.DIMMED) { mask |= property; } else if (!status && property == IFilterProperty.DIMMED) { mask |= IFilterProperty.DIMMED; } else if (!status && property == IFilterProperty.EXCLUDE) { mask |= IFilterProperty.EXCLUDE; } } series.addPoint(segment.getStart(), segment.getLength(), mask); }else { series.addPoint(segment.getStart(), segment.getLength(), 0); } }

Target:
private void addPoint(Series series, ISegment segment, Map<Integer, Predicate<Map<String, String>>> predicates, @Nullable IProgressMonitor monitor) { if (!predicates.isEmpty()) { Map<@NonNull String, @NonNull String> input = getFilterInput(segment); int mask = 0; for (Map.Entry<Integer, Predicate<Map<String, String>>> mapEntry : predicates.entrySet()) { Predicate<Map<String, String>> value = Objects.requireNonNull(mapEntry.getValue()); boolean status = value.test(input); Integer property = Objects.requireNonNull(mapEntry.getKey()); if(status && property != IFilterProperty.DIMMED) { mask |= property; } else if (!status && property == IFilterProperty.DIMMED) { mask |= IFilterProperty.DIMMED; } else if (!status && property == IFilterProperty.EXCLUDE) { mask |= IFilterProperty.EXCLUDE; } else if (status){ mask |= property; } } series.addPoint(segment.getStart(), segment.getLength(), mask); } else { series.addPoint(segment.getStart(), segment.getLength(), 0); } }
Source:
public void testList() throws StripeException { Map<String, Object> listParams = new HashMap<String, Object>(); listParams.put("limit", 1); BalanceTransactionCollection resources = BalanceTransaction.list(listParams); assertNotNull(resources); verifyRequest( APIResource.RequestMethod.GET, String.format("/v1/balance/history") ); }

Target:
public void testList() throws StripeException { final Map<String, Object> params = new HashMap<String, Object>(); params.put("limit", 1); final BalanceTransactionCollection balanceTransactions = BalanceTransaction.list(params); assertNotNull(balanceTransactions); verifyRequest( APIResource.RequestMethod.GET, String.format("/v1/balance/history"), params ); }
Source:
private void checkInsertedValue(String jsonPart1, String jsonPart2) throws DatabaseEngineException { Expression query = select(all()).from(table(TEST_TABLE)); List<Map<String, ResultColumn>> results = dbEngine.query(query); assertEquals("One value inserted", 1, results.size()); Map<String, ResultColumn> firstRow = results.get(0); assertNotNull("Inserted row is not null", firstRow); assertThat("JSon value is as expected", firstRow.get(JSON_COL).toString(), anyOf( is("{" + jsonPart1 + ", " + jsonPart2 + "}"), is("{" + jsonPart2 + ", " + jsonPart1 + "}") )); }

Target:
private void checkInsertedValue(String jsonPart1, String jsonPart2) throws DatabaseEngineException { Expression query = select(all()).from(table(TEST_TABLE)); List<Map<String, ResultColumn>> results = dbEngine.query(query); assertEquals("One value inserted", 1, results.size()); Map<String, ResultColumn> firstRow = results.get(0); assertNotNull("Inserted row is not null", firstRow); assertThat("JSon value is as expected", firstRow.get(JSON_COL).toString().replaceAll("\\s+", ""), anyOf( is(("{" + jsonPart1 + "," + jsonPart2 + "}").replaceAll("\\s+", "")), is(("{" + jsonPart2 + "," + jsonPart1 + "}").replaceAll("\\s+","")) )); }
Source:
public final void toggleExactMatchMilestone(String milestoneName) { Optional<PickerMilestone> onlyMatchingMilestone = getExactMatchMilestone(currentMilestonesList, milestoneName); toggleMilestone(onlyMatchingMilestone); }

Target:
public final void toggleExactMatchMilestone(String milestoneName) { Optional<PickerMilestone> onlyMatchingMilestone = getExactMatchMilestone(currentMilestonesList, milestoneName); onlyMatchingMilestone.ifPresent(milestone -> toggleMilestone(milestone)); }
Source:
protected MappingElasticsearchConverter createElasticsearchConverter() { MappingElasticsearchConverter mappingElasticsearchConverter = new MappingElasticsearchConverter(new SimpleElasticsearchMappingContext()); mappingElasticsearchConverter.afterPropertiesSet(); return mappingElasticsearchConverter; }

Target:
protected ElasticsearchConverter createElasticsearchConverter() { MappingElasticsearchConverter mappingElasticsearchConverter = new MappingElasticsearchConverter( new SimpleElasticsearchMappingContext()); mappingElasticsearchConverter.afterPropertiesSet(); return mappingElasticsearchConverter; }
Source:
public void seek(long toOffset) throws IOException { boolean resetAndSkip = toOffset < offset; if (toOffset < offset) { reset(); } if (toOffset != 0 && toOffset != offset) { maybeInitialize(); data.skip(toOffset - offset); } offset = toOffset; }

Target:
public void seek(long toOffset) throws IOException { if (toOffset < offset) { reset(); } maybeInitialize(); ByteStreams.skipFully(data, toOffset - offset); offset = toOffset; }
Source:
private void checkDirtyAndLoad(final ActionEvent actionEvent) throws HeadlessException { final String selectedTemplate = templateList.getText(); final Template template = TemplateManager.getInstance().getTemplateByName(selectedTemplate); if (template == null) { return; } templateList.setValues(TemplateManager.getInstance().reset().getTemplateNames()); final boolean isTestPlan = template.isTestPlan(); if (isTestPlan && !checkDirty(actionEvent)) { return; } ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.STOP_THREAD)); final File parent = template.getParent(); File fileToCopy = parent != null ? new File(parent, template.getFileName()) : new File(JMeterUtils.getJMeterHome(), template.getFileName()); File temporaryGeneratedFile = null; try { if (template.getParameters() != null && !template.getParameters().isEmpty()) { File jmxFile = new File(fileToCopy.getAbsolutePath()); Map<String, String> userParameters = getUserParameters(); Configuration templateCfg = TemplateUtil.getTemplateConfig(); try { temporaryGeneratedFile = File.createTempFile(template.getName(), ".output"); fileToCopy = temporaryGeneratedFile; TemplateUtil.processTemplate(jmxFile, temporaryGeneratedFile, templateCfg, userParameters); } catch (IOException | TemplateException ex) { log.error("Error generating output file from template {}", temporaryGeneratedFile, jmxFile, ex); return; } } Load.loadProjectFile(actionEvent, fileToCopy, !isTestPlan, false); this.dispose(); } finally { if(temporaryGeneratedFile != null && !temporaryGeneratedFile.delete()) { log.warn("Could not delete generated output file from template {}", temporaryGeneratedFile, fileToCopy); } } }

Target:
private void checkDirtyAndLoad(final ActionEvent actionEvent) throws HeadlessException { final String selectedTemplate = templateList.getText(); final Template template = TemplateManager.getInstance().getTemplateByName(selectedTemplate); if (template == null) { return; } templateList.setValues(TemplateManager.getInstance().reset().getTemplateNames()); final boolean isTestPlan = template.isTestPlan(); if (isTestPlan && !checkDirty(actionEvent)) { return; } ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.STOP_THREAD)); final File parent = template.getParent(); File fileToCopy = parent != null ? new File(parent, template.getFileName()) : new File(JMeterUtils.getJMeterHome(), template.getFileName()); replaceTemplateParametersAndLoad(actionEvent, template, isTestPlan, fileToCopy); }
Source:
public List<Descriptor<ComputerLauncher>> computerLauncherDescriptors(@CheckForNull Slave it) { DescriptorExtensionList<ComputerLauncher, Descriptor<ComputerLauncher>> all = Jenkins.getInstance().<ComputerLauncher, Descriptor<ComputerLauncher>>getDescriptorList( ComputerLauncher.class); return it == null ? DescriptorVisibilityFilter.applyType(clazz, all) : DescriptorVisibilityFilter.apply(it, all); }

Target:
public final List<Descriptor<ComputerLauncher>> computerLauncherDescriptors(@CheckForNull Slave it) { DescriptorExtensionList<ComputerLauncher, Descriptor<ComputerLauncher>> all = Jenkins.getInstance().<ComputerLauncher, Descriptor<ComputerLauncher>>getDescriptorList( ComputerLauncher.class); return it == null ? DescriptorVisibilityFilter.applyType(clazz, all) : DescriptorVisibilityFilter.apply(it, all); }
Source:
public void init() { super.init(); eventConsumerImpl = new EventConsumerImpl(); ZAP.getEventBus() .registerConsumer( eventConsumerImpl, HistoryReferenceEventPublisher.getPublisher().getPublisherName()); }

Target:
public void init() { super.init(); }