auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void startTimelineUpdate(final String eventType, final long timeoutMs) throws InterruptedException { LOG.info("Starting timeline update for event type with timeout ms", eventType, timeoutMs); final String etZkPath = toZkPath("/locked_et/" + eventType); boolean successfull = false; try { zooKeeperHolder.get().create().withMode(CreateMode.EPHEMERAL) .forPath(etZkPath, thisId.getBytes(Charsets.UTF_8)); updateVersionAndWaitForAllNodes(timeoutMs); successfull = true; } catch (final InterruptedException ex) { throw ex; } catch (final Exception e) { throw new RuntimeException(e); } finally { if (!successfull) { try { zooKeeperHolder.get().delete().forPath(etZkPath); } catch (final Exception e) { LOG.error("Failed to delete node {}", etZkPath, e); } } } }

Target:
public void startTimelineUpdate(final String eventType, final long timeoutMs) throws InterruptedException { LOG.info("Starting timeline update for event type with timeout ms", eventType, timeoutMs); final String etZkPath = toZkPath("/locked_et/" + eventType); boolean successful = false; try { zooKeeperHolder.get().create().withMode(CreateMode.EPHEMERAL) .forPath(etZkPath, nodeId.getBytes(Charsets.UTF_8)); updateVersionAndWaitForAllNodes(timeoutMs); successful = true; } catch (final KeeperException.NodeExistsException ex) { throw new IllegalStateException(ex); } catch (final InterruptedException ex) { throw ex; } catch (final Exception e) { throw new RuntimeException(e); } finally { if (!successful) { try { zooKeeperHolder.get().delete().forPath(etZkPath); } catch (final Exception e) { LOG.error("Failed to delete node {}", etZkPath, e); } } } }
Source:
protected boolean isUserRespondentOfSession() { return hasValidResponse; }

Target:
protected boolean isUserRespondentOfSession() { return hasValidResponse || logic.hasGiverRespondedForSession(getUserEmailForCourse(), feedbackSessionName, courseId); }
Source:
public void shouldAcceptMnv() throws Exception { Variant input = new Variant("1", 1000, 1003, "ATG", "CGT"); Variant output = processor.process(input); assertEquals(Variant.VariantType.MNV, input.getType()); assertNotNull(output); assertEquals(input, output); }

Target:
public void shouldAcceptMnv() throws Exception { Variant input = new Variant("1", 1000, 1002, "ATG", "CGT"); Variant output = processor.process(input); assertEquals(Variant.VariantType.MNV, input.getType()); assertNotNull(output); assertEquals(input, output); }
Source:
public StringResourceModel(final String resourceKey, final Component component) { Args.notNull(resourceKey, "resource key"); this.resourceKey = resourceKey; this.component = component; }

Target:
public StringResourceModel(final String resourceKey, final Component component) { this(resourceKey, component, null); }
Source:
public void createCollectionObserver() { cCollectionObserver = new Observer() { @Override public void update(Observable o, Object arg) { Collection collection = (Collection) arg; Gdx.app.log(this.getClass().getName(), "Received Collection update: " + collection.toString()); if (collection.isEmpty()) { notifyUserEmptyContainerReceived(); } for (Collectible c : collection) { addCollectibleRendererItem(c); } for (CollectibleRenderer cr : cInitialSet) { if (!isInDisplaySet(cr)) { cDisplayRendererSet.add(cr); cStage.addActor(cr.getActor()); } } } }; }

Target:
public void createCollectionObserver() { cCollectionObserver = new Observer() { @Override public void update(Observable o, Object arg) { Collection collection = (Collection) arg; Gdx.app.log(this.getClass().getName(), "Received Collection update: " + collection.toString()); if (collection.isEmpty()) { notifyUserEmptyContainerReceived(); } else { for (Collectible c : collection) { addCollectibleRendererItem(c); } for (CollectibleRenderer cr : cInitialSet) { if (!isInDisplaySet(cr)) { cDisplayRendererSet.add(cr); cStage.addActor(cr.getActor()); } } } } }; }
Source:
public HttpRequest populateHttpRequest(HttpProducerContext producerContext, IncomingMessage incomingMessage) throws Exception { String uri = getURI(producerContext.getHost(), producerContext.getPort(), incomingMessage); URI requestUri = new URI(uri); producerContext.host(requestUri.getHost()); String scheme = requestUri.getScheme(); if (!"http".equalsIgnoreCase(scheme) && !"https".equalsIgnoreCase(scheme)) { System.err.println("Only HTTP(S) is supported."); } HttpRequest request = new DefaultFullHttpRequest( HttpVersion.HTTP_1_1, incomingMessage.getMethod(), requestUri.getRawPath()); populateHeader(request, requestUri.getHost(), incomingMessage); populateCookies(request, incomingMessage); populateQueryParameters(request, incomingMessage); return request; }

Target:
public HttpRequest populateHttpRequest(HttpProducerContext producerContext, IncomingMessage incomingMessage) throws Exception { String uri = getURI(producerContext.getHost(), producerContext.getPort(), incomingMessage); URI requestUri = new URI(uri); producerContext.host(requestUri.getHost()); String scheme = requestUri.getScheme(); if (!"http".equalsIgnoreCase(scheme) && !"https".equalsIgnoreCase(scheme)) { log.error("Only HTTP(S) is supported."); } HttpRequest request = new DefaultFullHttpRequest( HttpVersion.HTTP_1_1, incomingMessage.getMethod(), requestUri.getRawPath()); populateHeader(request, requestUri.getHost(), incomingMessage); populateCookies(request, incomingMessage); return request; }
Source:
public synchronized void onTimer(CruiseConfigProvider provider) { CruiseConfig currentConfig = provider.getCurrentConfig(); getAllValidLogs(currentConfig); LOG.info("Recomputing material to pipeline mappings."); HashMap<ServerHealthState, Set<String>> erroredPipelines = new HashMap<>(); for (Map.Entry<HealthStateType, ServerHealthState> entry : serverHealth.entrySet()) { erroredPipelines.put(entry.getValue(), entry.getValue().getPipelineNames(currentConfig)); } pipelinesWithErrors = erroredPipelines; LOG.info("Done recomputing material to pipeline mappings."); }

