auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void close() throws ZkInterruptedException { if (LOG.isTraceEnabled()) { StackTraceElement[] calls = Thread.currentThread().getStackTrace(); LOG.trace("zkclient closing a zkclient. callStack: ", this._uid, Arrays.asList(calls)); } getEventLock().lock(); IZkConnection connection = getConnection(); try { if (connection == null || _closed) { return; } setShutdownTrigger(true); if (_asyncCallRetryThread != null) { _asyncCallRetryThread.interrupt(); _asyncCallRetryThread.join(2000); } _eventThread.interrupt(); _eventThread.join(2000); if (isManagingZkConnection()) { LOG.info("zkclient{}, Closing zkclient zk: ", this._uid, ((ZkConnection) connection).getZookeeper()); connection.close(); } _closed = true; setCurrentState(null); getEventLock().getStateChangedCondition().signalAll(); } catch (InterruptedException e) { if (connection != null) { try { Thread.interrupted(); if (isManagingZkConnection()) { connection.close(); } Thread.currentThread().interrupt(); } catch (InterruptedException e1) { throw new ZkInterruptedException(e1); } } } finally { getEventLock().unlock(); if (_monitor != null) { _monitor.unregister(); } LOG.info("Zkclient Closed zkclient", this._uid); } }

Target:
public void close() throws ZkInterruptedException { if (LOG.isTraceEnabled()) { StackTraceElement[] calls = Thread.currentThread().getStackTrace(); LOG.trace("Closing a zkclient uid:{}, callStack: ", _uid, Arrays.asList(calls)); } getEventLock().lock(); IZkConnection connection = getConnection(); try { if (connection == null || _closed) { return; } setShutdownTrigger(true); if (_asyncCallRetryThread != null) { _asyncCallRetryThread.interrupt(); _asyncCallRetryThread.join(2000); } _eventThread.interrupt(); _eventThread.join(2000); if (isManagingZkConnection()) { LOG.info("Closing zkclient uid:{}, zk:{}", _uid, ((ZkConnection) connection).getZookeeper()); connection.close(); } _closed = true; setCurrentState(null); getEventLock().getStateChangedCondition().signalAll(); } catch (InterruptedException e) { if (connection != null) { try { Thread.interrupted(); if (isManagingZkConnection()) { connection.close(); } Thread.currentThread().interrupt(); } catch (InterruptedException e1) { throw new ZkInterruptedException(e1); } } } finally { getEventLock().unlock(); if (_monitor != null) { _monitor.unregister(); } LOG.info("Closed zkclient with uid:{}", _uid); } }
Source:
private ColumnType getColumnTypeFromRow(final Row currentRow, int index) { if (currentRow.getCell(index) == null) { return ColumnType.STRING; } else { CellType cellType = currentRow.getCell(index).getCellType(); switch (cellType) { case NUMERIC: if (DateUtil.isCellDateFormatted(currentRow.getCell(index))) { return ColumnType.DATE; } else { return (currentRow.getCell(index).getNumericCellValue() % 1 == 0) ? ColumnType.INTEGER : ColumnType.DOUBLE; } case BOOLEAN: return ColumnType.BOOLEAN; case ERROR: case _NONE: case STRING: case FORMULA: case BLANK: default: return ColumnType.STRING; } } }

Target:
protected ColumnType getColumnTypeFromRow(final Row currentRow, int index) { if (currentRow.getCell(index) == null) { return ColumnType.STRING; } else { switch (currentRow.getCell(index).getCellType()) { case NUMERIC: if (DateUtil.isCellDateFormatted(currentRow.getCell(index))) { return ColumnType.DATE; } else { return (currentRow.getCell(index).getNumericCellValue() % 1 == 0) ? ColumnType.INTEGER : ColumnType.DOUBLE; } case BOOLEAN: return ColumnType.BOOLEAN; case ERROR: case _NONE: case STRING: case FORMULA: case BLANK: default: return ColumnType.STRING; } } }
Source:
public void readData(ObjectDataInput in) throws IOException { version = in.readLong(); hits = in.readLong(); ttl = in.readLong(); creationTime = in.readLong(); lastAccessTime = in.readLong(); lastUpdateTime = in.readLong(); maxIdle = in.readLong(); boolean statsEnabled = in.readBoolean(); lastStoredTime = statsEnabled ? in.readLong() : NOT_AVAILABLE; expirationTime = statsEnabled ? in.readLong() : NOT_AVAILABLE; }

Target:
public void readData(ObjectDataInput in) throws IOException { version = in.readLong(); hits = in.readLong(); ttl = in.readLong(); creationTime = in.readLong(); lastAccessTime = in.readLong(); lastUpdateTime = in.readLong(); boolean statsEnabled = in.readBoolean(); lastStoredTime = statsEnabled ? in.readLong() : NOT_AVAILABLE; expirationTime = statsEnabled ? in.readLong() : NOT_AVAILABLE; if (in.getVersion().isGreaterOrEqual(V3_11)) { maxIdle = in.readLong(); } }
Source:
private String getHeadName(Ref head) { String headName; if (head.isSymbolic()) headName = head.getTarget().getName(); else headName = head.getObjectId().getName(); return headName; }

Target:
private static String getHeadName(Ref head) { String headName; if (head.isSymbolic()) headName = head.getTarget().getName(); else headName = head.getObjectId().getName(); return headName; }
Source:
private void maintenance() { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().maintenanceStorageDomainsTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToPlaceFollowingStorageDomainsIntoMaintenanceModeMsg()); model.setHashName("maintenance_storage_domain"); setWindow(model); boolean isDataDomain = true; List<String> items = new ArrayList<>(); for (Object selected : getSelectedItems()) { items.add(((StorageDomain) selected).getName()); isDataDomain = ((StorageDomain) selected).getStorageDomainType().isDataDomain(); } model.setItems(items); if (isDataDomain) { model.getForce().setIsAvailable(true); } model.getForce().setIsChangeable(true); model.getForce().setEntity(false); model.setForceLabel(ConstantsManager.getInstance().getConstants().ignoreOVFUpdateFailure()); UICommand maintenance = UICommand.createDefaultOkUiCommand("OnMaintenance", this); model.getCommands().add(maintenance); UICommand cancel = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(cancel); }

