auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isVisibleAndScrolledIntoView(View view) { if (view != null && view.getVisibility() == View.VISIBLE) { Rect scrollBounds = new Rect(); mScrollView.getHitRect(scrollBounds); return view.getLocalVisibleRect(scrollBounds); } else { return false; } }

Target:
private boolean isVisibleAndScrolledIntoView(View view) { if (view != null && view.getVisibility() == View.VISIBLE) { Rect scrollBounds = new Rect(); mScrollView.getHitRect(scrollBounds); return view.getLocalVisibleRect(scrollBounds); } return false; }
Source:
public String getProbeString() { if (fAddress != null) { return fAddress; } else if (fSymbol != null && fOffset != null) { return new StringBuffer(fSymbol).append('+').append(fOffset).toString(); } return null; }

Target:
public String getProbeString() { if (fAddress != null) { return fAddress; } else if (fSymbol != null) { StringBuffer buffer = new StringBuffer(fSymbol); if (fOffset != null) { buffer.append('+').append(fOffset); } return buffer.toString(); } return null; }
Source:
public final Optional<HttpAction> redirect(final WebContext context) { return Optional.empty(); }

Target:
public final HttpAction redirect(final WebContext context) { throw new TechnicalException("direct clients do not support redirections"); }
Source:
public void unregister() { enforceNetworkStackPermission(); if (DBG) log("Unregistering NetworkFactory"); if (mMessenger != null) { ConnectivityManager.from(mContext).unregisterNetworkFactory(mMessenger); mMessenger = null; } }

Target:
public void unregister() { if (DBG) log("Unregistering NetworkFactory"); if (mMessenger != null) { ConnectivityManager.from(mContext).unregisterNetworkFactory(mMessenger); mMessenger = null; } }
Source:
public double publishServoEvent(ServoControl servo, Integer eventType, double currentOutput) { servo.publishServoEvent(eventType, currentOutput); return currentOutput; }

Target:
public double publishServoEvent(ServoControl servo, Integer eventType, double currentOutput) { servo.publishServoData(ServoStatus.SERVO_POSITION_UPDATE, currentOutput); return currentOutput; }
Source:
private void initTargetDomains() { templateDisks= diskDao.getAllForVm(getParameters().getVmStaticData().getVmtGuid()); targetDomainsSize = new HashMap<>(); diskToProfileMap = new HashMap<>(); diskToStorageIds = new HashMap<>(); for (Disk disk: templateDisks) { DiskImage diskImage = (DiskImage)disk; diskToProfileMap.put(disk.getId(), diskImage.getDiskProfileIds()); diskToStorageIds.put(disk.getId(), diskImage.getStorageIds()); for (Guid storageId: diskImage.getStorageIds()) { StorageDomain domain = storageDomainDao.get(storageId); if (!targetDomainsSize.containsKey(domain.getId())) { targetDomainsSize.put(domain.getId(), domain.getAvailableDiskSizeInBytes()); } } } }

Target:
private void initTargetDomains() { templateDisks= diskDao.getAllForVm(getParameters().getVmStaticData().getVmtGuid()); targetDomainsSize = new HashMap<>(); diskToProfileMap = new HashMap<>(); diskToStorageIds = new HashMap<>(); for (Disk disk: templateDisks) { DiskImage diskImage = (DiskImage)disk; diskToProfileMap.put(disk.getId(), diskImage.getDiskProfileIds()); diskToStorageIds.put(disk.getId(), diskImage.getStorageIds()); for (Guid storageId: diskImage.getStorageIds()) { if (!targetDomainsSize.containsKey(storageId)) { StorageDomain domain = storageDomainDao.get(storageId); targetDomainsSize.put(domain.getId(), domain.getAvailableDiskSizeInBytes()); } } } }
Source:
public void readyToForward() { started = true; if(created.get() == 0) forward(); }

Target:
public synchronized void readyToForward() { started = true; if(created.get() == 0) forward(); }
Source:
public void testListRemote_Dumb_DetachedHEAD() throws Exception { Repository src = remoteRepository.getRepository(); RefUpdate u = src.updateRef(Constants.HEAD, true); RevCommit Q = remoteRepository.commit().message("Q").create(); u.setNewObjectId(Q); assertEquals(RefUpdate.Result.FORCED, u.forceUpdate()); Repository dst = createBareRepository(); Ref head; try (Transport t = Transport.open(dst, dumbAuthNoneURI)) { try (FetchConnection c = t.openFetch()) { head = c.getRef(Constants.HEAD); } } assertNotNull("has " + Constants.HEAD, head); assertEquals(Q, head.getObjectId()); }

Target:
public void testListRemote_Dumb_DetachedHEAD() throws Exception { Repository src = remoteRepository.getRepository(); RefUpdate u = src.updateRef(Constants.HEAD, true); RevCommit Q = remoteRepository.commit().message("Q").create(); u.setNewObjectId(Q); assertEquals(RefUpdate.Result.FORCED, u.forceUpdate()); Repository dst = createBareRepository(); Ref head; try (Transport t = Transport.open(dst, dumbAuthNoneURI); FetchConnection c = t.openFetch()) { head = c.getRef(Constants.HEAD); } assertNotNull("has " + Constants.HEAD, head); assertEquals(Q, head.getObjectId()); }
Source:
public void bitreserveClientWithoutTokenShouldSetTheTokenAndRestAdapter() throws Exception { BitreserveClient bitreserveClient = new BitreserveClient(); Assert.assertNull(SessionManager.INSTANCE.getBearerToken()); Assert.assertNotNull(bitreserveClient.getToken().getBitreserveRestAdapter()); }

Target:
public void bitreserveClientWithoutTokenShouldSetTheTokenAndRestAdapter() throws Exception { BitreserveClient.initialize(new MockSharedPreferencesContext()); BitreserveClient bitreserveClient = new BitreserveClient(); Assert.assertNull(SessionManager.INSTANCE.getBearerToken()); Assert.assertNotNull(bitreserveClient.getToken().getBitreserveRestAdapter()); }
Source:
public AddProblemFactChangeCommand() { super(); }