Target:
public synchronized void onTimer(CruiseConfigProvider provider) { CruiseConfig currentConfig = provider.getCurrentConfig(); getAllValidLogs(currentConfig); LOG.debug("Recomputing material to pipeline mappings."); HashMap<ServerHealthState, Set<String>> erroredPipelines = new HashMap<>(); for (Map.Entry<HealthStateType, ServerHealthState> entry : serverHealth.entrySet()) { erroredPipelines.put(entry.getValue(), entry.getValue().getPipelineNames(currentConfig)); } pipelinesWithErrors = erroredPipelines; LOG.debug("Done recomputing material to pipeline mappings."); }
Source:
private void setDynamicPreferredSize() { int maxNameLength = 0; if (chat != null) { final FontMetrics fontMetrics = this.getFontMetrics(UIManager.getFont("TextField.font")); for (final UserName onlinePlayer : chat.getOnlinePlayers()) { maxNameLength = Math.max(maxNameLength, fontMetrics.stringWidth(onlinePlayer.getValue())); } } int iconCounter = 0; if (setCellRenderer instanceof PlayerChatRenderer) { iconCounter = ((PlayerChatRenderer) setCellRenderer).getMaxIconCounter(); } setPreferredSize(new Dimension(maxNameLength + 40 + iconCounter * 14, 80)); }

Target:
private void setDynamicPreferredSize() { if (chat == null) { return; } int maxNameLength = 0; final FontMetrics fontMetrics = this.getFontMetrics(UIManager.getFont("TextField.font")); for (final UserName onlinePlayer : chat.getOnlinePlayers()) { maxNameLength = Math.max(maxNameLength, fontMetrics.stringWidth(onlinePlayer.getValue())); } int iconCounter = 0; if (setCellRenderer instanceof PlayerChatRenderer) { iconCounter = ((PlayerChatRenderer) setCellRenderer).getMaxIconCounter(); } setPreferredSize(new Dimension(maxNameLength + 40 + iconCounter * 14, 80)); }
Source:
public <V> Callable<V> wrap(Callable<V> command) { if (command == null) { return null; } serverSpanThreadBinder.setCurrentSpan(null); return () -> { if (serverSpan != null) { serverSpanThreadBinder.setCurrentSpan(serverSpan); } return command.call(); }; }

Target:
public <V> Callable<V> wrap(Callable<V> command) { if (command == null) { return null; } final ServerSpan current = getCurrentServerSpan(); final ServerSpan serverSpan = getFromExchange(); return () -> { try { if (current == null) { serverSpanThreadBinder.setCurrentSpan(serverSpan); } return command.call(); } finally { serverSpanThreadBinder.setCurrentSpan(current); } }; }
Source:
private void processTokens() { try { DataParser.Token token; while ((token = _parser.nextToken()) != null) { switch (token) { case START_OBJECT: validate(START_OBJECT); if (_currDataMapBuilder.inUse()) { _currDataMapBuilder = new DataMapBuilder(); } _currDataMapBuilder.setInUse(true); push(_currDataMapBuilder, false); break; case END_OBJECT: validate(END_OBJECT); pop(); break; case START_ARRAY: validate(START_ARRAY); push(new DataList(), true); break; case END_ARRAY: validate(END_ARRAY); pop(); break; case STRING: validate(STRING); if (!_isCurrList && _currField == null) { _currField = _parser.getString(); _expectedTokens = VALUE; } else { addValue(_parser.getString()); } break; case INTEGER: addValue(_parser.getIntValue()); break; case LONG: addValue(_parser.getLongValue()); break; case FLOAT: addValue(_parser.getFloatValue()); break; case DOUBLE: addValue(_parser.getDoubleValue()); break; case BOOL_TRUE: validate(BOOL_TRUE); addValue(Boolean.TRUE); break; case BOOL_FALSE: validate(BOOL_FALSE); addValue(Boolean.FALSE); break; case NULL: validate(NULL); addValue(Data.NULL); break; case NOT_AVAILABLE: readNextChunk(); return; default: handleException(new Exception("Unexpected token " + token + " from data parser")); } } } catch (IOException e) { handleException(e); } }

Target:
private void processTokens() { try { NonBlockingDataParser.Token token; while ((token = _parser.nextToken()) != EOF_INPUT) { validate(token); switch (token) { case START_OBJECT: push(createDataObject(_parser), false); break; case START_ARRAY: push(createDataList(_parser), true); break; case END_OBJECT: case END_ARRAY: pop(); break; case STRING: if (!_isCurrList && _currField == null) { _currField = _parser.getString(); _expectedTokens = VALUE; } else { addValue(_parser.getString()); } break; case RAW_BYTES: addValue(_parser.getRawBytes()); break; case INTEGER: addValue(_parser.getIntValue()); break; case LONG: addValue(_parser.getLongValue()); break; case FLOAT: addValue(_parser.getFloatValue()); break; case DOUBLE: addValue(_parser.getDoubleValue()); break; case BOOL_TRUE: addValue(Boolean.TRUE); break; case BOOL_FALSE: addValue(Boolean.FALSE); break; case NULL: addValue(Data.NULL); break; case NOT_AVAILABLE: readNextChunk(); return; default: handleException(new Exception("Unexpected token " + token + " from data parser")); } } } catch (IOException e) { handleException(e); } }
Source:
public IInformationControlCreator getHoverControlCreator() { return new AbstractReusableInformationControlCreator() { @Override protected IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, true); } }; }