Target:
private void maintenance() { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().maintenanceStorageDomainsTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToPlaceFollowingStorageDomainsIntoMaintenanceModeMsg()); model.setHashName("maintenance_storage_domain"); setWindow(model); boolean isDataDomain = false; List<String> items = new ArrayList<>(getSelectedItems().size()); for (StorageDomain selected : getSelectedItems()) { items.add(selected.getName()); isDataDomain |= selected.getStorageDomainType().isDataDomain(); } model.setItems(items); model.getForce().setIsAvailable(isDataDomain); model.getForce().setIsChangeable(isDataDomain); model.getForce().setEntity(false); model.setForceLabel(ConstantsManager.getInstance().getConstants().ignoreOVFUpdateFailure()); UICommand maintenance = UICommand.createDefaultOkUiCommand("OnMaintenance", this); model.getCommands().add(maintenance); UICommand cancel = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(cancel); }
Source:
public boolean leave() throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException { HashMap<Jid, MUCLightAffiliation> affiliations = new HashMap<>(); affiliations.put(connection.getUser(), MUCLightAffiliation.none); MUCLightChangeAffiliationsIQ changeAffiliationsIQ = new MUCLightChangeAffiliationsIQ(room, affiliations); StanzaFilter responseFilter = new AndFilter(FromMatchesFilter.createBare(room.asDomainBareJid()), new StanzaTypeFilter(IQ.class)); IQ responseIq = connection.createPacketCollectorAndSend(responseFilter, changeAffiliationsIQ) .nextResultOrThrow(); boolean roomLeft = responseIq.getType().equals(IQ.Type.result); if (roomLeft) { removeConnectionCallbacks(); } return roomLeft; }

Target:
public void leave() throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException { HashMap<Jid, MUCLightAffiliation> affiliations = new HashMap<>(); affiliations.put(connection.getUser(), MUCLightAffiliation.none); MUCLightChangeAffiliationsIQ changeAffiliationsIQ = new MUCLightChangeAffiliationsIQ(room, affiliations); IQ responseIq = connection.createPacketCollectorAndSend(changeAffiliationsIQ).nextResultOrThrow(); boolean roomLeft = responseIq.getType().equals(IQ.Type.result); if (roomLeft) { removeConnectionCallbacks(); } }
Source:
TypeDeclarationNode indexSignatureType( TypeDeclarationNode keyType, TypeDeclarationNode valueType) { TypeDeclarationNode node = new TypeDeclarationNode(Token.INDEX_SIGNATURE); TypeDeclarationNode first = null; switch (keyType.getToken()) { case STRING_TYPE: first = new TypeDeclarationNode(Token.STRING_KEY, "s"); break; case NUMBER_TYPE: first = new TypeDeclarationNode(Token.STRING_KEY, "n"); break; default: break; } if (null != first) { first.setDeclaredTypeExpression(keyType); node.addChildToBack(first); } node.setDeclaredTypeExpression(valueType); return node; }

Target:
TypeDeclarationNode indexSignatureType( TypeDeclarationNode keyType, TypeDeclarationNode valueType) { TypeDeclarationNode node = new TypeDeclarationNode(Token.INDEX_SIGNATURE); TypeDeclarationNode first = null; first = new TypeDeclarationNode(Token.STRING_KEY, "key"); first.setDeclaredTypeExpression(keyType); node.addChildToBack(first); node.setDeclaredTypeExpression(valueType); return node; }
Source:
public static void beforeClass() throws UnknownHostException, MalformedURLException { AppiumServiceBuilder appiumServiceBuilder = new AppiumServiceBuilder() .usingPort(4723); service = appiumServiceBuilder.build(); service.start(); InetAddress ipadd =InetAddress.getLocalHost(); String n=ipadd.toString(); String ip = n.substring(n.indexOf("/")+1); System.out.println("-------------------------------------------"); System.out.println("IP address :"+n.substring(n.indexOf("/")+1)); System.out.println(service.isRunning()); System.out.println("-------------------------------------------"); if (service == null || !service.isRunning()) { throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!"); } File appDir = new File("src/test/java/io/appium/java_client"); File app = new File(appDir, "TestApp.app.zip"); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, ""); capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "11.3"); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 8"); capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000); capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath()); driver = new IOSDriver<>(new URL("http://" + ip + ":4723/wd/hub"), capabilities); }

Target:
public static void beforeClass() throws UnknownHostException, MalformedURLException { String ipAddress = startAppiumServer(); if (service == null || !service.isRunning()) { throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!"); } File appDir = new File("src/test/java/io/appium/java_client"); File app = new File(appDir, "TestApp.app.zip"); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, ""); capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "11.3"); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 8"); capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST); capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000); capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath()); driver = new IOSDriver<>(new URL("http://" + ipAddress + ":" + PORT + "/wd/hub"), capabilities); }
Source:
protected DimensionSchema(String name) { Preconditions.checkArgument(name != null, "Dimension name cannot be null."); this.name = name; }

Target:
protected DimensionSchema(String name) { this.name = Preconditions.checkNotNull(name, "Dimension name cannot be null."); }
Source:
public void setUp() throws Exception { BasicConfigurator.configure(); executorList.clear(); executorList.add(new MockExecutorObject("Executor1",8080,50.0,2048,5,new Date(), 20, 6400)); executorList.add(new MockExecutorObject("Executor2",8080,50.0,2048,4,new Date(), 20, 6400)); executorList.add(new MockExecutorObject("Executor3",8080,40.0,2048,1,new Date(), 20, 6400)); executorList.add(new MockExecutorObject("Executor4",8080,50.0,2048,4,new Date(), 20, 6400)); executorList.add(new MockExecutorObject("Executor5",8080,50.0,1024,5,new Date(), 90, 6400)); executorList.add(new MockExecutorObject("Executor6",8080,50.0,1024,5,new Date(), 90, 3200)); executorList.add(new MockExecutorObject("Executor7",8080,50.0,1024,5,new Date(), 90, 3200)); executorList.add(new MockExecutorObject("Executor8",8080,50.0,2048,1,new Date(), 90, 3200)); executorList.add(new MockExecutorObject("Executor9",8080,50.0,2050,5,new Date(), 90, 4200)); executorList.add(new MockExecutorObject("Executor10",8080,00.0,1024,1,new Date(), 90, 3200)); executorList.add(new MockExecutorObject("Executor11",8080,20.0,2096,3,new Date(), 90, 2400)); executorList.add(new MockExecutorObject("Executor12",8080,90.0,2050,5,new Date(), 60, 2500)); Collections.shuffle(this.executorList); }