Target:
public AddProblemFactChangeCommand() { }
Source:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { Builder<?> builder = request.toBuilder(); Payload payload = Payload.class.cast(input); if (payload.getContentMetadata().getContentType() == null) payload.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM); Long contentLength = payload.getContentMetadata().getContentLength(); if (contentLength != null && contentLength >= 0) { checkArgument(contentLength <= 5l * 1024 * 1024 * 1024, "maximum size for put object is 5GB, %s", contentLength); } else { builder.replaceHeader(TRANSFER_ENCODING, "chunked").build(); } byte[] md5 = payload.getContentMetadata().getContentMD5(); if (md5 != null) { builder.replaceHeader(ETAG, base16().lowerCase().encode(md5)); } Date expires = payload.getContentMetadata().getExpires(); if (expires != null) { builder.replaceHeader(OBJECT_DELETE_AT, String.valueOf( MILLISECONDS.toSeconds(expires.getTime()))) .build(); } return (R) builder.payload(payload).build(); }

Target:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { Builder<?> builder = request.toBuilder(); Payload payload = Payload.class.cast(input); if (payload.getContentMetadata().getContentType() == null) { payload.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM); } Long contentLength = payload.getContentMetadata().getContentLength(); if (contentLength != null && contentLength >= 0) { checkArgument(contentLength <= 5l * 1024 * 1024 * 1024, "maximum size for put object is 5GB, %s", contentLength); } else { builder.replaceHeader(TRANSFER_ENCODING, "chunked").build(); } byte[] md5 = payload.getContentMetadata().getContentMD5(); if (md5 != null) { builder.replaceHeader(ETAG, base16().lowerCase().encode(md5)); } Date expires = payload.getContentMetadata().getExpires(); if (expires != null) { builder.replaceHeader(OBJECT_DELETE_AT, String.valueOf( MILLISECONDS.toSeconds(expires.getTime()))) .build(); } return (R) builder.payload(payload).build(); }
Source:
public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) { if (expectedValue instanceof Boolean) { if (IS_WRAPTEXT_ENABLED.equals(property)) { boolean wrapTextFlag = Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, WrapTextPreferencePage.ENABLE_WRAP_TEXT, true, null); return expectedValue.equals(wrapTextFlag == true); } else if (IS_AUTO_RESIZE_CELL_HEIGHT_ENABLED.equals(property)) { boolean autoResizeCellHeightFlag = Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, WrapTextPreferencePage.ENABLE_AUTO_RESIZE_CELL_HEIGHT, true, null); return expectedValue.equals(autoResizeCellHeightFlag == true); } } return false; }

Target:
public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) { if (expectedValue instanceof Boolean) { if (IS_WRAPTEXT_ENABLED.equals(property)) { boolean wrapTextFlag = Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, WrapTextPreferencePage.ENABLE_WRAP_TEXT, true, null); return expectedValue.equals(wrapTextFlag); } else if (IS_AUTO_RESIZE_CELL_HEIGHT_ENABLED.equals(property)) { boolean autoResizeCellHeightFlag = Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, WrapTextPreferencePage.ENABLE_AUTO_RESIZE_CELL_HEIGHT, true, null); return expectedValue.equals(autoResizeCellHeightFlag); } } return false; }
Source:
public void onDraw(Canvas canvas) { if (currentImage.get() != null) { currentImage.get().onDraw(canvas); } }

Target:
public void onDraw(Canvas canvas) { if (images.get(index) != null) { images.get(index).onDraw(canvas); } }
Source:
public static void main(String[] args) { Map<String, Object> conf = ConfigUtils.readStormConfig(); try { Supervisor supervisor = new Supervisor(conf, null, new MesosSupervisor()); supervisor.launch(); } catch (Exception e) { String msg = String.format("main: Exception: %s", e.getMessage()); LOG.error(msg); e.printStackTrace(); } }

Target:
public static void main(String[] args) { Map<String, Object> conf = ConfigUtils.readStormConfig(); try { Supervisor supervisor = new Supervisor(conf, null, new MesosSupervisor()); Method m = Supervisor.class.getDeclaredMethod("launchDaemon"); m.setAccessible(true); m.invoke(supervisor); } catch (Exception e) { String msg = String.format("main: Exception: %s", e.getMessage()); LOG.error(msg); e.printStackTrace(); } }
Source:
private Function<CircuitBreakerEvent, String> getCircuitBreakerEventStringFunction() { ObjectMapper jsonMapper = new ObjectMapper(); return cbEvent -> { try { return jsonMapper.writeValueAsString( CircuitBreakerEventDTOFactory.createCircuitBreakerEventDTO(cbEvent) ); } catch (JsonProcessingException e) { } return ""; }; }

Target:
private Function<CircuitBreakerEvent, String> getCircuitBreakerEventStringFunction() { return cbEvent -> { try { return jsonMapper.writeValueAsString( CircuitBreakerEventDTOFactory.createCircuitBreakerEventDTO(cbEvent) ); } catch (JsonProcessingException e) { } return ""; }; }
Source:
protected <R extends HttpRequest> R createRequest(R fromRequest, String payload) { fromRequest.setPayload(payload); fromRequest.getPayload().getContentMetadata().setContentType(MediaType.TEXT_XML); return fromRequest; }

Target:
protected <R extends HttpRequest> R createRequest(R fromRequest, String payload) { MutableContentMetadata metadata = new BaseMutableContentMetadata(); metadata.setContentType(MediaType.TEXT_XML); metadata.setContentLength(Long.valueOf(payload.getBytes().length)); fromRequest.setPayload(payload); fromRequest.getPayload().setContentMetadata(metadata); return fromRequest; }
Source:
public static OMElement convertToDocument(File file) throws DataSourceException { try { OMElement documentElement = new StAXOMBuilder(new FileInputStream(file)).getDocumentElement(); return documentElement; } catch (Exception e) { throw new DataSourceException("Error in creating an XML document from file: " + e.getMessage(), e); } }