Target:
public IInformationControlCreator getHoverControlCreator() { return new AbstractReusableInformationControlCreator() { @Override protected IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString()); } }; }
Source:
private void checkPrivateMethodInvocations(CtModel model) { List<CtMethod<?>> methods = model.getElements(new TypeFilter<>(CtMethod.class)); methods.removeIf(v -> !v.isPrivate()); methods.removeIf(v -> v.getSimpleName().matches("(readObject)|(readResolve)|(getTypeName)")); List<CtInvocation<?>> methodInvocations = model.getElements(new TypeFilter<>(CtInvocation.class)); methodInvocations.removeIf(v -> v.getExecutable().getExecutableDeclaration() == null); List<CtExecutableReferenceExpression<?, ?>> executableReferences = model.getElements(new TypeFilter<>(CtExecutableReferenceExpression.class)); HashSet<CtExecutable<?>> lookUp = methodInvocations.stream() .map(CtInvocation::getExecutable) .map(v -> v.getExecutableDeclaration()) .collect(Collectors.toCollection(HashSet::new)); executableReferences.stream() .map(v -> v.getExecutable().getExecutableDeclaration()) .filter(Objects::nonNull) .forEach(lookUp::add); List<CtMethod<?>> methodsWithInvocation = methods.stream() .filter(method -> lookUp.contains(method)) .collect(Collectors.toList()); methods.removeAll(methodsWithInvocation); assertEquals("Some methods have no invocation", Collections.emptyList(), methods); }

Target:
private void checkPrivateMethodInvocations(CtModel model) { List<CtMethod<?>> methods = model.getElements(new TypeFilter<>(CtMethod.class)); methods.removeIf(v -> !v.isPrivate()); methods.removeIf(v -> v.getSimpleName().matches("(readObject)|(readResolve)")); List<CtInvocation<?>> methodInvocations = model.getElements(new TypeFilter<>(CtInvocation.class)); methodInvocations.removeIf(v -> v.getExecutable().getExecutableDeclaration() == null); List<CtExecutableReferenceExpression<?, ?>> executableReferences = model.getElements(new TypeFilter<>(CtExecutableReferenceExpression.class)); HashSet<CtExecutable<?>> lookUp = methodInvocations.stream() .map(CtInvocation::getExecutable) .map(v -> v.getExecutableDeclaration()) .collect(Collectors.toCollection(HashSet::new)); executableReferences.stream() .map(v -> v.getExecutable().getExecutableDeclaration()) .filter(Objects::nonNull) .forEach(lookUp::add); List<CtMethod<?>> methodsWithInvocation = methods.stream() .filter(method -> lookUp.contains(method)) .collect(Collectors.toList()); methods.removeAll(methodsWithInvocation); assertEquals("Some methods have no invocation", Collections.emptyList(), methods); }
Source:
private void addIcon(final ArtResource image, final int index) { if (image.getType() != ArtResourceType.ALPHA || image.getType() != ArtResourceType.ADDITIVE_ALPHA || image.getType() != ArtResourceType.SPRITE) { throw new UnsupportedOperationException("Not supported yet."); } addIcon(image.getName(), index); }

Target:
private void addIcon(final ArtResource image, final int index) { if (image.getType() != ArtResourceType.ALPHA && image.getType() != ArtResourceType.ADDITIVE_ALPHA && image.getType() != ArtResourceType.SPRITE) { throw new UnsupportedOperationException("Not supported yet."); } addIcon(image.getName(), index); }
Source:
public long getLastExchangeFailureTimestamp() { return 1573285945806L; }

Target:
public Date getLastExchangeFailureTimestamp() { return new Date((long)(EXPECTED_SECONDS * 1000)); }
Source:
private void onCommentVote(final String resultMessage) { Log.d(TAG, "output => " + resultMessage); }

Target:
private void onCommentVote(final String resultMessage) { final Bundle data = getArguments(); data.putBoolean(FLAG_SHOW_LOADING, false); getLoaderManager().restartLoader(ID_LOADER_REFRESH_ARTICLE, data, this); }
Source:
public void checkInitializingAfterFirstStarting() { projectExplorer.openItemByPath(PROJECT_NAME + "/Program.cs"); try { editor.waitMarkerInPosition(INFO, 1); editor.waitMarkerInPosition(INFO, 2); } catch (TimeoutException ex) { fail("<LINK_0>"); } }

Target:
public void checkInitializingAfterFirstStarting() { projectExplorer.openItemByPath(PROJECT_NAME + "/Program.cs"); try { editor.waitMarkerInPosition(INFO, 1); editor.waitMarkerInPosition(INFO, 2); } catch (TimeoutException ex) { fail("Known issue: <LINK_0>", ex); } }
Source:
public void stopped() { HtmlFormEntryService hfes = Context.getService(HtmlFormEntryService.class); if (hfes != null) hfes.getHandlers().remove("encounterProviderAndRole"); log.info("Stopped HTML Form Entry Module"); }

Target:
public void stopped() { log.info("Stopped HTML Form Entry Module"); }
Source:
protected Integer computeNext() { if (current >= 0) { int retval = current; current -= 1; return retval; } return endOfData(); }

Target:
protected Integer computeNext() { if (current >= 0) { int retval = current; current--; return retval; } return endOfData(); }
Source:
public synchronized void sendSceneComandsToDSS(InternalScene scene, boolean call_undo) { if (scene != null) { if (lastSceneCall + 1000 > System.currentTimeMillis()) { sleepTime = System.currentTimeMillis() - lastSceneCall; try { Thread.sleep(sleepTime); } catch (InterruptedException e) { logger.error("An exception occurred", e); } } lastSceneCall = System.currentTimeMillis(); boolean requestSuccsessfull = false; if (scene.getZoneID() == 0) { if (call_undo) { logger.debug("{} {}", scene.getGroupID(), scene.getSceneID(), ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); requestSuccsessfull = this.digitalSTROMClient.callApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID()), false); } else { requestSuccsessfull = this.digitalSTROMClient.undoApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); } } else { if (call_undo) { requestSuccsessfull = this.digitalSTROMClient.callZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID()), false); } else { requestSuccsessfull = this.digitalSTROMClient.undoZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID())); } } logger.debug("Was the scene call succsessful?: {}", requestSuccsessfull); if (requestSuccsessfull) { this.sceneMan.addEcho(scene.getID()); if (call_undo) { scene.activateScene(); } else { scene.deactivateScene(); } } } }