Target:
public void setUp() throws Exception { executorList.clear(); executorList.add(new MockExecutorObject("Executor1",8080,50.0,2048,5,new Date(), 20, 6400)); executorList.add(new MockExecutorObject("Executor2",8080,50.0,2048,4,new Date(), 20, 6400)); executorList.add(new MockExecutorObject("Executor3",8080,40.0,2048,1,new Date(), 20, 6400)); executorList.add(new MockExecutorObject("Executor4",8080,50.0,2048,4,new Date(), 20, 6400)); executorList.add(new MockExecutorObject("Executor5",8080,50.0,1024,5,new Date(), 90, 6400)); executorList.add(new MockExecutorObject("Executor6",8080,50.0,1024,5,new Date(), 90, 3200)); executorList.add(new MockExecutorObject("Executor7",8080,50.0,1024,5,new Date(), 90, 3200)); executorList.add(new MockExecutorObject("Executor8",8080,50.0,2048,1,new Date(), 90, 3200)); executorList.add(new MockExecutorObject("Executor9",8080,50.0,2050,5,new Date(), 90, 4200)); executorList.add(new MockExecutorObject("Executor10",8080,00.0,1024,1,new Date(), 90, 3200)); executorList.add(new MockExecutorObject("Executor11",8080,20.0,2096,3,new Date(), 90, 2400)); executorList.add(new MockExecutorObject("Executor12",8080,90.0,2050,5,new Date(), 60, 2500)); Collections.shuffle(this.executorList); }
Source:
public AnalysisPropertyDto setKey(String key) { checkArgument(key != null, "key cannot be null"); this.key = key; return this; }

Target:
public AnalysisPropertyDto setKey(String key) { requireNonNull(key, "key cannot be null"); this.key = key; return this; }
Source:
private CompletableFuture<Connection> connect() { if (selector.state() == AddressSelector.State.RESET && connection != null) { if (connectFuture != null) { return connectFuture; } connectFuture = new OrderedCompletableFuture<>(); connectFuture.whenComplete((r, e) -> connectFuture = null); Connection oldConnection = this.connection; this.connection = null; oldConnection.close(); connect(connectFuture); return connectFuture; } if (connection != null) { return CompletableFuture.completedFuture(connection); } if (connectFuture != null) { return connectFuture; } connectFuture = new OrderedCompletableFuture<>(); connectFuture.whenComplete((r, e) -> connectFuture = null); reset().connect(connectFuture); return connectFuture; }

Target:
private CompletableFuture<Connection> connect() { if (selector.state() == AddressSelector.State.RESET && connection != null) { if (connectFuture != null) { return connectFuture; } CompletableFuture<Connection> future = new OrderedCompletableFuture<>(); future.whenComplete((r, e) -> this.connectFuture = null); this.connectFuture = future; Connection oldConnection = this.connection; this.connection = null; oldConnection.close(); connect(future); return future; } if (connection != null) { return CompletableFuture.completedFuture(connection); } if (connectFuture != null) { return connectFuture; } CompletableFuture<Connection> future = new OrderedCompletableFuture<>(); future.whenComplete((r, e) -> this.connectFuture = null); this.connectFuture = future; reset().connect(future); return future; }
Source:
public AffinityGroupStatusColumn() { super(new AbstractCell<AffinityGroup>() { @Override public void render(Context context, AffinityGroup group, SafeHtmlBuilder sb, String id) { if (group == null) { return; } if (Boolean.TRUE.equals(group.getBroken())) { sb.append(cellTemplate.statusWithIconTemplate( SafeHtmlUtils.fromSafeConstant(constants.affinityGroupStatusBroken()), AbstractImagePrototype.create(resources.alertImage()).getSafeHtml(), id, "broken" )); } else { sb.append(cellTemplate.statusTemplate( SafeHtmlUtils.fromSafeConstant(constants.affinityGroupStatusOk()), id, "ok" )); } } }); }

Target:
public AffinityGroupStatusColumn() { super(new AbstractCell<AffinityGroup>() { @Override public void render(Context context, AffinityGroup group, SafeHtmlBuilder sb, String id) { if (group == null) { return; } if (Boolean.TRUE.equals(group.getBroken())) { sb.append(cellTemplate.statusWithIconTemplate( SafeHtmlUtils.fromSafeConstant(constants.affinityGroupStatusBroken()), AbstractImagePrototype.create(resources.alertImage()).getSafeHtml(), id, STATUS_BROKEN )); } else { sb.append(cellTemplate.statusTemplate( SafeHtmlUtils.fromSafeConstant(constants.affinityGroupStatusOk()), id, STATUS_OK )); } } }); }
Source:
private static String[] getProGuardUuids(Context ctx) { try { AssetManager assets = ctx.getAssets(); InputStream is = assets.open("sentry-debug-meta.properties"); Properties properties = new Properties(); properties.load(is); is.close(); String uuid = properties.getProperty("io.sentry.ProguardUuids"); if (Util.isNullOrEmpty(uuid)) { return null; } Log.e(TAG, "UUID: " + uuid); return uuid.split("\\|"); } catch (Exception e) { Log.e(TAG, "Error getting Proguard UUIDs.", e); } return null; }

Target:
private static String[] getProGuardUuids(Context ctx) { if (cachedProGuardUuids != null) { return cachedProGuardUuids; } String[] retVal = new String[0]; try { AssetManager assets = ctx.getAssets(); InputStream is = assets.open("sentry-debug-meta.properties"); Properties properties = new Properties(); properties.load(is); is.close(); String uuid = properties.getProperty("io.sentry.ProguardUuids"); if (!Util.isNullOrEmpty(uuid)) { retVal = uuid.split("\\|"); } } catch (Exception e) { Log.e(TAG, "Error getting Proguard UUIDs.", e); } cachedProGuardUuids = retVal; return retVal; }
Source:
public boolean isIndelOrSkippedRegion() { return (mask & INDEL_OR_SKIP_MASK) != 0; }