Target:
public static Document convertToDocument(File file) throws DataSourceException { try { DocumentBuilder db = dbf.newDocumentBuilder(); return db.parse(file); } catch (Exception e) { throw new DataSourceException("Error in creating an XML document from file: " + e.getMessage(), e); } }
Source:
protected boolean pastThreshold() { return ((supplier.get().compareTo(threshold) >= 0) ^ invert); }

Target:
protected boolean pastThreshold() { return ((supplier.get().compareTo(threshold) >= 0) != invert); }
Source:
public Move<InvestmentSolution> next() { long transferMillis = RandomUtils.nextLong(workingRandom, InvestmentNumericUtil.MAXIMUM_QUANTITY_MILLIS) + 1L; Map.Entry<Long, AssetClassAllocation> lowerEntry = quantityMillisIncrementToAllocationMap.lowerEntry(transferMillis); Map.Entry<Long, AssetClassAllocation> ceilingEntry = quantityMillisIncrementToAllocationMap .ceilingEntry(transferMillis); transferMillis -= (lowerEntry == null ? 0L : lowerEntry.getKey()); AssetClassAllocation fromAllocation = ceilingEntry.getValue(); AssetClassAllocation toAllocation = allocationList.get(workingRandom.nextInt(allocationList.size() - 1)); if (toAllocation == fromAllocation) { toAllocation = allocationList.get(allocationList.size() - 1); } return new InvestmentQuantityTransferMove(fromAllocation, toAllocation, transferMillis); }

Target:
public InvestmentQuantityTransferMove next() { long transferMillis = RandomUtils.nextLong(workingRandom, InvestmentNumericUtil.MAXIMUM_QUANTITY_MILLIS) + 1L; Map.Entry<Long, AssetClassAllocation> lowerEntry = quantityMillisIncrementToAllocationMap.lowerEntry(transferMillis); Map.Entry<Long, AssetClassAllocation> ceilingEntry = quantityMillisIncrementToAllocationMap .ceilingEntry(transferMillis); transferMillis -= (lowerEntry == null ? 0L : lowerEntry.getKey()); AssetClassAllocation fromAllocation = ceilingEntry.getValue(); AssetClassAllocation toAllocation = allocationList.get(workingRandom.nextInt(allocationList.size() - 1)); if (toAllocation == fromAllocation) { toAllocation = allocationList.get(allocationList.size() - 1); } return new InvestmentQuantityTransferMove(fromAllocation, toAllocation, transferMillis); }
Source:
private boolean updateFloppyListFromVDSM(Guid repoStoragePoolId, Guid repoStorageDomainId) { boolean refreshFloppySucceeded = false; if (repoStorageDomainId != null) { try { VDSReturnValue returnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.GetFloppyList, new IrsBaseVDSCommandParameters(repoStoragePoolId)); @SuppressWarnings("unchecked") Map<String, Map<String, String>> isoDomainFloppyList = (Map<String, Map<String, String>>) returnValue.getReturnValue(); if (returnValue.getSucceeded() && isoDomainFloppyList != null) { refreshFloppySucceeded = refreshIsoFileListMetaData(repoStorageDomainId, repoStorageDom, isoDomainFloppyList, ImageFileType.Floppy); } log.debugFormat("The refresh process from VDSM, for Floppy files succeeded."); } catch (Exception e) { refreshFloppySucceeded = false; log.warnFormat("The refresh process from VDSM, for Floppy files failed."); log.error(e); } } return refreshFloppySucceeded; }

Target:
private boolean updateFloppyListFromVDSM(Guid repoStoragePoolId, Guid repoStorageDomainId) { boolean refreshFloppySucceeded = false; if (repoStorageDomainId != null) { try { VDSReturnValue returnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.GetFloppyList, new IrsBaseVDSCommandParameters(repoStoragePoolId)); @SuppressWarnings("unchecked") Map<String, Map<String, String>> fileStats = (Map<String, Map<String, String>>) returnValue.getReturnValue(); if (returnValue.getSucceeded() && fileStats != null) { refreshFloppySucceeded = refreshIsoFileListMetaData(repoStorageDomainId, repoStorageDom, fileStats, ImageFileType.Floppy); } log.debugFormat("The refresh process from VDSM, for Floppy files succeeded."); } catch (Exception e) { refreshFloppySucceeded = false; log.warnFormat("The refresh process from VDSM, for Floppy files failed."); log.error(e); } } return refreshFloppySucceeded; }
Source:
public final ReviewCategoryStrategy reviewCategoryStrategy() { String s = reviewCategeoryStrategyRaw(); return s != null ? ReviewCategoryStrategy.valueOf(s) : null; }

Target:
public final ReviewCategoryStrategy reviewCategoryStrategy() { String s = reviewCategeoryStrategyRaw(); return s != null ? ReviewCategoryStrategy.valueOf(s) : ReviewCategoryStrategy.NONE; }
Source:
public void testGetRangeOfTimestampsReturnsAllRows() { keyValueService.put(TEST_TABLE, ImmutableMap.of( Cell.create(row0, column0), value0_t0, Cell.create(row1, column0), value0_t0, Cell.create(row2, column0), value0_t0), TEST_TIMESTAMP); RangeRequest range = RangeRequest.all().withBatchHint(1); List<RowResult<Set<Long>>> results = ImmutableList.copyOf( keyValueService.getRangeOfTimestamps(TEST_TABLE, range, TEST_TIMESTAMP + 1)); assertEquals(3, results.size()); assertTrue(Arrays.equals(row0, results.get(0).getRowName())); assertTrue(Arrays.equals(row1, results.get(1).getRowName())); assertTrue(Arrays.equals(row2, results.get(2).getRowName())); }