Target:
public synchronized void sendSceneComandsToDSS(InternalScene scene, boolean call_undo) { if (scene != null) { if (lastSceneCall + 1000 > System.currentTimeMillis()) { sleepTime = System.currentTimeMillis() - lastSceneCall; try { Thread.sleep(sleepTime); } catch (InterruptedException e) { logger.debug("An InterruptedException occurred", e); } } lastSceneCall = System.currentTimeMillis(); boolean requestSuccessful = false; if (scene.getZoneID() == 0) { if (call_undo) { logger.debug("{} {}", scene.getGroupID(), scene.getSceneID(), ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); requestSuccessful = this.digitalSTROMClient.callApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID()), false); } else { requestSuccessful = this.digitalSTROMClient.undoApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); } } else { if (call_undo) { requestSuccessful = this.digitalSTROMClient.callZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID()), false); } else { requestSuccessful = this.digitalSTROMClient.undoZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID())); } } logger.debug("Was the scene call succsessful?: {}", requestSuccessful); if (requestSuccessful) { this.sceneMan.addEcho(scene.getID()); if (call_undo) { scene.activateScene(); } else { scene.deactivateScene(); } } } }
Source:
public static ClientBuilder account(String account) throws MalformedURLException { return new ClientBuilder(account); }

Target:
public static ClientBuilder account(String account) { try { URL url = new URL(String.format("<LINK_0>", account)); return ClientBuilder.url(url); } catch (MalformedURLException e) { throw new IllegalArgumentException("Could not generate url from account name.", e); } }
Source:
public void setReplicaDisabledState(ReplicaId replicaId, boolean disable) { if (!(replicaId instanceof AmbryReplica)) { throw new IllegalArgumentException( "HelixParticipant only works with the AmbryReplica implementation of ReplicaId"); } synchronized (helixAdministrationLock) { List<String> disabledReplicas = new ArrayList<>(getDisabledReplicas()); String partitionName = replicaId.getPartitionId().toPathString(); if (!disable && disabledReplicas.contains(partitionName)) { logger.info("Removing the partition from disabledReplicas list", partitionName); disabledReplicas.remove(partitionName); setDisabledReplicas(disabledReplicas); } else if (disable && !disabledReplicas.contains(partitionName)) { logger.info("Adding the partition to disabledReplicas list", partitionName); disabledReplicas.add(partitionName); setDisabledReplicas(disabledReplicas); } InstanceConfig instanceConfig = getInstanceConfig(); String resourceNameForPartition = getResourceNameOfPartition(helixAdmin, clusterName, partitionName); instanceConfig.setInstanceEnabledForPartition(resourceNameForPartition, partitionName, !disable); logger.info("Disabled state of partition is updated", partitionName); } }

Target:
public void setReplicaDisabledState(ReplicaId replicaId, boolean disable) { if (!(replicaId instanceof AmbryReplica)) { throw new IllegalArgumentException( "HelixParticipant only works with the AmbryReplica implementation of ReplicaId"); } synchronized (helixAdministrationLock) { List<String> disabledReplicas = new ArrayList<>(getDisabledReplicas()); String partitionName = replicaId.getPartitionId().toPathString(); InstanceConfig instanceConfig = getInstanceConfig(); String resourceNameForPartition = getResourceNameOfPartition(helixAdmin, clusterName, partitionName); logger.info("{} replica on current node", disable ? "Disabling" : "Enabling", partitionName); instanceConfig.setInstanceEnabledForPartition(resourceNameForPartition, partitionName, !disable); if (!disable && disabledReplicas.contains(partitionName)) { logger.info("Removing the partition from disabledReplicas list", partitionName); disabledReplicas.remove(partitionName); } else if (disable && !disabledReplicas.contains(partitionName)) { logger.info("Adding the partition to disabledReplicas list", partitionName); disabledReplicas.add(partitionName); } logger.info("Setting InstanceConfig with list of disabled replicas: {}", disabledReplicas.toArray()); instanceConfig.getRecord().setListField(DISABLED_REPLICAS_STR, disabledReplicas); helixAdmin.setInstanceConfig(clusterName, instanceName, instanceConfig); logger.info("Disabled state of partition is updated", partitionName); } }
Source:
public Object[] getChildren(Object o) { if (o instanceof IContainer) { IContainer container = (IContainer) o; if (!showLinkedResources && container.isLinked(IResource.CHECK_ANCESTORS)) { return new Object[0]; } IResource[] members = null; try { members = container.members(); } catch (CoreException e) { return new Object[0]; } ArrayList results = new ArrayList(); for (int i = 0; i < members.length; i++) { IResource resource = members[i]; if (!showLinkedResources && resource.isLinked()) { continue; } if ((resource.getType() & resourceType) > 0) { results.add(resource); } } return results.toArray(); } if (o instanceof ArrayList) { return ((ArrayList) o).toArray(); } return new Object[0]; }

Target:
public Object[] getChildren(Object o) { if (o instanceof IContainer) { IContainer container = (IContainer) o; if (!showLinkedResources && container.isLinked(IResource.CHECK_ANCESTORS)) { return EMPTY; } IResource[] members = null; try { members = container.members(); } catch (CoreException e) { return EMPTY; } List<IResource> results = new ArrayList<>(); for (int i = 0; i < members.length; i++) { IResource resource = members[i]; if (!showLinkedResources && resource.isLinked()) { continue; } if ((resource.getType() & resourceType) > 0) { results.add(resource); } } return results.toArray(); } if (o instanceof ArrayList) { return ((List<?>) o).toArray(); } return EMPTY; }
Source:
public void onOffline(@Nonnull final Computer c, @CheckForNull OfflineCause cause) { if (Boolean.getBoolean(SupportPlugin.class.getName() + ".generateOnOfflineNode")) { Timer.get().schedule(new java.util.concurrent.Callable<Void>() { @Override public Void call() throws Exception { boolean locked = false; try { locked = lock.tryLock(); if (locked) { PeriodicWork.all().get(PeriodicWorkImpl.class).doRun(); Logger.getLogger(SupportPlugin.class.getName()) .log(Level.INFO, "Node: " + c.getDisplayName() + " went offline. A new support bundle" + " was generated. Please check: " + SupportPlugin.getRootDirectory().getAbsolutePath() + " at this time."); } } catch (Exception e) { Logger.getLogger(SupportPlugin.class.getName()) .log(Level.WARNING, "Error when generating support bundle while on offline node", e); } finally { if (locked) lock.unlock(); } return null; } }, 1, TimeUnit.MINUTES); } }

