auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getCollaborators_validRepoId_successful() throws IOException { MockServerClient mockServer = ClientAndServer.startClientAndServer(8888); String sampleCollaborators = TestUtils.readFileFromResource(this, "tests/CollaboratorsSample.json"); mockServer.when( request() .withPath(TestUtils.API_PREFIX + "/repos/hubturbo/tests/collaborators") ).respond( response() .withBody(sampleCollaborators) ); GitHubClient client = new GitHubClient("localhost", 8888, "http"); CollaboratorServiceEx service = new CollaboratorServiceEx(client); Type listOfUsers = new TypeToken<List<User>>() {}.getType(); List<User> expectedCollaborators = new Gson().fromJson(sampleCollaborators, listOfUsers); List<User> actualCollaborators = service.getCollaborators(RepositoryId.createFromId("hubturbo/tests")); assertEquals(expectedCollaborators.size(), actualCollaborators.size()); for (int i = 0; i < expectedCollaborators.size(); i++) { assertEquals(expectedCollaborators.get(i).getLogin(), actualCollaborators.get(i).getLogin()); assertEquals(expectedCollaborators.get(i).getName(), actualCollaborators.get(i).getName()); } mockServer.stop(); }

Target:
public void getCollaborators_validRepoId_successful() throws IOException { MockServerClient mockServer = ClientAndServer.startClientAndServer(8888); String sampleCollaborators = TestUtils.readFileFromResource(this, "tests/CollaboratorsSample.json"); mockServer.when( request() .withPath(TestUtils.API_PREFIX + "/repos/hubturbo/tests/collaborators") ).respond( response() .withBody(sampleCollaborators) ); Type listOfUsers = new TypeToken<List<User>>() {}.getType(); List<User> expectedCollaborators = new Gson().fromJson(sampleCollaborators, listOfUsers); List<User> actualCollaborators = service.getCollaborators(RepositoryId.createFromId("hubturbo/tests")); assertEquals(expectedCollaborators.size(), actualCollaborators.size()); for (int i = 0; i < expectedCollaborators.size(); i++) { assertEquals(expectedCollaborators.get(i).getLogin(), actualCollaborators.get(i).getLogin()); assertEquals(expectedCollaborators.get(i).getName(), actualCollaborators.get(i).getName()); assertEquals(true, actualCollaborators.get(i).getName() != null); } mockServer.stop(); }
Source:
Consumer<HttpClientBuilder> zipkinElasticsearchHttpLogging( ZipkinElasticsearchStorageProperties es) { LoggingClientBuilder builder = new LoggingClientBuilder() .requestLogLevel(LogLevel.INFO) .successfulResponseLogLevel(LogLevel.INFO); switch (es.getHttpLogging()) { case HEADERS: builder.contentSanitizer(unused -> ""); break; case BASIC: builder.contentSanitizer(unused -> ""); builder.headersSanitizer(unused -> HttpHeaders.of()); break; case BODY: default: break; } return client -> client.decorator(builder.newDecorator()); }

Target:
Consumer<HttpClientBuilder> zipkinElasticsearchHttpLogging( ZipkinElasticsearchStorageProperties es) { LoggingClientBuilder builder = new LoggingClientBuilder() .requestLogLevel(LogLevel.INFO) .successfulResponseLogLevel(LogLevel.INFO); switch (es.getHttpLogging()) { case HEADERS: builder.contentSanitizer(unused -> ""); break; case BASIC: builder.contentSanitizer(unused -> ""); builder.headersSanitizer(unused -> HttpHeaders.of()); break; case BODY: default: break; } return new Consumer<HttpClientBuilder>() { @Override public void accept(HttpClientBuilder client) { client .decorator(builder.newDecorator()) .decorator( es.getHttpLogging() == ZipkinElasticsearchStorageProperties.HttpLoggingLevel.BODY ? RawContentLoggingClient.newDecorator() : Function.identity()); } @Override public String toString() { return "LoggingCustomizer{httpLogging=" + es.getHttpLogging() + "}"; } }; }
Source:
protected void addNode(final Node<E> nodeToInsert, final Node<E> insertBeforeNode) { Objects.requireNonNull(nodeToInsert,"The new node on insert must not be null."); Objects.requireNonNull(insertBeforeNode,"The node to insert before must not be null."); nodeToInsert.next = insertBeforeNode; nodeToInsert.previous = insertBeforeNode.previous; insertBeforeNode.previous.next = nodeToInsert; insertBeforeNode.previous = nodeToInsert; size++; modCount++; }

Target:
protected void addNode(final Node<E> nodeToInsert, final Node<E> insertBeforeNode) { Objects.requireNonNull(nodeToInsert, "nodeToInsert"); Objects.requireNonNull(insertBeforeNode, "insertBeforeNode"); nodeToInsert.next = insertBeforeNode; nodeToInsert.previous = insertBeforeNode.previous; insertBeforeNode.previous.next = nodeToInsert; insertBeforeNode.previous = nodeToInsert; size++; modCount++; }
Source:
public String acquireGuestIpv6Address(Network network, String requestedIpv6) throws InsufficientAddressCapacityException { if (!_networkModel.isIP6AddressAvailableInNetwork(network.getId())) { throw new InsufficientAddressCapacityException( String.format("There is no IPv6 address available in the network [name=%s, network id=%s]", network.getName(), network.getId()), DataCenter.class, network.getDataCenterId()); } if (ipAddressManager.isIpEqualsGatewayOrNetworkOfferingsEmpty(network, requestedIpv6)) { throw new InvalidParameterValueException( String.format("The network [id=%s] Offering is Empty or the requested IP address [%s] is equals to the Gateway", network.getId(), requestedIpv6)); } String networkIp6Cidr = network.getIp6Cidr(); if (StringUtils.isNotBlank(networkIp6Cidr) && NetUtils.isIp6InNetwork(requestedIpv6, networkIp6Cidr)) { throw new InvalidParameterValueException(String.format("The requested IPv6 address [%s] doesn't belong to the network [id=%s]", requestedIpv6, network.getId())); } if (isIp6Taken(network, requestedIpv6)) { throw new InsufficientAddressCapacityException(String.format("The given IPv6 [%s] is already used in the network", requestedIpv6), Network.class, network.getId()); } IpAddresses requestedIpPair = new IpAddresses(null, requestedIpv6); _networkModel.checkRequestedIpAddresses(network.getId(), requestedIpPair); IPAddressVO ip = ipAddressDao.findByIpAndSourceNetworkId(network.getId(), requestedIpv6); if (ip != null) { State ipState = ip.getState(); if (ipState != State.Free) { throw new InvalidParameterValueException(String.format("Requested ip address [%s] is not free [ip state=%]", requestedIpv6, ipState)); } } return requestedIpv6; }