Target:
public void testGetRangeOfTimestampsReturnsAllRows() { keyValueService.put(TEST_TABLE, ImmutableMap.of( Cell.create(row0, column0), value0_t0, Cell.create(row1, column0), value0_t0, Cell.create(row2, column0), value0_t0), TEST_TIMESTAMP); RangeRequest range = RangeRequest.all().withBatchHint(1); List<RowResult<Set<Long>>> results = ImmutableList.copyOf( keyValueService.getRangeOfTimestamps(TEST_TABLE, range, TEST_TIMESTAMP + 1)); assertEquals(3, results.size()); assertArrayEquals(row0, results.get(0).getRowName()); assertArrayEquals(row1, results.get(1).getRowName()); assertArrayEquals(row2, results.get(2).getRowName()); }
Source:
private synchronized long getRtt() { long rtt = mediaStream.getMediaStreamStats().getRttMs(); return (rtt > 0 && rtt < 1000) ? rtt : 1000; }

Target:
private synchronized long getRtt() { long rtt = mediaStream.getMediaStreamStats().getRttMs(); if (rtt < 0 || rtt > 1000) { logger.warn("RTT not calculated, or has a suspiciously high value (" + rtt + "). Using the default of 100ms."); rtt = 100; } return rtt; }
Source:
public static IFile findReferenceFile(ERepositoryObjectType type, Item item, String fileExtension) { IFolder folder = RepositoryResourceUtil.getFolder(type); String path = item.getState().getPath(); if (path != null && path.length() > 0) { folder = folder.getFolder(path); } Property property = item.getProperty(); String fileName = ResourceFilenameHelper.getExpectedFileName(property.getLabel(), property.getVersion()) + DOT + (fileExtension != null ? fileExtension : ""); if(type == IServerObjectRepositoryType.TYPE_WORKFLOW && exAdapter != null && fileExtension != null && fileExtension.equals("conf")) { fileName = exAdapter.getWorkflowConfigFilename(item); } IFile file = folder.getFile(fileName); return file; }

Target:
public static IFile findReferenceFile(ERepositoryObjectType type, Item item, String fileExtension) { IFolder folder = RepositoryResourceUtil.getFolder(type); String path = item.getState().getPath(); if (path != null && path.length() > 0) { folder = folder.getFolder(path); } Property property = item.getProperty(); String fileName = ResourceFilenameHelper.getExpectedFileName(property.getLabel(), property.getVersion()) + DOT + (fileExtension != null ? fileExtension : ""); if(type == IServerObjectRepositoryType.TYPE_WORKFLOW && exAdapter != null && fileExtension != null && fileExtension.equals("conf")) { fileName = exAdapter.getWorkflowConfigFilename(item); } IFile file = fileName != null?folder.getFile(fileName):null; return file; }
Source:
public void stopBlockingForTask(int id) { super.stopBlockingForTask(id); if (id == ProcessAndSendTask.SEND_PHASE_ID_NO_DIALOG || id == ProcessAndSendTask.PROCESSING_PHASE_ID_NO_DIALOG) { triggerSyncIconRefresh(TRIGGER_END_SEND_FORMS); } else if (id == DataPullTask.DATA_PULL_TASK_ID) { triggerSyncIconRefresh(TRIGGER_END_DATA_PULL); } }

Target:
public void stopBlockingForTask(int id) { super.stopBlockingForTask(id); if (id == ProcessAndSendTask.SEND_PHASE_ID_NO_DIALOG || id == ProcessAndSendTask.PROCESSING_PHASE_ID_NO_DIALOG || id == DataPullTask.DATA_PULL_TASK_ID) { triggerSyncIconRefresh(SyncIconTrigger.NO_ANIMATION); } }
Source:
public ProxyControl() { setPort(DEFAULT_PORT); setExcludeList(new HashSet<>()); setIncludeList(new HashSet<>()); setCaptureHttpHeaders(true); iNumberingStartValue = HTTP_SAMPLER_NUMBERING_START_VALUE_DEFAULT; sNumberingFormat = JMeterUtils.getPropDefault("proxy.number.value_format", HTTP_SAMPLER_NUMBERING_INTEGER_FORMAT_DEFAULT); setHttpSamplerNumberingIntegerFormat(sNumberingFormat); sNumberingMode = JMeterUtils.getPropDefault("proxy.number.mode", HTTP_SAMPLER_NUMBERING_MODE_DEFAULT); if (HttpSamplerNumberingMode.PREFIX.getStringMode().equals(sNumberingMode)) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.PREFIX.getIntValue()); } if (HttpSamplerNumberingMode.SUFFIX.getStringMode().equals(sNumberingMode)) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.SUFFIX.getIntValue()); } boolean bWihtNumber = JMeterUtils.getPropDefault("proxy.number.requests", true); if (!bWihtNumber) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.NO_NUMBER.getIntValue()); } }

Target:
public ProxyControl() { setPort(DEFAULT_PORT); setExcludeList(new HashSet<>()); setIncludeList(new HashSet<>()); setCaptureHttpHeaders(true); iNumberingStartValue = HTTP_SAMPLER_NUMBERING_START_VALUE_DEFAULT; sNumberingFormat = JMeterUtils.getPropDefault("proxy.number.value_format", HTTP_SAMPLER_NUMBERING_INTEGER_FORMAT_DEFAULT); setHttpSamplerNumberingIntegerFormat(sNumberingFormat); sNumberingMode = JMeterUtils.getPropDefault("proxy.number.mode", HTTP_SAMPLER_NUMBERING_MODE_DEFAULT); if (HttpSamplerNumberingMode.PREFIX.getStringMode().equals(sNumberingMode)) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.PREFIX.getIntValue()); } else if (HttpSamplerNumberingMode.SUFFIX.getStringMode().equals(sNumberingMode)) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.SUFFIX.getIntValue()); } boolean bWihtNumber = JMeterUtils.getPropDefault("proxy.number.requests", true); if (!bWihtNumber) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.NO_NUMBER.getIntValue()); } }
Source:
public void waitForAttribute() throws Exception { iface.go("file://"+ System.getProperty("user.dir")+"/resources/html/test/blinking.html"); WebDriverElement text = iface.getWebDriverElement(new Hook(Strategy.ID, "p1")); text.click(); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "hidden", true, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "hidden", false, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "normal", false, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "normal", false, 10) != null); }