Target:
public boolean isIndelOrSkippedRegion() { return isIndelOrSkip; }
Source:
public GuiTab(String name, ResourceLocation icon, Class<? extends GuiContainer> clazz) { this.name = name; this.iconResLoc = icon; if (GuiTab.tabRegistry.get(clazz).contains(VANILLA_INVENTORY_TAB) == false) { GuiTab.VANILLA_INVENTORY_TAB.addTo(clazz); } }

Target:
public GuiTab(String name, ResourceLocation icon, Class<? extends GuiContainer> clazz) { this.name = name; this.iconResLoc = icon; if (!GuiTab.tabRegistry.get(clazz).contains(VANILLA_INVENTORY_TAB)) { } }
Source:
public boolean filter(@CheckForNull Object context, @NonNull Descriptor descriptor) { return !(descriptor instanceof vSphereCloudProvisionedSlave.DescriptorImpl); }

Target:
public boolean filter(@CheckForNull Object context, @NonNull Descriptor descriptor) { return !(descriptor instanceof DescriptorImpl); }
Source:
protected void fillEdges(SPTEntry currEdge, PriorityQueue<SPTEntry> prioQueue, IntObjectMap<SPTEntry> bestWeightMap, EdgeExplorer explorer, boolean reverse) { EdgeIterator iter = explorer.setBaseNode(currEdge.adjNode); while (iter.next()) { if (!accept(iter, currEdge.edge)) continue; int traversalId = traversalMode.createTraversalId(iter, reverse); double tmpWeight = weighting.calcWeight(iter, reverse, currEdge.edge) + currEdge.weight; if (Double.isInfinite(tmpWeight)) continue; SPTEntry ee = bestWeightMap.get(traversalId); if (ee == null) { ee = new SPTEntry(iter.getEdge(), iter.getAdjNode(), tmpWeight); ee.parent = currEdge; bestWeightMap.put(traversalId, ee); prioQueue.add(ee); } else if (ee.weight > tmpWeight) { prioQueue.remove(ee); ee.edge = iter.getEdge(); ee.weight = tmpWeight; ee.parent = currEdge; prioQueue.add(ee); } else continue; if (updateBestPath) updateBestPath(iter, ee, traversalId); } }

Target:
void fillEdges(SPTEntry currEdge, PriorityQueue<SPTEntry> prioQueue, IntObjectMap<SPTEntry> bestWeightMap, EdgeExplorer explorer, boolean reverse) { EdgeIterator iter = explorer.setBaseNode(currEdge.adjNode); while (iter.next()) { if (!accept(iter, currEdge.edge)) continue; int traversalId = traversalMode.createTraversalId(iter, reverse); double tmpWeight = weighting.calcWeight(iter, reverse, currEdge.edge) + currEdge.weight; if (Double.isInfinite(tmpWeight)) continue; SPTEntry ee = bestWeightMap.get(traversalId); if (ee == null) { ee = new SPTEntry(iter.getEdge(), iter.getAdjNode(), tmpWeight); ee.parent = currEdge; bestWeightMap.put(traversalId, ee); prioQueue.add(ee); } else if (ee.weight > tmpWeight) { prioQueue.remove(ee); ee.edge = iter.getEdge(); ee.weight = tmpWeight; ee.parent = currEdge; prioQueue.add(ee); } else continue; if (updateBestPath) updateBestPath(iter, ee, traversalId); } }
Source:
public static boolean validateFileType(final FileItemWrap newFile, final List<String> fileTypes) { try { final Tika tika = new Tika(); String mimeType = tika.detect(newFile.getInputStream()); LOG.debug("File mime-type is: " + mimeType); for (String fileType : fileTypes) { if (StringUtils.equalsIgnoreCase(mimeType, fileType)) { return true; } else if (fileType.indexOf("*") == fileType.length() - 1) { fileType = fileType.substring(0, fileType.length() - 1); if (mimeType.indexOf(fileType) == 0) { return true; } } } return false; } catch (IOException e) { LOG.error("Invalid file type"); return false; } }

Target:
public static boolean validateFileType(final FileItemWrap newFile, final List<String> fileTypes) { if (newFile == null) { return false; } if (fileTypes == null || fileTypes.isEmpty()) { return true; } try { final Tika tika = new Tika(); String mimeType = tika.detect(newFile.getInputStream()); LOG.debug("File mime-type is: " + mimeType); for (String fileType : fileTypes) { if (StringUtils.equalsIgnoreCase(mimeType, fileType)) { return true; } else if (fileType.indexOf("*") == fileType.length() - 1) { fileType = fileType.substring(0, fileType.length() - 1); if (mimeType.indexOf(fileType) == 0) { return true; } } } return false; } catch (IOException e) { LOG.error("Invalid file type"); return false; } }
Source:
public RepeatableReadEntry(Object key, Object value, Metadata metadata) { super(key, value, metadata); this.oldMetadata = metadata; }

Target:
public RepeatableReadEntry(Object key, Object value, Metadata metadata) { super(key, value, metadata); }
Source:
public final void visitToken(DetailAST blockCommentNode) { if (JavadocUtils.isJavadocComment(blockCommentNode)) { blockCommentAst = blockCommentNode; final String treeCacheKey = blockCommentNode.getLineNo() + ":" + blockCommentNode.getColumnNo(); final ParseStatus result; if (TREE_CACHE.get().containsKey(treeCacheKey)) { result = TREE_CACHE.get().get(treeCacheKey); } else { result = parser.parseJavadocAsDetailNode(blockCommentNode); TREE_CACHE.get().put(treeCacheKey, result); } if (result.getParseErrorMessage() == null) { final DetailNode javadocTree = result.getTree(); if (doesCheckAcceptJavadocWithUnclosedHtmlTag() || !JavadocUtils.hasUnclosedTag(javadocTree)) { processTree(javadocTree); } } else { final ParseErrorMessage parseErrorMessage = result.getParseErrorMessage(); log(parseErrorMessage.getLineNumber(), parseErrorMessage.getMessageKey(), parseErrorMessage.getMessageArguments()); } } }