Target:
public String acquireGuestIpv6Address(Network network, String requestedIpv6) throws InsufficientAddressCapacityException { if (!_networkModel.areThereIPv6AddressAvailableInNetwork(network.getId())) { throw new InsufficientAddressCapacityException( String.format("There is no IPv6 address available in the network [name=%s, network id=%s]", network.getName(), network.getId()), DataCenter.class, network.getDataCenterId()); } checkIfCanAllocateIpv6Address(network, requestedIpv6); IpAddresses requestedIpPair = new IpAddresses(null, requestedIpv6); _networkModel.checkRequestedIpAddresses(network.getId(), requestedIpPair); IPAddressVO ip = ipAddressDao.findByIpAndSourceNetworkId(network.getId(), requestedIpv6); if (ip != null) { State ipState = ip.getState(); if (ipState != State.Free) { throw new InsufficientAddressCapacityException(String.format("Requested ip address [%s] is not free [ip state=%]", requestedIpv6, ipState), DataCenter.class, network.getDataCenterId()); } } return requestedIpv6; }
Source:
public void makeOmeTiff(final String name, final CoreMetadata info) throws FormatException, IOException { final String id = getId(name); final OMETiffWriter out = createWriter(name, info, id); writeData(name, info, id, out); out.close(); }

Target:
public void makeOmeTiff(final String name, final CoreMetadata info) throws FormatException, IOException { final String id = getId(name); try (OMETiffWriter out = createWriter(name, info, id)) { writeData(name, info, id, out); } }
Source:
protected void endSuccessfully() { if (getParameters().isHotPlugLease() && !runVdsCommand(VDSCommandType.HotPlugLease, new LeaseVDSParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStorageDomainId())).getSucceeded()) { setVmId(getParameters().getVmId()); auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); setSucceeded(false); return; } setSucceeded(true); }

Target:
protected void endSuccessfully() { try { if (getParameters().isHotPlugLease() && !runVdsCommand(VDSCommandType.HotPlugLease, new LeaseVDSParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStorageDomainId())).getSucceeded()) { setVmId(getParameters().getVmId()); auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); setSucceeded(false); return; } } catch (EngineException e) { log.error("Failure in hot plugging a lease to VM {}, message: {}", getParameters().getVmId(), e.getMessage()); auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); return; } setSucceeded(true); }
Source:
private void checkDio(int channel) { if (channel >= 10) { if(channel > 13 && channel < 18) { throw new RuntimeException("Allocated MXP digital pin that does not exist!"); } checkDevice(mxpDigital, channel); } else { checkDevice(dios, channel); } }

Target:
private void checkDio(int channel) { if (channel >= 10) { if(channel > 13 && channel < 18) { throw new RuntimeException("Allocated MXP digital pin that does not exist! Valid I/O expansion pins are 10 through 23."); } checkDevice(mxpDigital, channel); } else { checkDevice(dios, channel); } }
Source:
public void expandAll() { List<WebElement> expanders = getItemExpanderInPublishTreeForm(); if (expanders.size() == 0) { return; } else { for (WebElement expander : expanders) { Locator.waitUntilEnabledAndClick(expander); } } }

Target:
public void expandAll() { List<WebElement> expanders = getItemExpanderInPublishTreeForm(); if (expanders.isEmpty()) { return; } else { for (WebElement expander : expanders) { Locator.waitUntilEnabledAndClick(expander); } } }
Source:
@NotNull private GridClientConfiguration getClientConfiguration( String userName, String password, ConnectionAndSslParameters args ) throws IgniteCheckedException { GridClientConfiguration clientCfg = new GridClientConfiguration(); clientCfg.setPingInterval(args.pingInterval()); clientCfg.setPingTimeout(args.pingTimeout()); clientCfg.setServers(Collections.singletonList(args.host() + ":" + args.port())); if (!F.isEmpty(userName)) clientCfg.setSecurityCredentialsProvider(getSecurityCredentialsProvider(userName, password, clientCfg)); if (!F.isEmpty(args.sslKeyStorePath())) clientCfg.setSslContextFactory(createSslSupportFactory(args)); if (clientCfg.getUserAttributes() == null) clientCfg.setUserAttributes(args.userAttributes()); else throw new IgniteCheckedException("Internal error: User attributes already set!"); return clientCfg; }

Target:
@NotNull private GridClientConfiguration getClientConfiguration( String userName, String password, ConnectionAndSslParameters args ) throws IgniteCheckedException { GridClientConfiguration clientCfg = new GridClientConfiguration(); clientCfg.setPingInterval(args.pingInterval()); clientCfg.setPingTimeout(args.pingTimeout()); clientCfg.setServers(Collections.singletonList(args.host() + ":" + args.port())); if (!F.isEmpty(userName)) clientCfg.setSecurityCredentialsProvider(getSecurityCredentialsProvider(userName, password, clientCfg)); if (!F.isEmpty(args.sslKeyStorePath())) clientCfg.setSslContextFactory(createSslSupportFactory(args)); clientCfg.setUserAttributes(args.userProperties()); return clientCfg; }
Source:
public void TestCollectionInputValidation() throws Exception { try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) tmp.add(i); CollectionDataSource source = new CollectionDataSource(tmp,"test_valid_collection"); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { List<Object> inner = new ArrayList<Object>(); inner.add(i); inner.add('a' + i); tmp.add(inner); } CollectionDataSource source = new CollectionDataSource(tmp,"test_valid_double_collection"); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) tmp.add(i); tmp.add("a"); CollectionDataSource source = new CollectionDataSource(tmp,"test_invalid_collection"); Assert.fail("input type is different"); } catch (Exception e) { } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { List<Object> inner = new ArrayList<Object>(); inner.add(i); inner.add('a' + i); tmp.add(inner); } List<Object> inner = new ArrayList<Object>(); inner.add('a'); inner.add('a'); tmp.add(inner); CollectionDataSource source = new CollectionDataSource(tmp, "test_invalid_double_collection"); Assert.fail("input type is different"); } catch (Exception e) { } }