Target:
public void waitForAttribute() throws Exception { iface.go("file://"+ System.getProperty("user.dir")+"/resources/html/test/blinking.html"); WebDriverElement text = iface.getWebDriverElement(new Hook(Strategy.ID, "p1")); text.click(); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "hidden", true, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "hidden", false, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "normal", false, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "normal", true, 10) != null); }
Source:
private final void initializeTemplate(MrrtReportTemplate template, Document doc) throws ParseException { final Elements metaTags = doc.getElementsByTag("meta"); template.setPath(doc.baseUri()); template.setCharset(metaTags.attr("charset")); for (Element metaTag : metaTags) { final String name = metaTag.attr("name"); final String content = metaTag.attr("content"); switch (name) { case DCTERMS_TITLE: template.setDcTermsTitle(content); break; case DCTERMS_DESCRIPTION: template.setDcTermsDescription(content); break; case DCTERMS_IDENTIFIER: template.setDcTermsIdentifier(content); break; case DCTERMS_TYPE: template.setDcTermsType(content); break; case DCTERMS_LANGUAGE: template.setDcTermsLanguage(content); break; case DCTERMS_PUBLISHER: template.setDcTermsPublisher(content); break; case DCTERMS_RIGHTS: template.setDcTermsRights(content); break; case DCTERMS_LICENSE: template.setDcTermsLicense(content); break; case DCTERMS_DATE: template.setDcTermsDate(new SimpleDateFormat(MrrtReportTemplateConstants.DATE_FORMAT).parse(content)); break; case DCTERMS_CREATOR: template.setDcTermsCreator(content); break; default: log.debug("Unhandled meta tag " + name); } } }

Target:
private final void initializeTemplate(MrrtReportTemplate template, Document doc) throws ParseException { final Elements metaTags = doc.getElementsByTag("meta"); template.setPath(doc.baseUri()); template.setCharset(metaTags.attr("charset")); for (Element metaTag : metaTags) { final String name = metaTag.attr("name"); final String content = metaTag.attr("content"); switch (name) { case DCTERMS_TITLE: template.setDcTermsTitle(content); break; case DCTERMS_DESCRIPTION: template.setDcTermsDescription(content); break; case DCTERMS_IDENTIFIER: template.setDcTermsIdentifier(content); break; case DCTERMS_TYPE: template.setDcTermsType(content); break; case DCTERMS_LANGUAGE: template.setDcTermsLanguage(content); break; case DCTERMS_PUBLISHER: template.setDcTermsPublisher(content); break; case DCTERMS_RIGHTS: template.setDcTermsRights(content); break; case DCTERMS_LICENSE: template.setDcTermsLicense(content); break; case DCTERMS_DATE: parseDcTermsDate(template, content); break; case DCTERMS_CREATOR: template.setDcTermsCreator(content); break; default: log.debug("Unhandled meta tag " + name); } } }
Source:
public boolean equals(final Object o) { if (this == o) { return true; } else if (o == null || getClass() != o.getClass()) { return false; } final RankedClient other = (RankedClient) o; return clientId == other.clientId() && rank == other.rank(); }

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final RankedClient<?> that = (RankedClient<?>) o; return rank == that.rank && Objects.equals(clientId, that.clientId); }
Source:
public void ratioTest() throws Exception { String[] statNames = {"Cache:HitRatio", "Clustered:HitRatio", "Cache:MissRatio", "Clustered:MissRatio"}; sendManagementCallToCollectStats(statNames); Thread.sleep(3000); Cache<String, String> cache = cacheManager.getCache("dedicated-cache-1", String.class, String.class); cache.put("one", "val1"); cache.put("two", "val2"); cache.get("one"); cache.get("two"); cache.get("three"); cache.get("four"); Double[] ratios = new Double[statNames.length]; do { List<ContextualStatistics> stats = waitForNextStats() .stream() .filter(statistics -> "dedicated-cache-1".equals(statistics.getContext().get("cacheName"))) .collect(Collectors.toList()); for (ContextualStatistics stat : stats) { for (int i = 0; i < statNames.length; i++) { String statName = statNames[i]; Sample<Double>[] samples = stat.getStatistic(RatioHistory.class, statName).getValue(); ratios[i] = samples.length > 0 ? samples[samples.length - 1].getValue() : 0d; } } } while (!Thread.currentThread().isInterrupted() && !Arrays.equals(ratios, new Double[]{.5d, .5d, .5d, .5d})); assertThat(ratios, is(array(equalTo(.5d), equalTo(.5d), equalTo(.5d), equalTo(.5d)))); }

Target:
public void ratioTest() throws Exception { String[] statNames = {"Cache:HitRatio", "Clustered:HitRatio", "Cache:MissRatio", "Clustered:MissRatio"}; sendManagementCallToCollectStats(statNames); Thread.sleep(25000); Cache<String, String> cache = cacheManager.getCache("dedicated-cache-1", String.class, String.class); cache.put("one", "val1"); cache.put("two", "val2"); cache.get("one"); cache.get("two"); cache.get("three"); cache.get("four"); Double[] ratios = new Double[statNames.length]; do { List<ContextualStatistics> stats = waitForNextStats() .stream() .filter(statistics -> "dedicated-cache-1".equals(statistics.getContext().get("cacheName"))) .collect(Collectors.toList()); for (ContextualStatistics stat : stats) { for (int i = 0; i < statNames.length; i++) { String statName = statNames[i]; Sample<Double>[] samples = stat.getStatistic(RatioHistory.class, statName).getValue(); ratios[i] = samples.length > 0 ? samples[samples.length - 1].getValue() : 0d; } } } while (!Thread.currentThread().isInterrupted() && !Arrays.equals(ratios, new Double[]{.5d, .5d, .5d, .5d})); assertThat(ratios, is(array(equalTo(.5d), equalTo(.5d), equalTo(.5d), equalTo(.5d)))); }
Source:
public InputStream getStream() throws IOException { try { URI uri = new URI(encodeUriParts(getSourcePath())); if (channel == null || channel.isClosed()) { channel = getSessionForHost(uri).openChannel("sftp"); channel.connect(); } ChannelSftp sftpChannel = (ChannelSftp) channel; currentStream = sftpChannel.get(decodeUriParts(uri.getRawPath())); return currentStream; } catch (URISyntaxException ex) { throw new IOException("Bad URI format", ex); } catch (JSchException ex) { throw new IOException("Error with connection", ex); } catch (SftpException ex) { throw new IOException("Error retrieving file", ex); } }