Target:
public void onOffline(@Nonnull final Computer c, @CheckForNull OfflineCause cause) { if (Boolean.getBoolean(SupportPlugin.class.getName() + ".generateOnOfflineNode") && cause != null && !cause.getClass().getName().contains("RestartCause")) { Timer.get().schedule(new java.util.concurrent.Callable<Void>() { @Override public Void call() throws Exception { boolean locked = false; try { locked = lock.tryLock(); if (locked) { PeriodicWork.all().get(PeriodicWorkImpl.class).doRun(); Logger.getLogger(SupportPlugin.class.getName()) .log(Level.INFO, "Node: " + c.getDisplayName() + " went offline. A new support bundle" + " was generated. Please check: " + SupportPlugin.getRootDirectory().getAbsolutePath() + " at this time."); } } catch (Exception e) { Logger.getLogger(SupportPlugin.class.getName()) .log(Level.WARNING, "Error when generating support bundle while on offline node", e); } finally { if (locked) lock.unlock(); } return null; } }, 1, TimeUnit.MINUTES); } }
Source:
protected AuditLogType getAuditLogForMigrationFailure() { if (getVds().getStatus() == VDSStatus.PreparingForMaintenance) { return getDestinationVds() != null ? AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE : AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE_SINCE_NO_VDS_TO_MIGRATE_TO; } else { if (getDestinationVds() == null) { auditLogDirector.log(this, AuditLogType.VM_MIGRATION_NO_VDS_TO_MIGRATE_TO); } return AuditLogType.VM_MIGRATION_FAILED; } }

Target:
protected AuditLogType getAuditLogForMigrationFailure() { if (getDestinationVds() == null) { auditLogDirector.log(this, AuditLogType.VM_MIGRATION_NO_VDS_TO_MIGRATE_TO); } if (getVds().getStatus() == VDSStatus.PreparingForMaintenance) { return getDestinationVds() != null ? AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE : AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE_NO_DESTINATION_VDS; } return AuditLogType.VM_MIGRATION_FAILED; }
Source:
public Builder hostname(final String hostname) { if (hostname != null && !hostname.isEmpty()) { this.hostname = hostname; } return this; }

Target:
public Builder hostname(final String hostname) { this.hostname = hostname; return this; }
Source:
public Map<String, Integer> getStats() { int in = 0; int out = 0; for (Connection conn : connections.values()) { if (conn.direction == Connection.Direction.OUT) { out++; } else { in++; } } Map<String, Integer> result = new HashMap<>(2); result.put("connections.in", in); result.put("connections.out", out); return result; }

Target:
public Map<String, Integer> getStats() { int in = 0; int out = 0; for (Connection conn : connections.values()) { if (conn.direction == Connection.Direction.OUT) { out++; } else { in++; } } Map<String, Integer> result = new HashMap<>(3); result.put("connections.in", in); result.put("connections.out", out); return result; }
Source:
private TurnType attachTurnLanesData(boolean leftSide, RouteSegmentResult prevSegm, TurnType t) { int lanes = prevSegm.getObject().getLanes(); String turnLanes = getTurnLanesString(prevSegm); if (turnLanes == null) { return t; } String[] splitLaneOptions = turnLanes.split("\\|", -1); if (splitLaneOptions.length != lanes) { return t; } if (t.getLanes().length != lanes) { return t; } assignTurns(splitLaneOptions, t); return t; }

Target:
private void attachTurnLanesData(boolean leftSide, RouteSegmentResult prevSegm, TurnType t) { int lanes = prevSegm.getObject().getLanes(); String turnLanes = getTurnLanesString(prevSegm); if (turnLanes == null) { return; } String[] splitLaneOptions = turnLanes.split("\\|", -1); if (splitLaneOptions.length != lanes) { return; } if (t.getLanes().length != lanes) { return; } assignTurns(splitLaneOptions, t); }
Source:
private static boolean isXterm() { String term = System.getenv("TERM"); return term != null && term.equals("xterm"); }

Target:
private static boolean isXterm() { return "xterm".equals(System.getenv("TERM")); }
Source:
public TopicThreads call() throws Exception { try { if (courseId != null) { int pageSize = pagination.pageSize(); int page = pagination.numOfPagesLoaded() + 1; return environment.getDiscussionAPI().getThreadList(courseId, topicIds, filter.getQueryParamValue(), orderBy.getQueryParamValue(), pageSize, page); } } catch (Exception ex) { handle(ex); logger.error(ex, true); } return null; }

Target:
public TopicThreads call() throws Exception { try { if (courseId != null) { int pageSize = pagination.pageSize(); int page = pagination.numOfPagesLoaded() + 1; return environment.getDiscussionAPI().getThreadList(courseId, topicIds, filter.getQueryParamValue(), orderBy.getQueryParamValue(), pageSize, page); } } catch (RetroHttpException ex) { handle(ex); logger.error(ex, true); } return null; }
Source:
protected int getDefaultPort() { return JigasiBundleActivator.getConfigurationService().getInt( P_NAME_TRANSCRIPT_PORT, TRANSCRIPT_PORT_DEFAULT_VALUE); }

Target:
protected int getDefaultPort() { return -1; }
Source:
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { if (delegate instanceof X509ExtendedTrustManager) { ((X509ExtendedTrustManager)delegate).checkClientTrusted(chain, authType, socket); } else { throw new UnsupportedOperationException(); } verifier.checkChain(chain); }

Target:
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { if (delegate instanceof X509ExtendedTrustManager) { ((X509ExtendedTrustManager)delegate).checkServerTrusted(chain, authType, socket); } else { throw new UnsupportedOperationException(); } verifier.checkChain(chain); }
Source:
public void testStartsInLegacySpecifiedDirectory() { String dir1 = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4)); String dir2 = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4)); shutdown(); LocalManagementContext mgmt = new LocalManagementContext(); ((BrooklynProperties)mgmt.getConfig()).put("brooklyn.dirs.install", dir1); ((BrooklynProperties)mgmt.getConfig()).put("brooklyn.dirs.run", dir2); app = ApplicationBuilder.newManagedApp(TestApplication.class, mgmt); app.setConfig(BrooklynConfigKeys.RUN_DIR, dir2); doTestSpecifiedDirectory(dir1, dir2); Os.tryDeleteDirectory(dir1); Os.tryDeleteDirectory(dir2); }