Target:
public final void visitToken(DetailAST blockCommentNode) { if (JavadocUtils.isJavadocComment(blockCommentNode)) { context.get().blockCommentAst = blockCommentNode; final String treeCacheKey = blockCommentNode.getLineNo() + ":" + blockCommentNode.getColumnNo(); final ParseStatus result; if (TREE_CACHE.get().containsKey(treeCacheKey)) { result = TREE_CACHE.get().get(treeCacheKey); } else { result = context.get().parser .parseJavadocAsDetailNode(blockCommentNode); TREE_CACHE.get().put(treeCacheKey, result); } if (result.getParseErrorMessage() == null) { if (acceptJavadocWithNonTightHtml() || !result.isNonTight()) { processTree(result.getTree()); } if (violateExecutionOnNonTightHtml && result.isNonTight()) { log(result.getFirstNonTightHtmlTag().getLine(), JavadocDetailNodeParser.MSG_UNCLOSED_HTML_TAG, result.getFirstNonTightHtmlTag().getText()); } } else { final ParseErrorMessage parseErrorMessage = result.getParseErrorMessage(); log(parseErrorMessage.getLineNumber(), parseErrorMessage.getMessageKey(), parseErrorMessage.getMessageArguments()); } } }
Source:
private void onOk() { FenceProxyModel windowModel = (FenceProxyModel) getWindow(); setWindow(null); ListModel<FenceProxyModel> currentModels = windowModel.getCurrentProxies(); FenceProxyModel selectedModel = windowModel.getAvailableProxies().getSelectedItem(); setEntity(selectedModel.getEntity()); Collection<FenceProxyModel> items = currentModels.getItems(); currentModels.setItems(null); currentModels.setItems(items); }

Target:
private void onOk() { FenceProxyModel windowModel = (FenceProxyModel) getWindow(); ListModel<FenceProxyModel> currentModels = windowModel.getCurrentProxies(); FenceProxyModel selectedModel = windowModel.getAvailableProxies().getSelectedItem(); setEntity(selectedModel.getEntity()); Collection<FenceProxyModel> items = currentModels.getItems(); currentModels.setItems(null); currentModels.setItems(items); setWindow(null); }
Source:
public void verifyFactoryForSamlClients() throws Exception { val props = new Pac4jDelegatedAuthenticationProperties(); val saml = new Pac4jSamlClientProperties(); saml.setKeystorePath(new File(FileUtils.getTempDirectoryPath(), "keystore.jks").getCanonicalPath()); saml.setKeystorePassword("1234567890"); saml.setPrivateKeyPassword("1234567890"); saml.setIdentityProviderMetadataPath("classpath:idp-metadata.xml"); saml.setServiceProviderMetadataPath(new File(FileUtils.getTempDirectoryPath(), "sp.xml").getCanonicalPath()); saml.setServiceProviderEntityId("test-entityid"); saml.setForceKeystoreGeneration(true); saml.setMessageStoreFactory("org.pac4j.saml.store.HttpSessionStoreFactory"); props.getSaml().add(saml); val casSettings = new CasConfigurationProperties(); casSettings.getAuthn().setPac4j(props); val factory = new DelegatedClientFactory(casSettings); val clients = factory.build(); assertEquals(1, clients.size()); assertTrue(SAML2Client.class.cast(clients.iterator().next()).getConfiguration().getSamlMessageStoreFactory() instanceof org.pac4j.saml.store.HttpSessionStoreFactory); }

Target:
public void verifyFactoryForSamlClients() throws Exception { val props = new Pac4jDelegatedAuthenticationProperties(); val saml = new Pac4jSamlClientProperties(); saml.setKeystorePath(new File(FileUtils.getTempDirectoryPath(), "keystore.jks").getCanonicalPath()); saml.setKeystorePassword("1234567890"); saml.setPrivateKeyPassword("1234567890"); saml.setIdentityProviderMetadataPath("classpath:idp-metadata.xml"); saml.setServiceProviderMetadataPath(new File(FileUtils.getTempDirectoryPath(), "sp.xml").getCanonicalPath()); saml.setServiceProviderEntityId("test-entityid"); saml.setForceKeystoreGeneration(true); saml.setMessageStoreFactory(org.pac4j.saml.store.HttpSessionStoreFactory.class.getName()); props.getSaml().add(saml); val casSettings = new CasConfigurationProperties(); casSettings.getAuthn().setPac4j(props); val factory = new DelegatedClientFactory(casSettings); val clients = factory.build(); assertEquals(1, clients.size()); assertTrue(SAML2Client.class.cast(clients.iterator().next()).getConfiguration(). getSamlMessageStoreFactory() instanceof org.pac4j.saml.store.HttpSessionStoreFactory); }
Source:
public int hashCode() { int result = identifier.hashCode(); result = 31 * result + type.hashCode(); return result; }

Target:
public int hashCode() { return Objects.hash( identifier, type ); }
Source:
private static void runClusterBasedJobCoordinator(String[] args) { final String coordinatorSystemEnv = System.getenv(ShellCommandConfig.ENV_COORDINATOR_SYSTEM_CONFIG()); final String submissionEnv = System.getenv(ShellCommandConfig.ENV_SUBMISSION_CONFIG()); if (submissionEnv != null) { Config submissionConfig; try { LOG.info("Parsing submission config {}", submissionEnv); submissionConfig = new MapConfig(SamzaObjectMapper.getObjectMapper().readValue(submissionEnv, Config.class)); LOG.info("Using the submission config: {}.", submissionEnv); } catch (IOException e) { LOG.error("Exception while reading submission config", e); throw new SamzaException(e); } ClusterBasedJobCoordinator jc = new ClusterBasedJobCoordinator(submissionConfig); jc.run(); LOG.info("Finished running ClusterBasedJobCoordinator"); } else { Config coordinatorSystemConfig; try { LOG.info("Parsing coordinator system config {}", coordinatorSystemEnv); coordinatorSystemConfig = new MapConfig(SamzaObjectMapper.getObjectMapper().readValue(coordinatorSystemEnv, Config.class)); LOG.info("Using the coordinator system config: {}.", coordinatorSystemConfig); } catch (IOException e) { LOG.error("Exception while reading coordinator stream config", e); throw new SamzaException(e); } ClusterBasedJobCoordinator jc = new ClusterBasedJobCoordinator(coordinatorSystemConfig); jc.run(); LOG.info("Finished running ClusterBasedJobCoordinator"); } }