Target:
public void TestCollectionInputValidation() throws Exception { try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { tmp.add(i); } CollectionDataSource source = new CollectionDataSource(tmp,"test_valid_collection"); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { List<Object> inner = new ArrayList<Object>(); inner.add(i); inner.add('a' + i); tmp.add(inner); } CollectionDataSource source = new CollectionDataSource(tmp,"test_valid_double_collection"); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { tmp.add(i); } tmp.add("a"); CollectionDataSource source = new CollectionDataSource(tmp,"test_invalid_collection"); Assert.fail("input type is different"); } catch (Exception e) { } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { List<Object> inner = new ArrayList<Object>(); inner.add(i); inner.add('a' + i); tmp.add(inner); } List<Object> inner = new ArrayList<Object>(); inner.add('a'); inner.add('a'); tmp.add(inner); CollectionDataSource source = new CollectionDataSource(tmp, "test_invalid_double_collection"); Assert.fail("input type is different"); } catch (Exception e) { } }
Source:
private int parseIdFromInsertedUri(Uri uri) throws NumberFormatException { int id = -1; if (uri != null) { id = Integer.parseInt(uri.getLastPathSegment()); } return id; }

Target:
private int parseIdFromInsertedUri(Uri uri) throws NumberFormatException { return (uri != null) ? Integer.parseInt(uri.getLastPathSegment()) : -1; }
Source:
public Map<String, AlarmWrapper> lookup(Set<String> reductionKeys) { if (reductionKeys == null || reductionKeys.isEmpty()) { return new HashMap<>(); } if (reductionKeys.size() <= 1000) { List<OnmsAlarm> alarms = alarmDao.findMatching(new CriteriaBuilder(OnmsAlarm.class).in("reductionKey", reductionKeys).toCriteria()); return alarms.stream().collect(Collectors.toMap(alarm -> alarm.getReductionKey(), alarm -> new AlarmWrapperImpl(alarm))); } else { return alarmDao.findAll().stream() .filter(a -> reductionKeys.contains(a.getReductionKey())) .collect(Collectors.toMap(alarm -> alarm.getReductionKey(), alarm -> new AlarmWrapperImpl(alarm))); } }

Target:
public Map<String, AlarmWrapper> lookup(Set<String> reductionKeys) { if (reductionKeys == null || reductionKeys.isEmpty()) { return new HashMap<>(); } if (reductionKeys.size() <= threshold) { List<OnmsAlarm> alarms = alarmDao.findMatching(new CriteriaBuilder(OnmsAlarm.class).in("reductionKey", reductionKeys).toCriteria()); return alarms.stream().collect(Collectors.toMap(alarm -> alarm.getReductionKey(), alarm -> new AlarmWrapperImpl(alarm))); } else { return alarmDao.findAll().stream() .filter(a -> reductionKeys.contains(a.getReductionKey())) .collect(Collectors.toMap(alarm -> alarm.getReductionKey(), alarm -> new AlarmWrapperImpl(alarm))); } }
Source:
public ImageTicketInformationReturn(Map<String, Object> innerMap) { super(innerMap); this.ticketInfo = (Map<String, Object>) innerMap.get(TICKET_INFO); }

Target:
public ImageTicketInformationReturn(Map<String, Object> innerMap) { super(innerMap); ticketInfo = (Map<String, Object>) innerMap.get(TICKET_INFO); }
Source:
public void testGetJtsEnvelopeEmpty() { String wkt = "MULTIPOLYGON EMPTY"; Envelope expected = new Envelope(); assertJtsEnvelope(wkt, expected); }

Target:
public void testGetJtsEnvelopeEmpty() { assertJtsEnvelope( "MULTIPOLYGON EMPTY", new Envelope()); }
Source:
public String formatDateAs(String date, String newFormat) { SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); SimpleDateFormat targetFormat = new SimpleDateFormat(newFormat); String formattedDate = null; try { formattedDate = targetFormat.format(sdf.parse(date)); } catch (ParseException e) { e.printStackTrace(); } return formattedDate; }

Target:
public String formatDateAs(String date, String newFormat) { Date parsedDate = parseDate(date); DateFormat targetFormat = getDateFormat(newFormat); return targetFormat.format(parsedDate); }
Source:
public void shiftRows(int startRow, int endRow, final int n, boolean copyRowHeight, boolean resetOriginalRowHeight) { XSSFVMLDrawing vml = getVMLDrawing(false); int sheetIndex = getWorkbook().getSheetIndex(this); String sheetName = getWorkbook().getSheetName(sheetIndex); FormulaShifter shifter = FormulaShifter.createForRowShift( sheetIndex, sheetName, startRow, endRow, n, SpreadsheetVersion.EXCEL2007); removeOverwritten(vml, startRow, endRow, n); XSSFRowShifter rowShifter = new XSSFRowShifter(this, shifter); rowShifter.doShiftingAndProcessComments(vml, startRow, endRow, n, copyRowHeight, rowIterator(), sheetComments); rowShifter.shiftMergedRegions(startRow, endRow, n); XSSFShiftingManager shiftingManager = new XSSFShiftingManager(this, shifter); shiftingManager.updateNamedRanges(); shiftingManager.updateFormulas(); shiftingManager.updateConditionalFormatting(); shiftingManager.updateHyperlinks(); Map<Integer, XSSFRow> map = new HashMap<Integer, XSSFRow>(); for(XSSFRow r : _rows.values()) { final Integer rownumI = new Integer(r.getRowNum()); map.put(rownumI, r); } _rows.clear(); _rows.putAll(map); }