Target:
public void testStartsInLegacySpecifiedDirectory() { String dir1 = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4)); String dir2 = Os.mergePathsUnix(Os.tmp(), "/brooklyn-test-"+Strings.makeRandomId(4)); shutdown(); LocalManagementContext mgmt = new LocalManagementContext(); mgmt.getBrooklynProperties().put("brooklyn.dirs.install", dir1); mgmt.getBrooklynProperties().put("brooklyn.dirs.run", dir2); app = ApplicationBuilder.newManagedApp(TestApplication.class, mgmt); app.setConfig(BrooklynConfigKeys.RUN_DIR, dir2); doTestSpecifiedDirectory(dir1, dir2); Os.tryDeleteDirectory(dir1); Os.tryDeleteDirectory(dir2); }
Source:
private static Workpiece readWorkpiece(FileManagementInterface fileManagement, URI metsFileUri, LockResult lockResult) throws IOException { try (InputStream in = fileManagement.read(metsFileUri, lockResult)) { return createMetsXmlElementAccess().read(in, (uri, unusedBecauseAccessIsReadOnly) -> { try { Map<URI, LockingMode> requested = new HashMap<>(2); requested.put(uri, LockingMode.IMMUTABLE_READ); Map<URI, Collection<String>> conflicts = lockResult.tryLock(requested); if (conflicts.isEmpty()) { return fileManagement.read(uri, lockResult); } else { throw new IOException(createLockErrorMessage(uri, conflicts)); } } catch (IOException e) { throw new UncheckedIOException(e); } }); } }

Target:
private static Workpiece readWorkpiece(FileManagementInterface fileManagement, URI metsFileUri, LockResult lockResult) throws IOException { try (InputStream inputStream = fileManagement.read(metsFileUri, lockResult)) { Workpiece result = createMetsXmlElementAccess().read(inputStream, (uri, unusedBecauseAccessIsReadOnly) -> { try { Map<URI, LockingMode> requested = new HashMap<>(2); requested.put(uri, LockingMode.IMMUTABLE_READ); Map<URI, Collection<String>> conflicts = lockResult.tryLock(requested); if (conflicts.isEmpty()) { return fileManagement.read(uri, lockResult); } else { throw new IOException(createLockErrorMessage(uri, conflicts)); } } catch (IOException e) { throw new UncheckedIOException(e); } }); return result; } }
Source:
protected void checkGLevelMD( final PreparedVerifier verifier ) { final Content content = getNexusClient().getSubsystem( Content.class ); final File target = util.createTempFile(); FileInputStream fis = null; try { content.download( Location.repositoryLocation( getTargetedRepositoryId(), "/" + getClass().getPackage().getName().replaceAll( "\\.", "/" ) + "/maven-metadata.xml" ), target ); fis = new FileInputStream( target ); final Metadata md = new MetadataXpp3Reader().read( fis ); assertThat( md.getPlugins(), not( empty() ) ); for ( Plugin plugin : md.getPlugins() ) { if ( StringUtils.equals( plugin.getArtifactId(), verifier.getProjectArtifactId() ) && StringUtils.equals( plugin.getPrefix(), verifier.getProjectArtifactId() ) ) { return; } } throw new AssertionError( "The maven-plugin with artifact ID " + verifier.getProjectArtifactId() + " should be contained in this Plugin list: " + Lists.transform( md.getPlugins(), new Function<Plugin, String>() { @Override public String apply( @Nullable Plugin input ) { return input.getArtifactId(); } } ) ); } catch ( XmlPullParserException e ) { throw new AssertionError( "The metadata parse failed: " + e.getMessage() ); } catch ( IOException e ) { throw new AssertionError( "The metadata download failed: " + e.getMessage() ); } finally { IOUtil.close( fis ); } }

Target:
protected void checkGLevelMD( final PreparedVerifier verifier ) { final Content content = getNexusClient().getSubsystem( Content.class ); final File target = util.createTempFile(); FileInputStream fis = null; try { content.download( Location.repositoryLocation( getTargetedRepositoryId(), "/" + getClass().getPackage().getName().replaceAll( "\\.", "/" ) + "/maven-metadata.xml" ), target ); fis = new FileInputStream( target ); final Metadata md = new MetadataXpp3Reader().read( fis ); assertThat( md.getPlugins(), not( empty() ) ); for ( Plugin plugin : md.getPlugins() ) { if ( StringUtils.equals( plugin.getArtifactId(), verifier.getProjectArtifactId() ) && StringUtils.equals( plugin.getPrefix(), verifier.getProjectArtifactId() ) ) { return; } } throw new AssertionError( "The maven-plugin with artifact ID " + verifier.getProjectArtifactId() + " should be contained in this Plugin list: " + Lists.transform( md.getPlugins(), new Function<Plugin, String>() { @Override public String apply( Plugin input ) { if ( null == input ) { return "invalid-plugin-null-value"; } return input.getArtifactId(); } } ) ); } catch ( XmlPullParserException e ) { throw new AssertionError( "The metadata parse failed: " + e.getMessage() ); } catch ( IOException e ) { throw new AssertionError( "The metadata download failed: " + e.getMessage() ); } finally { IOUtil.close( fis ); } }
Source:
private DeclaredType getProviderInterface(AnnotationMirror providerAnnotation) { Map<? extends ExecutableElement, ? extends AnnotationValue> values = providerAnnotation.getElementValues(); log("annotation values: " + values); AnnotationValue value = values.values().iterator().next(); return (DeclaredType) value.getValue(); }

Target:
private DeclaredType getProviderInterface(AnnotationMirror providerAnnotation) { Map<? extends ExecutableElement, ? extends AnnotationValue> valueIndex = providerAnnotation.getElementValues(); log("annotation values: " + valueIndex); AnnotationValue value = valueIndex.values().iterator().next(); return (DeclaredType) value.getValue(); }
Source:
private void copyOriginalURL() { ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData urlClipData = ClipData.newPlainText("article URL", articleUrl); clipboardManager.setPrimaryClip(urlClipData); Toast toast = new Toast(this); toast.makeText(this, R.string.txtUrlCopied, Toast.LENGTH_SHORT).show(); }