Target:
private static void runClusterBasedJobCoordinator(String[] args) { final String coordinatorSystemEnv = System.getenv(ShellCommandConfig.ENV_COORDINATOR_SYSTEM_CONFIG()); final String submissionEnv = System.getenv(ShellCommandConfig.ENV_SUBMISSION_CONFIG()); if (!StringUtils.isBlank(submissionEnv)) { Config submissionConfig; try { LOG.info("Parsing submission config {}", submissionEnv); submissionConfig = new MapConfig(SamzaObjectMapper.getObjectMapper().readValue(submissionEnv, Config.class)); LOG.info("Using the submission config: {}.", submissionConfig); } catch (IOException e) { LOG.error("Exception while reading submission config", e); throw new SamzaException(e); } ClusterBasedJobCoordinator jc = createFromConfigLoader(submissionConfig); jc.run(); LOG.info("Finished running ClusterBasedJobCoordinator"); } else { Config coordinatorSystemConfig; try { LOG.info("Parsing coordinator system config {}", coordinatorSystemEnv); coordinatorSystemConfig = new MapConfig(SamzaObjectMapper.getObjectMapper().readValue(coordinatorSystemEnv, Config.class)); LOG.info("Using the coordinator system config: {}.", coordinatorSystemConfig); } catch (IOException e) { LOG.error("Exception while reading coordinator stream config", e); throw new SamzaException(e); } ClusterBasedJobCoordinator jc = createFromMetadataStore(coordinatorSystemConfig); jc.run(); LOG.info("Finished running ClusterBasedJobCoordinator"); } }
Source:
public void submitWithPasteAndCommentReturnsPasteUrl() throws IOException, ParseException, ExpiredException, IllegalArgumentException, TmcCoreException, URISyntaxException, NoLanguagePluginFoundException { Path testPath = Paths.get( "home", "test", "2014-mooc-no-deadline", "viikko1", "viikko1-Viikko1_001.Nimi"); settings.setCurrentCourse(rootFinder.getCurrentCourse(testPath.toString()).or(new Course())); this.courseSubmitter = new ExerciseSubmitter(rootFinder, langs, urlCommunicator, tmcApi, settings); rootFinder.setReturnValue(testPath.toString()); URI pastePath = URI.create("<LINK_0>"); URI result = courseSubmitter.submitPasteWithComment(testPath, "Commentti"); assertEquals(pastePath, result); }

Target:
public void submitWithPasteAndCommentReturnsPasteUrl() throws IOException, ParseException, ExpiredException, IllegalArgumentException, TmcCoreException, URISyntaxException, NoLanguagePluginFoundException { Path testPath = Paths.get( "home", "test", "no-deadline", "halfdoneExercise"); settings.setCurrentCourse(rootFinder.getCurrentCourse(testPath).or(new Course())); this.courseSubmitter = new ExerciseSubmitter(rootFinder, langs, urlCommunicator, tmcApi, settings); rootFinder.setReturnValue(testPath); URI pastePath = URI.create("<LINK_2>"); URI result = courseSubmitter.submitPasteWithComment(testPath, "Commentti"); assertEquals(pastePath, result); }
Source:
public final void testConcurrentAccess() { MockConcurrentSessionProvider.getInstance(); ECPEMFUtils.getESWorkspaceProviderInstance(); for (int i = 0; i < numberOfThreads; i++) { final Runnable runnable = getNewTest(); final Thread t = new Thread(runnable); t.setName("ECPConcurrentTestThread" + i); t.start(); } try { Thread.sleep(20000); } catch (final InterruptedException ex) { ex.printStackTrace(); } }

Target:
public final void testConcurrentAccess() { MockConcurrentSessionProvider.getInstance(); ECPEMFUtils.getESWorkspaceProviderInstance(); final Collection<Thread> collection = new ArrayList<Thread>(); for (int i = 0; i < numberOfThreads; i++) { final Runnable runnable = getNewTest(); final Thread t = new Thread(runnable); t.setName("ECPConcurrentTestThread" + i); collection.add(t); t.start(); } final Iterator<Thread> iter = collection.iterator(); while (iter.hasNext()) { final Thread thread = iter.next(); try { thread.join(); } catch (final InterruptedException ex) { ex.printStackTrace(); } } }
Source:
public boolean supportsBitmapIndex(BitmapIndexSelector selector) { if(selector.getBitmapIndex(boundDimFilter.getDimension()) == null) { return false; } else { return true; } }

Target:
public boolean supportsBitmapIndex(BitmapIndexSelector selector) { return selector.getBitmapIndex(boundDimFilter.getDimension()) != null; }
Source:
@Test public void configRoundTrip() throws Exception { story.addStep(new Statement() { @SuppressWarnings("rawtypes") @Override public void evaluate() throws Throwable { SSHUserPrivateKey c = new DummyPrivateKey("creds", "bob", "secret", "the-key"); CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c); BindingStep s = new StepConfigTester(story.j).configRoundTrip(new BindingStep( Collections.<MultiBinding>singletonList(new SSHUserPrivateKeyBinding("keyFile", "passphrase", "user", "creds")))); story.j.assertEqualDataBoundBeans(s.getBindings(), Collections.singletonList(new SSHUserPrivateKeyBinding("keyFile", "passphrase", "user", "creds"))); } }); }

Target:
@Test public void configRoundTrip() throws Exception { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SSHUserPrivateKey c = new DummyPrivateKey("creds", "bob", "secret", "the-key"); CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c); SSHUserPrivateKeyBinding binding = new SSHUserPrivateKeyBinding("keyFile", "creds"); binding.setPassphraseVariable("passphrase"); binding.setUsernameVariable("user"); BindingStep s = new StepConfigTester(story.j).configRoundTrip(new BindingStep( Collections.<MultiBinding>singletonList(binding))); story.j.assertEqualDataBoundBeans(s.getBindings(), Collections.singletonList(binding)); } }); }
Source:
public void timestampServiceShouldRespectDistinctClientsWhenIssuingTimestamps() { TimestampService timestampService1 = getTimestampService(CLIENT_1); TimestampService timestampService2 = getTimestampService(CLIENT_2); long firstServiceFirstTimestamp = timestampService1.getFreshTimestamp(); long secondServiceFirstTimestamp = timestampService2.getFreshTimestamp(); long firstServiceSecondTimestamp = timestampService1 .getFreshTimestamps(100) .getUpperBound(); long secondServiceSecondTimestamp = timestampService2.getFreshTimestamp(); assertThat(firstServiceSecondTimestamp - firstServiceFirstTimestamp).isGreaterThanOrEqualTo(100L); assertThat(secondServiceSecondTimestamp - secondServiceFirstTimestamp).isBetween(0L, 100L); }