Target:
public void shiftRows(int startRow, int endRow, final int n, boolean copyRowHeight, boolean resetOriginalRowHeight) { XSSFVMLDrawing vml = getVMLDrawing(false); int sheetIndex = getWorkbook().getSheetIndex(this); String sheetName = getWorkbook().getSheetName(sheetIndex); FormulaShifter formulaShifter = FormulaShifter.createForRowShift( sheetIndex, sheetName, startRow, endRow, n, SpreadsheetVersion.EXCEL2007); removeOverwritten(vml, startRow, endRow, n); shiftCommentsAndRows(vml, startRow, endRow, n); XSSFRowShifter rowShifter = new XSSFRowShifter(this); rowShifter.shiftMergedRegions(startRow, endRow, n); rowShifter.updateNamedRanges(formulaShifter); rowShifter.updateFormulas(formulaShifter); rowShifter.updateConditionalFormatting(formulaShifter); rowShifter.updateHyperlinks(formulaShifter); Map<Integer, XSSFRow> map = new HashMap<>(); for(XSSFRow r : _rows.values()) { final Integer rownumI = new Integer(r.getRowNum()); map.put(rownumI, r); } _rows.clear(); _rows.putAll(map); }
Source:
public int getSubscriberCount() { MessageDispatcher dispatcher = getRequiredDispatcher(); if (dispatcher instanceof AbstractDispatcher) { return ((AbstractDispatcher) dispatcher).getHandlerCount(); } return this.handlerCounter.get(); }

Target:
public int getSubscriberCount() { return getRequiredDispatcher().getHandlerCount(); }
Source:
public RtCollaborators(final Request req, final Repo repo) { this.entry = req; final Coordinates coords = repo.coordinates(); this.request = this.entry.uri() .path("/repos") .path(coords.user()) .path(coords.repo()) .path("/collaborators") .back(); this.owner = repo; }

Target:
RtCollaborators(final Request req, final Repo repo) { this.entry = req; final Coordinates coords = repo.coordinates(); this.request = this.entry.uri() .path("/repos") .path(coords.user()) .path(coords.repo()) .path("/collaborators") .back(); this.owner = repo; }
Source:
public synchronized void updateSolrPassword() { if (configuredToAttemptAutoPasswordChange() && isUsingDefaultPassword()) { initialize(); generatePassword(); setPasswordInSolr(); if (isSolrPasswordChangeSuccessfull()) { setPasswordInMemory(); setPasswordInPropertiesFile(); } } }

Target:
public synchronized void updateSolrPassword() { try { run(); } finally { cleanup(); } }
Source:
private static List<CharValues> buildCharValues(final Dataset dataset, final DatasetDto datasetDto, final Map<String, SampleDTO> sampleDTOMap, final Map<String, Marker> markerMap) { List<CharValues> charValuesList = new ArrayList<>(); int row = 0; for (final DatasetDto.SampleKey sampleKey : datasetDto.getSampleAccesions()) { int column = 0; for (final String marker : datasetDto.getMarkers()) { final CharValues charValues = new CharValues(); final Sample sample = new Sample(); sample.setSampleId(sampleDTOMap.get(sampleKey.getSampleUID()).getSampleId()); charValues.setDataset(dataset); charValues.setSample(sample); charValues.setCharValue(getCharData(datasetDto.getCharValues()[row][column])); charValues.setMarkerId(markerMap.get(marker).getMarkerId()); charValues.setAccSampleId(sampleKey.getAccesion()); charValuesList.add(charValues); column++; } row++; } return charValuesList; }

Target:
private static List<CharValues> buildCharValues(final Dataset dataset, final DatasetDto datasetDto, final Map<String, SampleDTO> sampleDTOMap, final Map<String, Marker> markerMap) { final List<CharValues> charValuesList = new ArrayList<>(); int row = 0; for (final DatasetDto.SampleKey sampleKey : datasetDto.getSampleAccesions()) { int column = 0; for (final String marker : datasetDto.getMarkers()) { final CharValues charValues = new CharValues(); final Sample sample = new Sample(); sample.setSampleId(sampleDTOMap.get(sampleKey.getSampleUID()).getSampleId()); charValues.setDataset(dataset); charValues.setSample(sample); charValues.setCharValue(getCharData(datasetDto.getCharValues()[row][column])); charValues.setMarkerId(markerMap.get(marker).getMarkerId()); charValues.setAccSampleId(sampleKey.getAccesion()); charValuesList.add(charValues); column++; } row++; } return charValuesList; }
Source:
private boolean skipEncoding(Object source) { return source == null || isTypeExcluded(source.getClass()); }

Target:
private boolean skipEncoding(Object source) { return isTypeExcluded(source.getClass()); }
Source:
public void testGetProducerInfoNoClient() { SpanCache spanCache = new TestSpanCache(); Span serverSpan = new Span(); serverSpan.setId("1"); serverSpan.setParentId("1"); List<Span> spans = new ArrayList<Span>(); spans.add(serverSpan); try { spanCache.store(null, spans, SpanUniqueIdGenerator::toUnique); } catch (CacheException e) { fail("Failed to store span"); } assertNull(ProducerInfoUtil.getProducerInfo(null, serverSpan, spanCache)); }

Target:
public void testGetProducerInfoNoClient() throws CacheException { SpanCache spanCache = new TestSpanCache(); Span serverSpan = new Span(); serverSpan.setId("1"); serverSpan.setParentId("1"); spanCache.store(null, Arrays.asList(serverSpan), SpanUniqueIdGenerator::toUnique); assertNull(ProducerInfoUtil.getProducerInfo(null, serverSpan, spanCache)); }
Source:
StyleInfo createStyleFromFile(Resource styleFile, ImportTask task) { String ext = FilenameUtils.getExtension(styleFile.name()); if (ext != null) { StyleHandler styleHandler = Styles.handler(ext); if (styleHandler != null) { try { StyledLayerDescriptor sld = styleHandler.parse(styleFile, null, null, new EntityResolverProvider(getGeoServer()).getEntityResolver()); Style style = Styles.style(sld); if (style != null) { StyleInfo info = catalog.getFactory().createStyle(); String styleName = styleGen.generateUniqueStyleName(task.getLayer().getResource()); info.setName(styleName); info.setFilename(styleName + "." +ext); info.setFormat(styleHandler.getFormat()); info.setWorkspace(task.getStore().getWorkspace()); catalog.getResourcePool().writeStyle(info, styleFile.in()); return info; } else { LOGGER.warning("Style file contained no styling: " + styleFile.path()); } } catch(Exception e) { LOGGER.log(Level.WARNING, "Error parsing style: " + styleFile.path(), e); } } else { LOGGER.warning("Unable to find style handler for file extension: " + ext); } } return null; }