Target:
public InputStream getStream() throws IOException { try { URI uri = new URI(encodeUriParts(getSourcePath())); if (channel == null || channel.isClosed()) { channel = getSessionForHost(uri).openChannel("sftp"); channel.connect(); } ChannelSftp sftpChannel = (ChannelSftp) channel; currentStream = sftpChannel.get(decodeUriParts(uri.getRawPath())); return currentStream; } catch (URISyntaxException ex) { String msg = String.format("Bad URI format for %s", getSourcePath()); LOG.error(msg,ex); throw new IOException(msg,ex); } catch (JSchException ex) { LOG.error("Error with connection",ex); throw new IOException("Error with connection", ex); } catch (SftpException ex) { LOG.error("Error while retrieving file",ex); throw new IOException("Error retrieving file", ex); } }
Source:
public void emit(Event event) { if (event instanceof ServiceMetricEvent) { ServiceMetricEvent metricEvent = (ServiceMetricEvent) event; try { eventsQueue.put(metricEvent); } catch (InterruptedException exception) { log.error(exception.toString()); Thread.currentThread().interrupt(); } } }

Target:
public void emit(Event event) { if (event instanceof ServiceMetricEvent) { ServiceMetricEvent metricEvent = (ServiceMetricEvent) event; try { eventsQueue.put(metricEvent); } catch (InterruptedException exception) { log.error(exception, "Failed to add metricEvent to events queue."); Thread.currentThread().interrupt(); } } }
Source:
private static Map<String, String> retrieveComponentProperties(String componentId, Map<String, String> componentProperties) { String prefix = getComponentPrefix(componentId); return componentProperties.entrySet() .stream().filter(e -> e.getKey().startsWith(prefix)) .collect(toMap(e -> removeComponentPrefix(componentId, e.getKey()), Map.Entry::getValue)); }

Target:
private Map<String, String> retrieveComponentProperties(String componentId, Map<String, String> componentProperties) { String prefix = getComponentPrefix(componentId); return componentProperties.entrySet() .stream().filter(e -> e.getKey().startsWith(prefix)) .collect(toMap(e -> removeComponentPrefix(componentId, e.getKey()), Map.Entry::getValue)); }
Source:
public static String linkify(String url, boolean newTab) { if (isHttpUri(url)) { try { URL old = new URL(url); URI constructed = new URI(old.getProtocol(), old.getUserInfo(), old.getHost(), old.getPort(), old.getPath(), old.getQuery(), old.getRef()); return String.format("<a href=\"%s\"%s title=\"Link to %s\">%s</a>", constructed.toString(), newTab ? " target=\"_blank\"" : "", Util.encode(url), Util.htmlize(url) ); } catch (MalformedURLException | URISyntaxException ex) { return url; } } return url; }

Target:
public static String linkify(String url, boolean newTab) { if (isHttpUri(url)) { try { return String.format("<a href=\"%s\"%s title=\"Link to %s\">%s</a>", Util.encodeURL(url), newTab ? " target=\"_blank\"" : "", Util.encode(url), Util.htmlize(url) ); } catch (MalformedURLException | URISyntaxException ex) { return url; } } return url; }
Source:
private void addServlet(HelixRestNamespace namespace, ServletType servletType) { String resourceConfigMapKey = String.format("%s_%s", servletType.name(), namespace.getName()); if (_resourceConfigMap.containsKey(resourceConfigMapKey)) { throw new IllegalArgumentException( String.format("Duplicated namespace name \"%s\"", namespace.getName())); } ResourceConfig config = getResourceConfig(namespace, servletType); _resourceConfigMap.put(resourceConfigMapKey, config); String path = servletType.getServletPath(namespace); LOG.info("Initializing Servlet on path: " + path); System.out.println("Initializing Servlet on path: " + path); _servletContextHandler.addServlet(new ServletHolder(new ServletContainer(config)), path); }

Target:
private void addServlet(HelixRestNamespace namespace, ServletType servletType) { String resourceConfigMapKey = String.format("%s_%s", servletType.name(), namespace.getName()); if (_resourceConfigMap.containsKey(resourceConfigMapKey)) { throw new IllegalArgumentException( String.format("Duplicated namespace name \"%s\"", namespace.getName())); } ResourceConfig config = getResourceConfig(namespace, servletType); _resourceConfigMap.put(resourceConfigMapKey, config); String path = servletType.getServletPath(namespace); LOG.info("Initializing Servlet on path: " + path); _servletContextHandler.addServlet(new ServletHolder(new ServletContainer(config)), path); }
Source:
public AggregateSnapshotter(EventStore eventStore, List<AggregateFactory<?>> aggregateFactories, ParameterResolverFactory parameterResolverFactory) { this(eventStore, aggregateFactories, parameterResolverFactory, new ClasspathHandlerDefinition(Thread.currentThread().getContextClassLoader())); }

Target:
public AggregateSnapshotter(EventStore eventStore, List<AggregateFactory<?>> aggregateFactories, ParameterResolverFactory parameterResolverFactory) { this(eventStore, aggregateFactories, parameterResolverFactory, ClasspathHandlerDefinition.forClassLoader( aggregateFactories.isEmpty() ? Thread.currentThread().getContextClassLoader() : aggregateFactories.get(0).getClass().getClassLoader()), null); }
Source:
public GetDataSystemIdentifierDto(final int id, final String systemType, final List<MeasurementDto> measurements, final List<ProfileDto> profiles) { super(id, systemType); this.measurements = measurements; this.profiles = profiles; }