Target:
public void timestampServiceShouldRespectDistinctClientsWhenIssuingTimestamps() { TimestampService timestampService1 = getTimestampService(CLIENT_1); TimestampService timestampService2 = getTimestampService(CLIENT_2); long firstServiceFirstTimestamp = timestampService1.getFreshTimestamp(); long secondServiceFirstTimestamp = timestampService2.getFreshTimestamp(); getFortyTwoFreshTimestamps(timestampService1); long firstServiceSecondTimestamp = timestampService1.getFreshTimestamp(); long secondServiceSecondTimestamp = timestampService2.getFreshTimestamp(); assertThat(firstServiceSecondTimestamp - firstServiceFirstTimestamp).isGreaterThanOrEqualTo(FORTY_TWO); assertThat(secondServiceSecondTimestamp - secondServiceFirstTimestamp).isBetween(0L, (long) FORTY_TWO); }
Source:
public Publisher<Void> close() { return subscriber -> { subscriber.onSubscribe(EmptySubscription.INSTANCE); synchronized (this) { factoryRefresher.close(); activeFactories.clear(); AtomicInteger n = new AtomicInteger(activeSockets.size()); activeSockets.forEach(rs -> { rs.close().subscribe(new Subscriber<Void>() { @Override public void onSubscribe(Subscription s) { s.request(Long.MAX_VALUE); } @Override public void onNext(Void aVoid) @Override public void onError(Throwable t) { if (n.decrementAndGet() == 0) { subscriber.onComplete(); closeSubject.subscribe(EmptySubscriber.INSTANCE); closeSubject.onComplete(); } } @Override public void onComplete() { if (n.decrementAndGet() == 0) { subscriber.onComplete(); closeSubject.subscribe(EmptySubscriber.INSTANCE); closeSubject.onComplete(); } } }); }); } }; }

Target:
public Publisher<Void> close() { return subscriber -> { subscriber.onSubscribe(EmptySubscription.INSTANCE); synchronized (this) { factoryRefresher.close(); activeFactories.clear(); AtomicInteger n = new AtomicInteger(activeSockets.size()); activeSockets.forEach(rs -> { rs.close().subscribe(new Subscriber<Void>() { @Override public void onSubscribe(Subscription s) { s.request(Long.MAX_VALUE); } @Override public void onNext(Void aVoid) @Override public void onError(Throwable t) { logger.warn("Exception while closing a ReactiveSocket", t); onComplete(); } @Override public void onComplete() { if (n.decrementAndGet() == 0) { subscriber.onComplete(); closeSubject.subscribe(EmptySubscriber.INSTANCE); closeSubject.onComplete(); } } }); }); } }; }
Source:
Connection start() { log.info("Starting PubSub connection"); ProjectSubscriptionName subscriptionName = ProjectSubscriptionName .of(projectId, subscriptionId); FlowControlSettings flowControlSettings = FlowControlSettings.newBuilder() .setMaxOutstandingElementCount(maxOutstandingElementCount) .setMaxOutstandingRequestBytes(maxOutstandingRequestBytes) .build(); ExecutorProvider executorProvider = InstantiatingExecutorProvider.newBuilder().setExecutorThreadCount(threads).build(); log.info("Subscribing to {}", subscriptionName); Subscriber subscriber = Subscriber .newBuilder(subscriptionName, new Receiver(consumer)) .setFlowControlSettings(flowControlSettings) .setExecutorProvider(executorProvider) .setChannelProvider(channelProvider) .setCredentialsProvider(credentialsProvider) .build(); subscriber.startAsync().awaitRunning(); log.info("PubSub connection started"); return this; }

Target:
Connection start() { log.info("Starting PubSub connection"); ProjectSubscriptionName subscriptionName = ProjectSubscriptionName .of(projectId, subscriptionId); FlowControlSettings flowControlSettings = FlowControlSettings.newBuilder() .setMaxOutstandingElementCount(maxOutstandingElementCount) .setMaxOutstandingRequestBytes(maxOutstandingRequestBytes) .build(); ExecutorProvider executorProvider = InstantiatingExecutorProvider.newBuilder().setExecutorThreadCount(threads).build(); log.info("Subscribing to {}", subscriptionName); subscriber = Subscriber .newBuilder(subscriptionName, new Receiver(consumer)) .setFlowControlSettings(flowControlSettings) .setExecutorProvider(executorProvider) .setChannelProvider(channelProvider) .setCredentialsProvider(credentialsProvider) .build(); subscriber.startAsync().awaitRunning(); log.info("PubSub connection started"); return this; }
Source:
public Map<String, Integer> flushCaches(final List<String> indexNames) { Logger.warn(this.getClass(), "Flushing Elasticsearch index caches:" + indexNames); if(indexNames==null || indexNames.isEmpty()) { return ImmutableMap.of("failedShards",0, "successfulShards", 0); } ClearIndicesCacheRequest request = new ClearIndicesCacheRequest( indexNames.toArray(new String[0])); ClearIndicesCacheResponse clearCacheResponse = Sneaky.sneak(()->( RestHighLevelClientProvider.getInstance().getClient().indices() .clearCache(request, RequestOptions.DEFAULT))); Map<String, Integer> map= ImmutableMap.of("failedShards", clearCacheResponse.getFailedShards(), "successfulShards", clearCacheResponse.getSuccessfulShards()); Logger.warn(this.getClass(), "Flushed Elasticsearch index caches:" + map); return map; }

Target:
public Map<String, Integer> flushCaches(final List<String> indexNames) { Logger.warn(this.getClass(), "Flushing Elasticsearch index caches:" + indexNames); if(indexNames==null || indexNames.isEmpty()) { return ImmutableMap.of("failedShards",0, "successfulShards", 0); } ClearIndicesCacheRequest request = new ClearIndicesCacheRequest( indexNames.stream().map(indexName -> getNameWithClusterIDPrefix(indexName)).collect( Collectors.toList()).toArray(new String[0])); ClearIndicesCacheResponse clearCacheResponse = Sneaky.sneak(()->( RestHighLevelClientProvider.getInstance().getClient().indices() .clearCache(request, RequestOptions.DEFAULT))); Map<String, Integer> map= ImmutableMap.of("failedShards", clearCacheResponse.getFailedShards(), "successfulShards", clearCacheResponse.getSuccessfulShards()); Logger.warn(this.getClass(), "Flushed Elasticsearch index caches:" + map); return map; }
Source:
public Future<?> scheduleLotsOutsideLoop(final ThreadState threadState) { for (int i = 1; i <= threadState.num; i++) { threadState.eventLoop.schedule(NO_OP, i, TimeUnit.HOURS); } return null; }