Target:
StyleInfo createStyleFromFile(Resource styleFile, ImportTask task) { String ext = FilenameUtils.getExtension(styleFile.name()); if (ext != null) { StyleHandler styleHandler = Styles.handler(ext); if (styleHandler != null) { try { StyledLayerDescriptor sld = styleHandler.parse(styleFile, null, null, new EntityResolverProvider(getGeoServer()).getEntityResolver()); Style style = Styles.style(sld); if (style != null) { StyleInfo info = catalog.getFactory().createStyle(); String styleName = styleGen.generateUniqueStyleName(task.getLayer().getResource()); info.setName(styleName); info.setFilename(styleName + "." +ext); info.setFormat(styleHandler.getFormat()); info.setWorkspace(task.getStore().getWorkspace()); try (InputStream in = styleFile.in()) { catalog.getResourcePool().writeStyle(info, in); } return info; } else { LOGGER.warning("Style file contained no styling: " + styleFile.path()); } } catch(Exception e) { LOGGER.log(Level.WARNING, "Error parsing style: " + styleFile.path(), e); } } else { LOGGER.warning("Unable to find style handler for file extension: " + ext); } } return null; }
Source:
private void dropAllEntities() { for (MappedEntity mappedEntity : ImmutableList.copyOf(entities.values())) { try { dropEntity(mappedEntity.getEntity()); } catch (final DatabaseEngineException ex) { logger.debug(String.format("Failed to drop entity '%s'", mappedEntity.getEntity().getName()), ex); } } }

Target:
private void dropAllEntities() { for (final MappedEntity mappedEntity : ImmutableList.copyOf(entities.values())) { try { dropEntity(mappedEntity.getEntity()); } catch (final DatabaseEngineException ex) { logger.debug(String.format("Failed to drop entity '%s'", mappedEntity.getEntity().getName()), ex); } } }
Source:
public void delete(Set<String> ids) { if (!ids.isEmpty()) { repository().write(writer -> { for (String id : ids) { writer.remove(ValidationWhiteList.class, id); } writer.commit(); return null; }); WhiteListNotification.removed(ids).publish(service(IEventBus.class)); } }

Target:
public void delete(Set<String> ids) { objectsToDelete.put(ValidationWhiteList.class, ids); }
Source:
public String getActionProviders(HttpServletRequest request) throws SecurityServiceException { HttpSession session = httpSessionFactory.getOrCreateSession(request); List<SecurityToken> tokenList = ((SecurityTokenHolder) session.getAttribute(SecurityConstants.SAML_ASSERTION)) .getSecurityTokens(); List<Subject> subjectList = new ArrayList<>(); for (SecurityToken token : tokenList) { subjectList.add(securityManager.getSubject(token)); } List<Map<String, String>> actionPropertiesList = new ArrayList<>(); for (ActionProvider actionProvider : logoutActionProviders) { Action action = actionProvider.getAction(subjectList); if (action != null) { if (!tokenList.isEmpty()) { Map<String, String> actionProperties = new HashMap<>(); String displayName = SubjectUtils.getName(subjectList.get(0), "", true); actionProperties.put("title", action.getTitle()); actionProperties.put("auth", displayName); actionProperties.put("description", action.getDescription()); actionProperties.put("url", action.getUrl().toString()); actionPropertiesList.add(actionProperties); } } } return GSON.toJson(actionPropertiesList); }

Target:
public String getActionProviders(HttpServletRequest request) throws SecurityServiceException { HttpSession session = httpSessionFactory.getOrCreateSession(request); SecurityToken token = ((SecurityTokenHolder) session.getAttribute(SecurityConstants.SAML_ASSERTION)) .getSecurityToken(); Subject subject = securityManager.getSubject(token); List<Map<String, String>> actionPropertiesList = new ArrayList<>(); for (ActionProvider actionProvider : logoutActionProviders) { Map<String, String> actionProperties = new HashMap<>(); Action action = actionProvider.getAction(subject); if (action != null) { String displayName = SubjectUtils.getName(subject, "", true); actionProperties.put("title", action.getTitle()); actionProperties.put("auth", displayName); actionProperties.put("description", action.getDescription()); actionProperties.put("url", action.getUrl().toString()); actionPropertiesList.add(actionProperties); } } return GSON.toJson(actionPropertiesList); }
Source:
public boolean equals(Object o) { if (o instanceof AdvertisedDataSource) { AdvertisedDataSource other = (AdvertisedDataSource)o; if (other.m_generation == m_generation && other.partitionId == partitionId) { return true; } } return false; }

Target:
public boolean equals(Object o) { if (o instanceof AdvertisedDataSource) { AdvertisedDataSource other = (AdvertisedDataSource)o; if (other.m_generation == m_generation && other.tableName.equals(tableName) && other.partitionId == partitionId) { return true; } } return false; }
Source:
public String format_timestamp(TimestampType ts, String tz) throws VoltAbortException { if (ts == null) { return null; } if (tz == null) { return ts.toString(); } tz = tz.trim(); long millis = ts.getTime() / 1000; short usecs = ts.getUSec(); Instant fromEpochMilli = Instant.ofEpochMilli(millis); ZoneOffset offset; try { offset = ZonedDateTime.ofInstant(fromEpochMilli, ZoneId.of(tz)).getOffset(); } catch (DateTimeException offsetEx) { throw new VoltAbortException("VOLTDB ERROR: SQL ERROR\n" + " invalid timezone string."); } long offsetInSeconds = offset.getTotalSeconds(); TimestampType convertedTs = new TimestampType(millis * 1000 + usecs + offsetInSeconds * 1000000); return convertedTs.toString(); }