Target:
public GetDataSystemIdentifierDto(final int id, final String systemType, final List<MeasurementDto> measurements, final List<ProfileDto> profiles) { super(id, systemType); this.measurements = new ArrayList<>(measurements); this.profiles = new ArrayList<>(profiles); }
Source:
public PostAggregator toPostAggregator( PlannerContext plannerContext, RowSignature rowSignature, RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor ) { final List<RexNode> operands = ((RexCall) rexNode).getOperands(); final List<PostAggregator> inputPostAggs = new ArrayList<>(); Integer size = null; int operandCounter = 0; for (RexNode operand : operands) { final PostAggregator convertedPostAgg = OperatorConversions.toPostAggregator( plannerContext, rowSignature, operand, postAggregatorVisitor ); if (convertedPostAgg == null) { if (operandCounter == 0) { try { size = RexLiteral.intValue(operand); } catch (RuntimeException re) { return null; } } else { return null; } } else { inputPostAggs.add(convertedPostAgg); operandCounter++; } } return new SketchSetPostAggregator( postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), getSetOperationName(), size, inputPostAggs ); }

Target:
public PostAggregator toPostAggregator( PlannerContext plannerContext, RowSignature rowSignature, RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor ) { final List<RexNode> operands = ((RexCall) rexNode).getOperands(); final List<PostAggregator> inputPostAggs = new ArrayList<>(); Integer size = null; int operandCounter = 0; for (RexNode operand : operands) { final PostAggregator convertedPostAgg = OperatorConversions.toPostAggregator( plannerContext, rowSignature, operand, postAggregatorVisitor ); if (convertedPostAgg == null) { if (operandCounter == 0) { try { if (!operand.isA(SqlKind.LITERAL)) { return null; } size = RexLiteral.intValue(operand); } catch (ClassCastException cce) { return null; } } else { return null; } } else { inputPostAggs.add(convertedPostAgg); operandCounter++; } } return new SketchSetPostAggregator( postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), getSetOperationName(), size, inputPostAggs ); }
Source:
protected Object[][] retrieveStatsRows(boolean interval) { Iterator<Object> i = getStatsRowKeyIterator(interval); ArrayList<Object[]> rows = new ArrayList<Object[]>(); while (i.hasNext()) { Object rowKey = i.next(); Object rowValues[] = new Object[columns.size()]; updateStatsRow(rowKey, rowValues); rows.add(rowValues); } return rows.toArray(new Object[0][]); }

Target:
protected Object[][] retrieveStatsRows(boolean interval) { Iterator<Object> i = getStatsRowKeyIterator(interval); ArrayList<Object[]> rows = new ArrayList<Object[]>(); while (i.hasNext()) { Object rowKey = i.next(); Object rowValues[] = new Object[columns.size()]; updateStatsRow(rowKey, rowValues); rows.add(rowValues); } return rows.toArray(new Object[rows.size()][]); }
Source:
public static ServerRequest groupUpdateVisibilityRequest(Id sender, Id groupId, Group.GroupVisibility newVisibility) { Objects.requireNonNull(sender); Objects.requireNonNull(groupId); Objects.requireNonNull(newVisibility); RequestBuilder builder = new RequestBuilder(ServiceRequest.RequestKind .GROUPUPDATEVISIBILITY, sender); builder.addField(Fields.GID, groupId); builder.addField(Fields.VISIBILITY, newVisibility); return builder.request(); }

Target:
public static ServerRequest groupUpdateVisibilityRequest(Id sender, Id groupId, Group.GroupVisibility newVisibility) { Objects.requireNonNull(sender); Objects.requireNonNull(groupId); Objects.requireNonNull(newVisibility); RequestBuilder builder = new RequestBuilder(ServiceRequest.RequestKind .GROUP_UPDATE_VISIBILITY, sender); builder.addField(Fields.GID, groupId); builder.addField(Fields.VISIBILITY, newVisibility); return builder.request(); }
Source:
private URL buildURL(URL serverUrl, String path, Map<String, Object> queryParameters, XWikiContext context) { try { URIBuilder uriBuilder = new URIBuilder(serverUrl.toURI()).setPath(path); for (Map.Entry<String, Object> queryParameter : queryParameters.entrySet()) { String key = queryParameter.getKey(); Object paramValue = queryParameter.getValue(); if (paramValue instanceof String) { uriBuilder.addParameter(key, (String) paramValue); } else if (paramValue instanceof String[]) { for (String paramValueElement : (String[]) paramValue) { uriBuilder.addParameter(key, paramValueElement); } } else if (paramValue instanceof Collection) { for (Object paramValueElement : (Collection) paramValue) { uriBuilder.addParameter(key, paramValueElement.toString()); } } else { uriBuilder.addParameter(key, paramValue.toString()); } } return normalizeURL(uriBuilder.build().toURL(), context); } catch (MalformedURLException | URISyntaxException e) { return null; } }

Target:
private URL buildURL(URL serverUrl, String path, Map<String, Object> queryParameters, XWikiContext context) { try { URL resultUrl = new URL(serverUrl, path); if (!queryParameters.isEmpty()) { StringBuilder stringBuilder = new StringBuilder(resultUrl.toExternalForm()); stringBuilder.append('?'); int parametersSize = queryParameters.size(); int currentIndex = 0; for (Map.Entry<String, Object> queryParameter : queryParameters.entrySet()) { String key = queryParameter.getKey(); Object paramValue = queryParameter.getValue(); appendQueryParameter(key, paramValue, stringBuilder); if (currentIndex < parametersSize - 1) { stringBuilder.append("&"); } currentIndex++; } resultUrl = new URL(stringBuilder.toString()); } return normalizeURL(resultUrl, context); } catch (MalformedURLException|UnsupportedEncodingException e) { return null; } }
Source:
public void testSanitiseReplicationFactorPassesForTheKeyspace() { clientPool.run(client -> { try { CassandraVerifier.currentRfOnKeyspaceMatchesDesiredRf(client, CassandraContainer.KVS_CONFIG, false); } catch (TException e) { fail(); } return false; }); }