Target:
public Future<?> scheduleLotsOutsideLoop(final ThreadState threadState) { final AbstractScheduledEventExecutor eventLoop = threadState.eventLoop; for (int i = 1; i <= threadState.num; i++) { eventLoop.schedule(NO_OP, i, TimeUnit.HOURS); } return null; }
Source:
public Object doWork() { final String sampleName = ReadCountCollectionUtils.getSampleNameForCLIsFromReadCountsFile(new File(coverageFile)); final ReadCountCollection counts; try { counts = ReadCountCollectionUtils.parse(new File(coverageFile)); } catch (final IOException ex) { throw new UserException.BadInput("could not read input file"); } final List<Double> coverage = Arrays.stream(counts.counts().getColumn(0)).mapToObj(x->x).collect(Collectors.toList()); final List<SimpleInterval> intervals = counts.targets().stream().map(Target::getInterval).collect(Collectors.toList()); final CopyRatioSegmenter segmenter = new CopyRatioSegmenter(initialNumStates, intervals, coverage); final List<ModeledSegment> segmentsWithLogSpaceMeans = segmenter.findSegments(); final List<ModeledSegment> segments = segmentsWithLogSpaceMeans.stream().map(segment -> new ModeledSegment(segment.getSimpleInterval(), segment.getTargetCount(), segment.getSegmentMeanInCRSpace())).collect(Collectors.toList());; SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, true); return "SUCCESS"; }

Target:
public Object doWork() { final String sampleName = ReadCountCollectionUtils.getSampleNameForCLIsFromReadCountsFile(new File(coverageFile)); final ReadCountCollection counts; try { counts = ReadCountCollectionUtils.parse(new File(coverageFile)); } catch (final IOException ex) { throw new UserException.BadInput("could not read input file"); } final List<Double> coverage = Doubles.asList(counts.counts().getColumn(0)); final List<SimpleInterval> intervals = counts.targets().stream().map(Target::getInterval).collect(Collectors.toList()); final CopyRatioSegmenter segmenter = new CopyRatioSegmenter(initialNumStates, intervals, coverage); final List<ModeledSegment> segmentsWithLog2Means = segmenter.findSegments(); final List<ModeledSegment> segments = segmentsWithLog2Means.stream().map(segment -> new ModeledSegment(segment.getSimpleInterval(), segment.getTargetCount(), segment.getSegmentMeanInCRSpace())).collect(Collectors.toList());; SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, true); return "SUCCESS"; }
Source:
private List<MetricFamilySamples> getSessionMetrics() { return Arrays.<MetricFamilySamples>asList( createCounter( "hibernate_session_open_total", "Global number of sessions opened", statistics.getSessionOpenCount() ), createCounter( "hibernate_session_close_total", "Global number of sessions closed", statistics.getSessionCloseCount() ), createCounter( "hibernate_flush_total", "Get the global number of flush executed by sessions", statistics.getFlushCount() ), createCounter( "hibernate_connect_total", "Get the global number of connections asked by the sessions", statistics.getConnectCount() ), createCounter( "hibernate_optimistic_failure_total", "The number of StaleObjectStateExceptions that occurred", statistics.getOptimisticFailureCount() ) ); }

Target:
private List<MetricFamilySamples> getSessionMetrics() { return Arrays.<MetricFamilySamples>asList( createCounter( "hibernate_session_opened_total", "Global number of sessions opened (getSessionOpenCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getSessionOpenCount(); } } ), createCounter( "hibernate_session_closed_total", "Global number of sessions closed (getSessionCloseCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getSessionCloseCount(); } } ), createCounter( "hibernate_flushed_total", "The global number of flushes executed by sessions (getFlushCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getFlushCount(); } } ), createCounter( "hibernate_connect_total", "The global number of connections requested by the sessions (getConnectCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getConnectCount(); } } ), createCounter( "hibernate_optimistic_failure_total", "The number of StaleObjectStateExceptions that occurred (getOptimisticFailureCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getOptimisticFailureCount(); } } ) ); }
Source:
public Predicate<String> getFilter() { return Stream.of( Glob.toGlobPredicate(this.include), Glob.toGlobPredicate(this.exclude).negate(), commonClasses().negate() ).reduce(x -> true, Predicate::and); }

Target:
public Predicate<String> getFilter() { return Glob.toGlobPredicate(this.include) .and(Glob.toGlobPredicate(this.exclude).negate()) .and(commonClasses().negate()); }
Source:
public void deleteStorage(final String id) throws DbWriteOperationsBlockedException, NoSuchStorageException, StorageIsUsedException { if (featureToggleService.isFeatureEnabled(FeatureToggleService.Feature.DISABLE_DB_WRITE_OPERATIONS)) { throw new DbWriteOperationsBlockedException("Cannot delete storage: write operations on DB " + "are blocked by feature flag."); } try { storageDbRepository.deleteStorage(id); } catch (final RepositoryProblemException e) { LOG.error("DB error occurred when deleting storage", e); throw new InternalNakadiException(e.getMessage()); } catch (final TransactionException e) { LOG.error("Error with transaction handling when deleting storage", e); throw new InternalNakadiException("Transaction error occurred when deleting storage"); } return; }

Target:
public void deleteStorage(final String id) throws DbWriteOperationsBlockedException, NoSuchStorageException, StorageIsUsedException, InternalNakadiException { if (featureToggleService.isFeatureEnabled(FeatureToggleService.Feature.DISABLE_DB_WRITE_OPERATIONS)) { throw new DbWriteOperationsBlockedException("Cannot delete storage: write operations on DB " + "are blocked by feature flag."); } try { storageDbRepository.deleteStorage(id); } catch (final RepositoryProblemException e) { LOG.error("DB error occurred when deleting storage", e); throw new InternalNakadiException(e.getMessage()); } catch (final TransactionException e) { LOG.error("Error with transaction handling when deleting storage", e); throw new InternalNakadiException("Transaction error occurred when deleting storage"); } }