Target:
private void copyOriginalURL() { ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData urlClipData = ClipData.newPlainText("article URL", articleUrl); clipboardManager.setPrimaryClip(urlClipData); Toast.makeText(this, R.string.txtUrlCopied, Toast.LENGTH_SHORT).show(); }
Source:
public String give( @Sender EntityRef client, @CommandParam("prefabId or blockName") String itemPrefabName, @CommandParam(value = "amount", required = false) Integer amount, @CommandParam(value = "blockShapeName", required = false) String shapeUriParam) { int itemAmount = amount != null ? amount : 1; Set<ResourceUrn> matches = assetManager.resolve(itemPrefabName, Prefab.class); switch(matches.size()) { case 0: return blockCommands.giveBlock(client, itemPrefabName, amount, shapeUriParam); case 1: Prefab prefab = assetManager.getAsset(matches.iterator().next(), Prefab.class).orElse(null); if (prefab != null && prefab.getComponent(ItemComponent.class) != null) { EntityRef item = entityManager.create(prefab); EntityRef playerEntity = client.getComponent(ClientComponent.class).character; if (!inventoryManager.giveItem(playerEntity, playerEntity, item)) { item.destroy(); } return "You received " + (itemAmount > 1 ? itemAmount + " items of " : "an item of ") + prefab.getName() + (shapeUriParam != null ? " (Item can not have a shape)" : ""); } else { return blockCommands.giveBlock(client, itemPrefabName, amount, shapeUriParam); } default: StringBuilder builder = new StringBuilder(); builder.append("Requested item \""); builder.append(itemPrefabName); builder.append("\": matches "); Joiner.on(" and ").appendTo(builder, matches); builder.append(". Please fully specify one."); return builder.toString(); } }

Target:
public String give( @Sender EntityRef client, @CommandParam("prefabId or blockName") String itemPrefabName, @CommandParam(value = "amount", required = false) Integer amount, @CommandParam(value = "blockShapeName", required = false) String shapeUriParam) { int itemAmount = amount != null ? amount : 1; if (itemAmount < 1) { return "Requested zero (0) items / blocks!"; } Set<ResourceUrn> matches = assetManager.resolve(itemPrefabName, Prefab.class); if (matches.size() == 1) { Prefab prefab = assetManager.getAsset(matches.iterator().next(), Prefab.class).orElse(null); if (prefab != null && prefab.getComponent(ItemComponent.class) != null) { EntityRef item = entityManager.create(prefab); EntityRef playerEntity = client.getComponent(ClientComponent.class).character; if (!inventoryManager.giveItem(playerEntity, playerEntity, item)) { item.destroy(); } return "You received " + (itemAmount > 1 ? itemAmount + " items of " : "an item of ") + prefab.getName() + (shapeUriParam != null ? " (Item can not have a shape)" : ""); } } else if (matches.size() > 1) { StringBuilder builder = new StringBuilder(); builder.append("Requested item \""); builder.append(itemPrefabName); builder.append("\": matches "); Joiner.on(" and ").appendTo(builder, matches); builder.append(". Please fully specify one."); return builder.toString(); } String message = blockCommands.giveBlock(client, itemPrefabName, amount, shapeUriParam); if (message != null) { return message; } return "Could not find an item or block matching \"" + itemPrefabName + "\""; }
Source:
private static List<EObject> getSupersetReferences(EReference reference) { EAnnotation annotation = Iterables.find(reference.getEAnnotations(), new Predicate<EAnnotation>() { public boolean apply(EAnnotation input) { return input.getSource().equals(UMLUtilForCompare.getAnnotationSubsetsID()); } }, null); if (annotation != null) { return annotation.getReferences(); } return Lists.newArrayList(); }

Target:
private static Iterable<EReference> getSupersetReferences(EReference reference) { EAnnotation subsetsAnnotation = Iterables.find(reference.getEAnnotations(), UMLUtilForCompare .isSubsetsAnnotation(), null); if (subsetsAnnotation != null) { return Iterables.filter(subsetsAnnotation.getReferences(), EReference.class); } return Collections.emptyList(); }
Source:
public MultiDataSet next() { if (minibatchCount < terminationPoint) { minibatchCount++; return underlyingIterator.next(); } else { throw new RuntimeException("Calls to next have exceeded termination point."); } }

Target:
public MultiDataSet next() { if (minibatchCount < terminationPoint) { minibatchCount++; return underlyingIterator.next(); } else { throw new RuntimeException("Calls to next have exceeded the allotted number of minibatches."); } }
Source:
protected View createScreenletView(Context context, AttributeSet attributes) { TypedArray typedArray = context.getTheme().obtainStyledAttributes(attributes, R.styleable.LoginScreenlet, 0, 0); int storeValue = typedArray.getInt(R.styleable.LoginScreenlet_credentialsStorage, StorageType.NONE.toInt()); credentialsStorage = StorageType.valueOf(storeValue); oauthConsumerKey = typedArray.getString(R.styleable.LoginScreenlet_oauthConsumerKey); oauthConsumerSecret = typedArray.getString(R.styleable.LoginScreenlet_oauthConsumerSecret); shouldHandleCookieExpiration = typedArray.getBoolean(R.styleable.LoginScreenlet_shouldHandleCookieExpiration, true); cookieExpirationTime = typedArray.getInt(R.styleable.LoginScreenlet_cookieExpirationTime, CookieAuthentication.COOKIE_EXPIRATION_TIME); int layoutId = typedArray.getResourceId(R.styleable.LoginScreenlet_layoutId, getDefaultLayoutId()); View view = LayoutInflater.from(context).inflate(layoutId, null); LoginViewModel loginViewModel = (LoginViewModel) view; int authMethodId = typedArray.getInt(R.styleable.LoginScreenlet_loginMode, 0); authenticationType = AuthenticationType.values()[authMethodId]; loginViewModel.setAuthenticationType(authenticationType); if (authenticationType.equals(AuthenticationType.BASIC) || authenticationType.equals( AuthenticationType.COOKIE)) { int basicAuthMethodId = typedArray.getInt(R.styleable.LoginScreenlet_basicAuthMethod, 0); basicAuthMethod = BasicAuthMethod.getValue(basicAuthMethodId); loginViewModel.setBasicAuthMethod(basicAuthMethod); } typedArray.recycle(); return view; }