Target:
public String format_timestamp(TimestampType ts, String tz) throws VoltAbortException { if (ts == null) { return null; } if (tz == null) { return ts.toString(); } tz = tz.trim(); long millis = ts.getTime() / 1000; short usecs = ts.getUSec(); Instant fromEpochMilli = Instant.ofEpochMilli(millis); ZoneOffset offset; try { offset = ZonedDateTime.ofInstant(fromEpochMilli, ZoneId.of(tz)).getOffset(); } catch (DateTimeException offsetEx) { throw new VoltAbortException("Invalid timezone string."); } long offsetInSeconds = offset.getTotalSeconds(); TimestampType convertedTs = new TimestampType(millis * 1000 + usecs + offsetInSeconds * 1000000); return convertedTs.toString(); }
Source:
protected String getJBossJavaFlags() { IPath serverHome = getServerHome(); IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {}; IServerModeDetails det = (IServerModeDetails)Platform.getAdapterManager().getAdapter(server, IServerModeDetails.class); String basedir = det.getProperty(IServerModeDetails.PROP_SERVER_BASE_DIR_ABS); IPath base = new Path(basedir); IPath bootLog = base.append(c.FOLDER_LOG).append(c.AS7_BOOT_LOG); IPath logConfig = base.append(c.CONFIGURATION).append(c.LOGGING_PROPERTIES); String ret = "-Djava.awt.headless=true" + SPACE + QUOTE + SYSPROP + JB7_BOOT_LOG_ARG + EQ + bootLog.toString() + QUOTE + SPACE + QUOTE + SYSPROP + JB7_LOGGING_CONFIG_FILE + EQ + "file:" + logConfig.toString() + QUOTE + SPACE + SYSPROP + "java.util.logging.manager=org.jboss.logmanager.LogManager" + SPACE + QUOTE + SYSPROP + JBOSS_HOME_DIR + EQ + serverHome.toString() + QUOTE + SPACE; return ret; }

Target:
protected String getJBossJavaFlags() { IPath serverHome = getServerHome(); IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {}; IServerModeDetails det = (IServerModeDetails)Platform.getAdapterManager().getAdapter(server, IServerModeDetails.class); String basedir = det.getProperty(IServerModeDetails.PROP_SERVER_BASE_DIR_ABS); IPath base = new Path(basedir); IPath bootLog = base.append(c.FOLDER_LOG).append(c.AS7_BOOT_LOG); IPath logConfig = base.append(c.CONFIGURATION).append(c.LOGGING_PROPERTIES); String ret = "-Djava.awt.headless=true" + SPACE + QUOTE + SYSPROP + JB7_BOOT_LOG_ARG + EQ + bootLog.toString() + QUOTE + SPACE + QUOTE + SYSPROP + JB7_LOGGING_CONFIG_FILE + EQ + "file:" + logConfig.toString() + QUOTE + SPACE + QUOTE + SYSPROP + JBOSS_HOME_DIR + EQ + serverHome.toString() + QUOTE + SPACE; return ret; }
Source:
boolean isConnectionAlive(final Connection connection) { try { if (isUseJdbc4Validation) { return connection.isValid((int) MILLISECONDS.toSeconds(Math.max(1000, validationTimeout))); } setNetworkTimeout(connection, validationTimeout); try (Statement statement = connection.createStatement()) { if (isNetworkTimeoutSupported != TRUE) { setQueryTimeout(statement, (int) MILLISECONDS.toSeconds(Math.max(1000, validationTimeout))); } statement.execute(config.getConnectionTestQuery()); } if (isIsolateInternalQueries && !isReadOnly && !isAutoCommit) { connection.rollback(); } setNetworkTimeout(connection, networkTimeout); return true; } catch (SQLException e) { lastConnectionFailure.set(e); LOGGER.warn("{} - Failed to validate connection ({})", poolName, connection, e.getMessage()); return false; } }

Target:
boolean isConnectionAlive(final Connection connection) { try { if (isUseJdbc4Validation) { return connection.isValid((int) MILLISECONDS.toSeconds(Math.max(1000L, validationTimeout))); } setNetworkTimeout(connection, validationTimeout); try (Statement statement = connection.createStatement()) { if (isNetworkTimeoutSupported != TRUE) { setQueryTimeout(statement, (int) MILLISECONDS.toSeconds(Math.max(1000L, validationTimeout))); } statement.execute(config.getConnectionTestQuery()); } if (isIsolateInternalQueries && !isReadOnly && !isAutoCommit) { connection.rollback(); } setNetworkTimeout(connection, networkTimeout); return true; } catch (SQLException e) { lastConnectionFailure.set(e); LOGGER.warn("{} - Failed to validate connection ({})", poolName, connection, e.getMessage()); return false; } }
Source:
protected void setup(final SAMFileHeader header, final File samFile) { IOUtil.assertFileIsWritable(CHART_OUTPUT); if (SUMMARY_OUTPUT != null) IOUtil.assertFileIsWritable(SUMMARY_OUTPUT); try{ saveHeader = header.getReadGroups().get(0).getLibrary(); } catch (Exception ignored){ saveHeader = "Unavailable"; } }

Target:
protected void setup(final SAMFileHeader header, final File samFile) { IOUtil.assertFileIsWritable(CHART_OUTPUT); if (SUMMARY_OUTPUT != null) IOUtil.assertFileIsWritable(SUMMARY_OUTPUT); try{ saveHeader = header.getReadGroups().get(0).getLibrary(); } catch (Exception ignored){ saveHeader = "LibraryNameUnavailable"; } }
Source:
public void testJvmtiAgentStartupAgents() throws Exception { runJvmtiAgentLoadTest((ITestDevice device, String pkg, String apk, String abiName) -> { String startup_dir = null; try { String pwd = device.executeShellCommand( "run-as " + pkg + " --user " + mCurrentUser + " pwd"); if (pwd == null) { throw new RuntimeException("pwd failed"); } pwd = pwd.trim(); if (pwd.isEmpty()) { throw new RuntimeException("pwd failed"); } startup_dir = pwd + "/" + STARTUP_AGENT_DIR; device.executeShellCommand( "run-as " + pkg + " --user " + mCurrentUser + " mkdir " + startup_dir); } catch (Exception e) { throw new RuntimeException("Failed to install startup-agents"); } try { installLibToDataData(device, pkg, abiName, apk, startup_dir, AGENT, AGENT); runAttachTestCmd(device, pkg, ""); runAttachTestCmd(device, pkg, ""); } catch (Exception e) { throw new RuntimeException("Failed startup_agents attaching", e); } finally { try { device.executeShellCommand( "run-as " + pkg + " --user " + mCurrentUser + " rm -rf " + startup_dir); } catch (Exception e) { throw new RuntimeException("Failed to clean up " + startup_dir, e); } } }); }