Target:
public void testSanitiseReplicationFactorPassesForTheKeyspace() { clientPool.run(client -> { try { CassandraVerifier.currentRfOnKeyspaceMatchesDesiredRf(client, CassandraContainer.KVS_CONFIG, false); } catch (TException e) { fail("currentRf On Keyspace does not Match DesiredRf"); } return false; }); }
Source:
public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(enabled); out.writeOptionalString(terms); if (out.getVersion().onOrAfter(Version.V_7_9_0)) { out.writeBoolean(annotationsEnabled); } }

Target:
public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(enabled); out.writeOptionalString(terms); out.writeBoolean(annotationsEnabled); }
Source:
public <T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit) { if (target.equals(address) && deliverOrder != DeliverOrder.TOTAL) { return CompletableFuture.completedFuture(collector.finish()); } long requestId = requests.newRequestId(); logRequest(requestId, command, target); SingleTargetRequest<T> request = new SingleTargetRequest<>(collector, requestId, requests, target); addRequest(request); boolean checkView = request.onNewView(clusterView.getMembersSet()); sendCommand(target, command, requestId, deliverOrder, isRsvpCommand(command), true, checkView); if (timeout > 0) { request.setTimeout(timeoutExecutor, timeout, unit); } return request; }

Target:
public <T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit) { if (target.equals(address) && deliverOrder != DeliverOrder.TOTAL) { return CompletableFuture.completedFuture(collector.finish()); } long requestId = requests.newRequestId(); logRequest(requestId, command, target); SingleTargetRequest<T> request = new SingleTargetRequest<>(collector, requestId, requests, target); addRequest(request); boolean invalidTarget = request.onNewView(clusterView.getMembersSet()); if (!invalidTarget) { sendCommand(target, command, requestId, deliverOrder, isRsvpCommand(command), true, false); } if (timeout > 0) { request.setTimeout(timeoutExecutor, timeout, unit); } return request; }
Source:
private static Artifact getRelatedArtifact(Artifact artifact, IRelationType relationType, RelationSide relationSide) throws OseeCoreException { List<Artifact> artifacts = getRelatedArtifactsUnSorted(artifact, relationType, relationSide); if (artifacts.isEmpty()) { throw new ArtifactDoesNotExist("There is no artifact related to [(%s) %s] by a relation of type [%s]", artifact.getArtId(), artifact, relationType); } if (artifacts.size() > 1) { throw new MultipleArtifactsExist( "There are %s artifacts related to (%s) \"%s\" by a relation of type \"%s\" on side %s instead of the expected 1.", artifacts.size(), artifact.getArtId(), artifact, relationType, relationSide); } return artifacts.get(0); }

Target:
private static Artifact getRelatedArtifact(Artifact artifact, IRelationType relationType, RelationSide relationSide) throws OseeCoreException { List<Artifact> artifacts = getRelatedArtifactsUnSorted(artifact, relationType, relationSide); if (artifacts.isEmpty()) { throw new ArtifactDoesNotExist("There is no artifact related to [%s] by a relation of type [%s]", artifact.toStringWithId(), relationType); } if (artifacts.size() > 1) { throw new MultipleArtifactsExist( "There are %s artifacts related to \"%s\" by a relation of type \"%s\" on side %s instead of the expected 1.", artifacts.size(), artifact.toStringWithId(), relationType, relationSide); } return artifacts.get(0); }
Source:
public Option<Command> localChangesAboutToCommit(Collection<Notification> notifications) { Command result = null; if (needsRefresh() && !disable) { boolean impactingNotification = isImpactingNotification(notifications); if (impactingNotification || !representationsToForceRefresh.isEmpty()) { Option<? extends Command> optionCommand = getRefreshOpennedRepresentationsCommand(impactingNotification); if (optionCommand.some()) { result = optionCommand.get(); } } } disable = false; setForceRefresh(false); representationsToForceRefresh.clear(); return Options.newSome(result); }

Target:
public Option<Command> localChangesAboutToCommit(Collection<Notification> notifications) { Command result = null; if (!disabled && needsRefresh()) { boolean impactingNotification = isImpactingNotification(notifications); if (impactingNotification || !representationsToForceRefresh.isEmpty()) { Option<? extends Command> optionCommand = getRefreshOpennedRepresentationsCommand(impactingNotification); if (optionCommand.some()) { result = optionCommand.get(); } } setForceRefresh(false); representationsToForceRefresh.clear(); } disabled = false; return Options.newSome(result); }
Source:
public void testDeleteRecursive() throws IOException { File f1 = new File(trash, "test/test/a"); assertTrue(f1.getParentFile().mkdirs()); FileUtils.createNewFile(f1); File f2 = new File(trash, "test/test/b"); FileUtils.createNewFile(f2); File d = new File(trash, "test"); FileUtils.delete(d, FileUtils.RECURSIVE); assertFalse(d.exists()); try { FileUtils.delete(d, FileUtils.RECURSIVE); fail("recursive deletion of non-existing directory must fail"); } catch (IOException e) { } try { FileUtils.delete(d, FileUtils.RECURSIVE | FileUtils.SKIP_MISSING); } catch (IOException e) { fail("recursive deletion of non-existing directory must not fail with option SKIP_MISSING"); } }

Target:
public void testDeleteRecursive() throws IOException { File f1 = new File(trash, "test/test/a"); FileUtils.mkdirs(f1.getParentFile()); FileUtils.createNewFile(f1); File f2 = new File(trash, "test/test/b"); FileUtils.createNewFile(f2); File d = new File(trash, "test"); FileUtils.delete(d, FileUtils.RECURSIVE); assertFalse(d.exists()); try { FileUtils.delete(d, FileUtils.RECURSIVE); fail("recursive deletion of non-existing directory must fail"); } catch (IOException e) { } try { FileUtils.delete(d, FileUtils.RECURSIVE | FileUtils.SKIP_MISSING); } catch (IOException e) { fail("recursive deletion of non-existing directory must not fail with option SKIP_MISSING"); } }