Target:
protected View createScreenletView(Context context, AttributeSet attributes) { TypedArray typedArray = context.getTheme().obtainStyledAttributes(attributes, R.styleable.LoginScreenlet, 0, 0); int storeValue = typedArray.getInt(R.styleable.LoginScreenlet_credentialsStorage, StorageType.NONE.toInt()); credentialsStorage = StorageType.valueOf(storeValue); oauthConsumerKey = typedArray.getString(R.styleable.LoginScreenlet_oauthConsumerKey); oauthConsumerSecret = typedArray.getString(R.styleable.LoginScreenlet_oauthConsumerSecret); shouldHandleCookieExpiration = typedArray.getBoolean(R.styleable.LoginScreenlet_shouldHandleCookieExpiration, true); cookieExpirationTime = typedArray.getInt(R.styleable.LoginScreenlet_cookieExpirationTime, CookieAuthentication.COOKIE_EXPIRATION_TIME); int layoutId = typedArray.getResourceId(R.styleable.LoginScreenlet_layoutId, getDefaultLayoutId()); View view = LayoutInflater.from(context).inflate(layoutId, null); LoginViewModel loginViewModel = (LoginViewModel) view; int authMethodId = typedArray.getInt(R.styleable.LoginScreenlet_loginMode, 0); authenticationType = AuthenticationType.values()[authMethodId]; loginViewModel.setAuthenticationType(authenticationType); if (AuthenticationType.BASIC.equals(authenticationType) || AuthenticationType.COOKIE.equals( authenticationType)) { int basicAuthMethodId = typedArray.getInt(R.styleable.LoginScreenlet_basicAuthMethod, 0); basicAuthMethod = BasicAuthMethod.getValue(basicAuthMethodId); loginViewModel.setBasicAuthMethod(basicAuthMethod); } typedArray.recycle(); return view; }
Source:
public void resetPassword_shouldResetUserPasswordIfActivationKeyIsCorrect() throws Exception { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); String key = "h4ph0fpNzQCIPSw8plJI"; int validTime = 10 * 60 * 1000; Long tokenTime = System.currentTimeMillis() + validTime; LoginCredential credentials = dao.getLoginCredential(createdUser); credentials .setActivationKey("b071c88d6d877922e35af2e6a90dd57d37ac61143a03bb986c5f353566f3972a86ce9b2604c31a22dfa467922dcfd54fa7d18b0a7c7648d94ca3d97a88ea2fd0:" + tokenTime); dao.updateLoginCredential(credentials); String newPassword = "newPasswordString123"; MockHttpServletResponse response = handle(newPostRequest(RESET_PASSWORD_URI + "/" + key, "{\"newPassword\":\"" + newPassword + "\"}")); assertEquals(200, response.getStatus()); }

Target:
public void resetPassword_shouldResetUserPasswordIfActivationKeyIsCorrect() throws Exception { User user = userService.getUserByUuid("c98a1558-e131-11de-babe-001e378eb67e"); String key = "h4ph0fpNzQCIPSw8plJI"; int validTime = 10 * 60 * 1000; Long tokenTime = System.currentTimeMillis() + validTime; LoginCredential credentials = dao.getLoginCredential(user); credentials .setActivationKey("b071c88d6d877922e35af2e6a90dd57d37ac61143a03bb986c5f353566f3972a86ce9b2604c31a22dfa467922dcfd54fa7d18b0a7c7648d94ca3d97a88ea2fd0:" + tokenTime); dao.updateLoginCredential(credentials); String newPassword = "newPasswordString123"; MockHttpServletResponse response = handle(newPostRequest(RESET_PASSWORD_URI + "/" + key, "{\"newPassword\":\"" + newPassword + "\"}")); assertEquals(200, response.getStatus()); Context.authenticate(user.getUsername(), newPassword); }
Source:
public static Money parse(String amountStr) { ArgChecker.notNull(amountStr, "amountStr"); List<String> split = Splitter.on(' ').splitToList(amountStr); if (split.size() != 2) { throw new IllegalArgumentException("Unable to parse amount, invalid format: " + amountStr); } try { Currency cur = Currency.parse(split.get(0)); double amount = Double.parseDouble(split.get(1)); return new Money(cur, BigDecimal.valueOf(amount)); } catch (RuntimeException ex) { throw new IllegalArgumentException("Unable to parse amount: " + amountStr, ex); } }

Target:
public static Money parse(String amountStr) { ArgChecker.notNull(amountStr, "amountStr"); List<String> split = Splitter.on(' ').splitToList(amountStr); if (split.size() != 2) { throw new IllegalArgumentException("Unable to parse amount, invalid format: " + amountStr); } try { Currency cur = Currency.parse(split.get(0)); return new Money(cur, new BigDecimal(split.get(1))); } catch (RuntimeException ex) { throw new IllegalArgumentException("Unable to parse amount: " + amountStr, ex); } }
Source:
public void start() { if (memoryConfiguration.storageType() == StorageType.OFF_HEAP) { minSize = UnpooledOffHeapMemoryAllocator.estimateSizeOverhead(memoryConfiguration.addressCount() << 3); currentSize.set(minSize); } if (container instanceof InternalDataContainer) { listener = this::entriesRemoved; ((InternalDataContainer) container).addRemovalListener(listener); } if (!cache.getCacheConfiguration().clustering().cacheMode().isClustered()) { cache.getAdvancedCache().withEncoding(IdentityEncoder.class).withWrapping(IdentityWrapper.class).addListener(this); } }

Target:
public void start() { if (memoryConfiguration.storageType() == StorageType.OFF_HEAP) { minSize = UnpooledOffHeapMemoryAllocator.estimateSizeOverhead(memoryConfiguration.addressCount() << 3); currentSize.set(minSize); } listener = this::entriesRemoved; container.addRemovalListener(listener); if (!cache.getCacheConfiguration().clustering().cacheMode().isClustered()) { cache.getAdvancedCache().withEncoding(IdentityEncoder.class).withWrapping(IdentityWrapper.class).addListener(this); } }