Target:
public void testJvmtiAgentStartupAgents() throws Exception { runJvmtiAgentLoadTest((ITestDevice device, String pkg, String apk, String abiName) -> { String startup_dir = null; try { startup_dir = getPwd(device, pkg) + "/" + STARTUP_AGENT_DIR; device.executeShellCommand( "run-as " + pkg + " --user " + mCurrentUser + " mkdir " + startup_dir); } catch (Exception e) { throw new RuntimeException("Failed to install startup-agents"); } try { installLibToDataData(device, pkg, abiName, apk, startup_dir, AGENT, AGENT); runAttachTestCmd(device, pkg, ""); runAttachTestCmd(device, pkg, ""); } catch (Exception e) { throw new RuntimeException("Failed startup_agents attaching", e); } finally { try { device.executeShellCommand( "run-as " + pkg + " --user " + mCurrentUser + " rm -rf " + startup_dir); } catch (Exception e) { throw new RuntimeException("Failed to clean up " + startup_dir, e); } } }); }
Source:
public Proxy apply(URI endpoint) { if (!useProxyForSockets && "socket".equals(endpoint.getScheme())) { return Proxy.NO_PROXY; } if (config.getProxy().isPresent()) { SocketAddress addr = new InetSocketAddress(config.getProxy().get().getHostText(), config.getProxy().get() .getPort()); Proxy proxy = new Proxy(config.getType(), addr); final Optional<Credentials> creds = config.getCredentials(); if (creds.isPresent()) { Authenticator authenticator = new Authenticator() { public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(creds.get().identity, creds.get().credential.toCharArray()); } }; Authenticator.setDefault(authenticator); } return proxy; } if (config.canUseProxyFromJvm()) { return getDefaultProxy(endpoint); } if (config.useSystem()) { System.setProperty("java.net.useSystemProxies", "true"); return getDefaultProxy(endpoint); } return Proxy.NO_PROXY; }

Target:
public Proxy apply(URI endpoint) { if (!useProxyForSockets && "socket".equals(endpoint.getScheme())) { return Proxy.NO_PROXY; } if (config.getProxy().isPresent()) { SocketAddress addr = new InetSocketAddress(config.getProxy().get().getHostText(), config.getProxy().get() .getPort()); Proxy proxy = new Proxy(config.getType(), addr); final Optional<Credentials> creds = config.getCredentials(); if (creds.isPresent()) { Authenticator authenticator = new Authenticator() { public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(creds.get().identity, creds.get().credential.toCharArray()); } }; Authenticator.setDefault(authenticator); } return proxy; } if (config.isJvmProxyEnabled()) { return getDefaultProxy(endpoint); } if (config.useSystem()) { System.setProperty("java.net.useSystemProxies", "true"); return getDefaultProxy(endpoint); } return Proxy.NO_PROXY; }
Source:
public void setSortOrder(Integer order, boolean isAscending) { PreferenceManager.setSortOrder(order, mContext, FileStorageUtils.UPLOAD_SORT); PreferenceManager.setSortAscending(isAscending, mContext, FileStorageUtils.UPLOAD_SORT); FileStorageUtils.mSortOrderUpload = order; FileStorageUtils.mSortAscendingUpload = isAscending; if (mFiles != null && mFiles.length > 0) { mFiles = transformVecOCFile(FileStorageUtils.sortFolder(transformFileArray(mFiles), FileStorageUtils.mSortOrderUpload,FileStorageUtils.mSortAscendingUpload)); if (parentList != null) { for (int i = 0; i < mFiles.length; i++) { parentList.setItemChecked(i, false); } } notifyDataSetChanged(); } }

Target:
public void setSortOrder(Integer order, boolean isAscending) { PreferenceManager.setSortOrder(order, mContext, FileStorageUtils.UPLOAD_SORT); PreferenceManager.setSortAscending(isAscending, mContext, FileStorageUtils.UPLOAD_SORT); FileStorageUtils.mSortOrderUpload = order; FileStorageUtils.mSortAscendingUpload = isAscending; if (mFiles != null && mFiles.length > 0) { mFiles = transformVecOCFilesToFilesArr( FileStorageUtils.sortFolder(transformFilesArrToVecOCFiles(mFiles), FileStorageUtils.mSortOrderUpload, FileStorageUtils.mSortAscendingUpload) ); if (parentList != null) { for (int i = 0; i < mFiles.length; i++) { parentList.setItemChecked(i, false); } } notifyDataSetChanged(); } }
Source:
public void connect() throws Exception { super.connect(); if (properties.getSchema() != null && properties.getSchema().length() > 0 && !properties.getUsername().equals(properties.getSchema())) { final Statement stmt = conn.createStatement(); stmt.execute("ALTER SESSION SET CURRENT_SCHEMA=" + properties.getSchema()); stmt.close(); } }

Target:
public void connect() throws Exception { super.connect(); if (properties.getSchema() != null && properties.getSchema().length() > 0 && !properties.getUsername().equals(properties.getSchema())) { try (final Statement stmt = conn.createStatement()) { stmt.execute("ALTER SESSION SET CURRENT_SCHEMA=" + properties.getSchema()); } } }
Source:
public void shouldRemoveExistingElements() { assertThat(of(1, 2, 3).removeAll(i -> i == 1)).isEqualTo(of(2, 3)); assertThat(of(1, 2, 3).removeAll(i -> i == 2)).isEqualTo(of(1, 3)); assertThat(of(1, 2, 3).removeAll(i -> i == 3)).isEqualTo(of(1, 2)); if (useIsEqualToInsteadOfIsSameAs()) { assertThat(of(1, 2, 3).removeAll(ignore -> true)).isEmpty(); assertThat(of(1, 2, 3).removeAll(ignore -> false)).isEqualTo(of(1, 2, 3)); } }

Target:
public void shouldRemoveExistingElements() { assertThat(of(1, 2, 3).removeAll(i -> i == 1)).isEqualTo(of(2, 3)); assertThat(of(1, 2, 3).removeAll(i -> i == 2)).isEqualTo(of(1, 3)); assertThat(of(1, 2, 3).removeAll(i -> i == 3)).isEqualTo(of(1, 2)); if (useIsEqualToInsteadOfIsSameAs()) { assertThat(of(1, 2, 3).removeAll(ignore -> true)).isEmpty(); assertThat(of(1, 2, 3).removeAll(ignore -> false)).isEqualTo(of(1, 2, 3)); } else { Seq<Integer> seq = of(1, 2, 3); assertThat(seq.removeAll(ignore -> false)).isSameAs(seq); } }
Source:
public MasterParser(final String... args) throws ArgumentParserException { super("helios-master", "Spotify Helios Master", args); final Namespace options = getNamespace(); final InetSocketAddress httpAddress = parseSocketAddress(options.getString(httpArg.getDest())); String masterPassword = System.getenv(ZK_MASTER_PASSWORD_ENVVAR); if (masterPassword == null) { masterPassword = options.getString(zkMasterPassword.getDest()); } final MasterConfig config = new MasterConfig() .setZooKeeperConnectString(getZooKeeperConnectString()) .setZooKeeperSessionTimeoutMillis(getZooKeeperSessionTimeoutMillis()) .setZooKeeperConnectionTimeoutMillis(getZooKeeperConnectionTimeoutMillis()) .setZooKeeperNamespace(getZooKeeperNamespace()) .setZooKeeperClusterId(getZooKeeperClusterId()) .setNoZooKeeperMasterRegistration(getNoZooKeeperRegistration()) .setZooKeeperEnableAcls(getZooKeeperEnableAcls()) .setZooKeeperAgentDigest(options.getString(zkAgentDigest.getDest())) .setZooKeeperMasterPassword(masterPassword) .setDomain(getDomain()) .setName(getName()) .setStatsdHostPort(getStatsdHostPort()) .setRiemannHostPort(getRiemannHostPort()) .setInhibitMetrics(getInhibitMetrics()) .setSentryDsn(getSentryDsn()) .setServiceRegistryAddress(getServiceRegistryAddress()) .setServiceRegistrarPlugin(getServiceRegistrarPlugin()) .setAdminPort(options.getInt(adminArg.getDest())) .setHttpEndpoint(httpAddress) .setKafkaBrokers(getKafkaBrokers()) .setStateDirectory(getStateDirectory()); this.masterConfig = config; }

Target:
public MasterParser(final String... args) throws ArgumentParserException { super("helios-master", "Spotify Helios Master", args); final Namespace options = getNamespace(); final InetSocketAddress httpAddress = parseSocketAddress(options.getString(httpArg.getDest())); String masterPassword = System.getenv(ZK_MASTER_PASSWORD_ENVVAR); if (masterPassword == null) { masterPassword = options.getString(zkAclMasterPassword.getDest()); } final MasterConfig config = new MasterConfig() .setZooKeeperConnectString(getZooKeeperConnectString()) .setZooKeeperSessionTimeoutMillis(getZooKeeperSessionTimeoutMillis()) .setZooKeeperConnectionTimeoutMillis(getZooKeeperConnectionTimeoutMillis()) .setZooKeeperClusterId(getZooKeeperClusterId()) .setNoZooKeeperMasterRegistration(getNoZooKeeperRegistration()) .setZooKeeperEnableAcls(getZooKeeperEnableAcls()) .setZookeeperAclAgentUser(getZooKeeperAclAgentUser()) .setZooKeeperAclAgentDigest(options.getString(zkAclAgentDigest.getDest())) .setZookeeperAclMasterUser(getZooKeeperAclMasterUser()) .setZooKeeperAclMasterPassword(masterPassword) .setDomain(getDomain()) .setName(getName()) .setStatsdHostPort(getStatsdHostPort()) .setRiemannHostPort(getRiemannHostPort()) .setInhibitMetrics(getInhibitMetrics()) .setSentryDsn(getSentryDsn()) .setServiceRegistryAddress(getServiceRegistryAddress()) .setServiceRegistrarPlugin(getServiceRegistrarPlugin()) .setAdminPort(options.getInt(adminArg.getDest())) .setHttpEndpoint(httpAddress) .setKafkaBrokers(getKafkaBrokers()) .setStateDirectory(getStateDirectory()); this.masterConfig = config; }
Source:
public void sendException(String description, String service) { try { connection.getClient().event().description(description).service(service).tags("uncaught-exception").send(); } catch (Throwable t) { logger.warn("Riemann error during exception send : " + stackTraceToString(t)); } }

Target:
public void sendException(String description, String service) { try { connection.getClient().event().description(description).service(service).tags("uncaught-exception").send(); } catch (Throwable t) { logger.warn("Riemann error during exception ("+description+") send attempt: ", t); } }
Source:
default void logWarning(final ClientRuntimeError error) { warn("[WARNING] DMNClientService could not get the asset list."); warn(error.getMessage()); }

Target:
default void logWarning(final ClientRuntimeError error) { warn(error.getMessage()); }
Source:
public OAuth2TokenValidatorResult validate(Jwt token) { Assert.notNull(token, "token cannot be null"); try { T claim = (T) token.getClaims().get(this.claim); return Optional.ofNullable(claim) .filter(test::test) .map(result -> OAuth2TokenValidatorResult.success()) .orElse(OAuth2TokenValidatorResult.failure(error)); } catch(ClassCastException ex) { throw new RuntimeException("The " + this.claim + " claim type and the provided test type mismatches"); } }

Target:
public OAuth2TokenValidatorResult validate(Jwt token) { Assert.notNull(token, "token cannot be null"); T claimValue = token.getClaim(this.claim); if (test.test(claimValue)) { return OAuth2TokenValidatorResult.success(); } else { return OAuth2TokenValidatorResult.failure(error); } }
Source:
public synchronized void addEntry(String url) { if (entries==null) entries = new ArrayList<String>(); entries.add(url); }

Target:
public synchronized void addEntry(String url) { if (entries==null) entries = new CopyOnWriteArrayList<String>(); entries.add(url); }
Source:
public void setProject(IProject project) { this.project=project; }

Target:
protected void setProject(IProject project) { this.project=project; }
Source:
public Mono<ResponseEntity<?>> queryStatistics() { return handleExceptions( () -> scheduler.wrapBlocking(() -> ok(statisticsConverter.convert(statisticsService.getStatistics())))); }

Target:
public Mono<ResponseEntity<?>> queryStatistics() { return handleExceptions(() -> wrapBlocking(() -> ok(statisticsConverter.convert(statisticsService.getStatistics())))); }
Source:
private boolean hasStashedCommits(final Repository repository) { try { return repository.findRef(Constants.R_STASH) != null; } catch (IOException e) { return false; } }

Target:
private boolean hasStashedCommits(final Repository repository) { try { return repository.exactRef(Constants.R_STASH) != null; } catch (IOException e) { return false; } }