auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Optional<NodeDocument> getNodeInfoFromCache(final String location, final String ipAddress, final ContextKey contextKey, final String value) { Optional<NodeDocument> nodeDocument; final NodeMetadataKey metadataKey = new NodeMetadataKey(contextKey, value); try { nodeDocument = nodeMetadataCache.get(metadataKey); } catch (ExecutionException e) { LOG.error("Error while retrieving NodeDocument from NodeMetadataCache: {}.", e.getMessage(), e); throw new RuntimeException(e); } if(nodeDocument.isPresent()) { return nodeDocument; } final Optional<Integer> nodeId = interfaceToNodeCache.getFirstNodeId(location, InetAddressUtils.addr(ipAddress)); if(nodeId.isPresent()) { try { return nodeInfoCache.get(nodeId.get()); } catch (ExecutionException e) { LOG.error("Error while retrieving NodeDocument from NodeInfoCache: {}.", e.getMessage(), e); throw new RuntimeException(e); } } return Optional.empty(); }

Target:
private Optional<NodeDocument> getNodeInfoFromCache(final String location, final String ipAddress, final ContextKey contextKey, final String value) { Optional<NodeDocument> nodeDocument = Optional.empty(); if (contextKey != null && !Strings.isNullOrEmpty(value)) { final NodeMetadataKey metadataKey = new NodeMetadataKey(contextKey, value); try { nodeDocument = nodeMetadataCache.get(metadataKey); } catch (ExecutionException e) { LOG.error("Error while retrieving NodeDocument from NodeMetadataCache: {}.", e.getMessage(), e); throw new RuntimeException(e); } if(nodeDocument.isPresent()) { return nodeDocument; } } final Optional<Integer> nodeId = interfaceToNodeCache.getFirstNodeId(location, InetAddressUtils.addr(ipAddress)); if(nodeId.isPresent()) { try { return nodeInfoCache.get(nodeId.get()); } catch (ExecutionException e) { LOG.error("Error while retrieving NodeDocument from NodeInfoCache: {}.", e.getMessage(), e); throw new RuntimeException(e); } } return nodeDocument; }
Source:
private String getTypeUrl(Descriptor descriptor) { return "type.googleapis.com/" + descriptor.getFullName(); }

Target:
private final static String getTypeUrl(Descriptor descriptor) { return "type.googleapis.com/" + descriptor.getFullName(); }
Source:
protected StringBuilder addSecurityManager(StringBuilder jvmArguments) { return jvmArguments.append(" -Djava.security.manager=org.ngrinder.sm." + getSecurityManagerBySecurityLevel(securityLevel) + " "); }

Target:
protected StringBuilder addSecurityManager(StringBuilder jvmArguments) { return jvmArguments.append(" -Djava.security.manager=" + getSecurityManagerBySecurityLevel(securityLevel) + " "); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createTopographic()); mMapView.setMap(map); if (ContextCompat.checkSelfPermission(this, reqPermission[0]) == PackageManager.PERMISSION_GRANTED) { loadGeodatabaseSymbolDictionary(); } else { int requestCode = 2; ActivityCompat.requestPermissions(this, reqPermission, requestCode); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createTopographic()); mMapView.setMap(map); requestReadPermission(); }
Source:
private void addElement(String elementName, ListenerDescriptor descriptor, Method method) { String lowerElementName = elementName.toLowerCase(Locale.ENGLISH); ListenerElement element = descriptor.getElements().get(lowerElementName); Type[] methodTypes = method.getGenericParameterTypes(); if (element == null || methodTypes.length > element.getParameters().size()) { element = new ListenerElement(elementName); element.getParameters().clear(); for (Type parameterType : method.getGenericParameterTypes()) { element.getParameters().add(parameterType); } descriptor.getElements().put(lowerElementName, element); } addMethod(element, method); }

Target:
private void addElement(String elementName, ListenerDescriptor descriptor, Method method) { String lowerElementName = elementName.toLowerCase(Locale.ROOT); ListenerElement element = descriptor.getElements().get(lowerElementName); Type[] methodTypes = method.getGenericParameterTypes(); if (element == null || methodTypes.length > element.getParameters().size()) { element = new ListenerElement(elementName); element.getParameters().clear(); for (Type parameterType : method.getGenericParameterTypes()) { element.getParameters().add(parameterType); } descriptor.getElements().put(lowerElementName, element); } addMethod(element, method); }
Source:
public ListenableFuture<Boolean> get(String key, OutputStream out) { boolean use_bsDisk = super.containsKey(key); if (use_bsDisk) { return super.get(key, out); } else { Path temp = toPath(UUID.randomUUID().toString()); OutputStream tempOut; try { tempOut = temp.getOutputStream(); } catch (IOException e) { return Futures.immediateFailedFuture(e); } ListenableFuture<Boolean> chained = Futures.transformAsync( bsHttp.get(key, tempOut), (found) -> { if (!found) { return Futures.immediateFuture(false); } else { Path target = toPath(key); temp.renameTo(target); SettableFuture<Boolean> f = SettableFuture.create(); try (InputStream in = target.getInputStream()) { ByteStreams.copy(in, out); f.set(true); } catch (IOException e) { f.setException(e); } return f; } }, MoreExecutors.directExecutor() ); chained.addListener( () -> { try { tempOut.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close temporary file on get", e); } }, MoreExecutors.directExecutor()); return chained; } }

Target:
public ListenableFuture<Boolean> get(String key, OutputStream out) { boolean foundOnDisk = super.containsKey(key); if (foundOnDisk) { return super.get(key, out); } else { Path temp = toPath(UUID.randomUUID().toString()); OutputStream tempOut; try { tempOut = temp.getOutputStream(); } catch (IOException e) { return Futures.immediateFailedFuture(e); } ListenableFuture<Boolean> chained = Futures.transformAsync( bsHttp.get(key, tempOut), (found) -> { if (!found) { return Futures.immediateFuture(false); } else { Path target = toPath(key); temp.renameTo(target); SettableFuture<Boolean> f = SettableFuture.create(); try (InputStream in = target.getInputStream()) { ByteStreams.copy(in, out); f.set(true); } catch (IOException e) { f.setException(e); } return f; } }, MoreExecutors.directExecutor() ); chained.addListener( () -> { try { tempOut.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close temporary file on get", e); } }, MoreExecutors.directExecutor()); return chained; } }
Source:
private Map<String, Integer> buildIoTuneMap(StorageQos storageQos) { Map<String, Integer> ioTuneMap = new HashMap<>(); if (storageQos.getMaxThroughput() != null) { ioTuneMap.put(VdsProperties.TotalBytesSec, storageQos.getMaxThroughput() * 1024 * 1024); } if (storageQos.getMaxReadThroughput() != null) { ioTuneMap.put(VdsProperties.ReadBytesSec, storageQos.getMaxReadThroughput() * 1024 * 1024); } if (storageQos.getMaxWriteThroughput() != null) { ioTuneMap.put(VdsProperties.WriteBytesSec, storageQos.getMaxWriteThroughput() * 1024 * 1024); } if (storageQos.getMaxIops() != null) { ioTuneMap.put(VdsProperties.TotalIopsSec, storageQos.getMaxIops()); } if (storageQos.getMaxReadIops() != null) { ioTuneMap.put(VdsProperties.ReadIopsSec, storageQos.getMaxReadIops()); } if (storageQos.getMaxWriteIops() != null) { ioTuneMap.put(VdsProperties.WriteIopsSec, storageQos.getMaxWriteIops()); } return ioTuneMap; }

Target:
private Map<String, Long> buildIoTuneMap(StorageQos storageQos) { Map<String, Long> ioTuneMap = new HashMap<>(); if (storageQos.getMaxThroughput() != null) { ioTuneMap.put(VdsProperties.TotalBytesSec, storageQos.getMaxThroughput() * 1024 * 1024L); } if (storageQos.getMaxReadThroughput() != null) { ioTuneMap.put(VdsProperties.ReadBytesSec, storageQos.getMaxReadThroughput() * 1024 * 1024L); } if (storageQos.getMaxWriteThroughput() != null) { ioTuneMap.put(VdsProperties.WriteBytesSec, storageQos.getMaxWriteThroughput() * 1024 * 1024L); } if (storageQos.getMaxIops() != null) { ioTuneMap.put(VdsProperties.TotalIopsSec, storageQos.getMaxIops().longValue()); } if (storageQos.getMaxReadIops() != null) { ioTuneMap.put(VdsProperties.ReadIopsSec, storageQos.getMaxReadIops().longValue()); } if (storageQos.getMaxWriteIops() != null) { ioTuneMap.put(VdsProperties.WriteIopsSec, storageQos.getMaxWriteIops().longValue()); } return ioTuneMap; }
Source:
public void run() { try { while (!Thread.interrupted()) { checkForBusScan(); Thread.sleep(1000); } } catch (InterruptedException p_i_ex) { logger.error("Openwebnet.run, InterruptedException : " + p_i_ex.getMessage()); } catch (Exception p_i_ex) { logger.error("Openwebnet.run, Exception : {}", p_i_ex.getMessage()); } finally { monitorSessionThread.interrupt(); logger.info("Stopped monitorSessionThread thread"); } logger.info("Stopped OpenWebNet thread"); }

Target:
public void run() { try { while (!Thread.interrupted()) { checkForBusScan(); Thread.sleep(1000); } } catch (InterruptedException p_i_ex) { logger.error("Openwebnet.run, InterruptedException : " + p_i_ex.getMessage()); } catch (Exception p_i_ex) { logger.warn("Openwebnet.run, Exception : {}", p_i_ex.getMessage()); } finally { monitorSessionThread.interrupt(); logger.info("Stopped monitorSessionThread thread"); } logger.info("Stopped OpenWebNet thread"); }
Source:
public String registerExtensionMetadata(final String extensionName, final String path, final String description) throws URISyntaxException, FalconException, IOException{ Configuration conf = new Configuration(); URI uri = new URI(path); conf.set("fs.default.name", uri.getScheme() + "://" + uri.getAuthority()); FileSystem fileSystem = HadoopClientFactory.get().createFalconFileSystem(uri); FileStatus[] fileStatusReadMe = fileSystem.listStatus(new Path(uri.getPath() + "/README")); PathFilter filter=new PathFilter(){ public boolean accept(Path file){ return file.getName().endsWith(".jar"); } }; FileStatus[] fileStatusJar = fileSystem.listStatus(new Path(uri.getPath() + "/libs"), filter); if (fileStatusReadMe.length == 1 && fileStatusJar.length >0){ metaStore.storeExtensionMetadataBean(extensionName, path, ExtensionType.CUSTOM, description); }else{ throw new ValidationException("Packaging structure is not currect please refer to documentation"); } return "Extension :" + extensionName + " registered succesfully."; }

Target:
public String registerExtensionMetadata(final String extensionName, final String path, final String description) throws URISyntaxException, FalconException { Configuration conf = new Configuration(); URI uri = new URI(path); conf.set("fs.default.name", uri.getScheme() + "://" + uri.getAuthority()); FileSystem fileSystem = HadoopClientFactory.get().createFalconFileSystem(uri); try { fileSystem.listStatus(new Path(uri.getPath() + "/README")); } catch (IOException e){ LOG.error("Exception in registerExtensionMetadata:", e); throw new ValidationException("README file is not present in the " + path); } PathFilter filter=new PathFilter(){ public boolean accept(Path file){ return file.getName().endsWith(".jar"); } }; FileStatus[] jarStatus; try { jarStatus = fileSystem.listStatus(new Path(uri.getPath() + "/libs/build"), filter); if (jarStatus.length <=0) { throw new ValidationException("Jars are not present in the " + uri.getPath() + "libs/build."); } } catch (IOException e){ LOG.error("Exception in registerExtensionMetadata:", e); throw new ValidationException("Jars are not present in the " + uri.getPath() + "libs/build."); } FileStatus[] propStatus; try{ propStatus = fileSystem.listStatus(new Path(uri.getPath() + "/META")); if (propStatus.length <=0){ throw new ValidationException("No properties file is not present in the " + uri.getPath() + "/META" + " structure."); } } catch (IOException e){ LOG.error("Exception in registerExtensionMetadata:", e); throw new ValidationException("Directory is not present in the " + uri.getPath() + "/META" + " structure."); } if (!metaStore.checkIfExtensionExists(extensionName)){ metaStore.storeExtensionMetadataBean(extensionName, path, ExtensionType.CUSTOM, description); }else{ throw new ValidationException(extensionName + " already exsists."); } return "Extension :" + extensionName + " registered succesfully."; }
Source:
void saveCreation(final String name, final String defaultGroupId, final String owner) { final Command saveCommand = () -> { final Collection<Repository> repositories = new ArrayList<>(); organizationalUnitService.call((OrganizationalUnit newOrganizationalUnit) -> { afterCreateOrganizationalUnitEvent.fire(new AfterCreateOrganizationalUnitEvent(newOrganizationalUnit)); view.hideBusyIndicator(); notificationEvent.fire(new NotificationEvent(view.getSaveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS)); view.hide(); }, (o, throwable) -> { view.hideBusyIndicator(); view.showError(view.getInvalidNameValidationMessage()); return false; }).createOrganizationalUnit(name, owner, defaultGroupId, repositories); }; validateDuplicatedOrganizationalUnit(name, saveCommand); }

Target:
void saveCreation(final String name, final String defaultGroupId, final String owner) { final Command saveCommand = () -> { final Collection<Repository> repositories = new ArrayList<>(); final RemoteCallback<OrganizationalUnit> successCallback = (OrganizationalUnit newOrganizationalUnit) -> { afterCreateOrganizationalUnitEvent.fire(new AfterCreateOrganizationalUnitEvent(newOrganizationalUnit)); view.hideBusyIndicator(); notificationEvent.fire(new NotificationEvent(view.getSaveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS)); view.hide(); }; final HasBusyIndicatorDefaultErrorCallback errorCallback = new HasBusyIndicatorDefaultErrorCallback(view); organizationalUnitService.call(successCallback, errorCallback).createOrganizationalUnit(name, owner, defaultGroupId, repositories); }; validateDuplicatedOrganizationalUnit(name, saveCommand); }
Source:
public void saveCredentialsOrFinish(FirebaseUser firebaseUser, @Nullable String password, @Nullable IdpResponse response) { if (!mHelper.getFlowParams().smartLockEnabled || getActivity().isFinishing()) { finish(); return; } mName = firebaseUser.getDisplayName(); mEmail = firebaseUser.getEmail(); mPassword = password; mResponse = response; mProfilePictureUri = firebaseUser.getPhotoUrl() != null ? firebaseUser.getPhotoUrl() .toString() : null; mGoogleApiClient = new Builder(getContext().getApplicationContext()) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Auth.CREDENTIALS_API) .enableAutoManage(getActivity(), GoogleApiConstants.AUTO_MANAGE_ID2, this) .build(); mGoogleApiClient.connect(); }

Target:
public void saveCredentialsOrFinish(FirebaseUser firebaseUser, @Nullable String password, @Nullable IdpResponse response) { mResponse = response; if (!mHelper.getFlowParams().smartLockEnabled) { finish(); return; } mName = firebaseUser.getDisplayName(); mEmail = firebaseUser.getEmail(); mPassword = password; mProfilePictureUri = firebaseUser.getPhotoUrl() != null ? firebaseUser.getPhotoUrl() .toString() : null; mGoogleApiClient = new Builder(getContext().getApplicationContext()) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Auth.CREDENTIALS_API) .enableAutoManage(getActivity(), GoogleApiConstants.AUTO_MANAGE_ID2, this) .build(); mGoogleApiClient.connect(); }
Source:
protected ScenarioResultMetadata extractResultMetadata(Map<String, Object> requestContext, ScenarioWithIndex scenarioWithIndex) { DMNModel dmnModel = (DMNModel) requestContext.get(DMNScenarioExecutableBuilder.DMN_MODEL); DMNResult dmnResult = (DMNResult) requestContext.get(DMNScenarioExecutableBuilder.DMN_RESULT); ScenarioResultMetadata scenarioResultMetadata = new ScenarioResultMetadata(scenarioWithIndex); for (DecisionNode decision : dmnModel.getDecisions()) { scenarioResultMetadata.addAvailable(decision.getName()); } final AtomicInteger counter = new AtomicInteger(0); for (DMNDecisionResult decisionResult : dmnResult.getDecisionResults()) { if (SUCCEEDED.equals(decisionResult.getEvaluationStatus())) { scenarioResultMetadata.addExecuted(decisionResult.getDecisionName()); } if (decisionResult.getMessages().isEmpty()) { String message = "Execution # " + counter.addAndGet(1) + " - " + decisionResult.getDecisionName(); scenarioResultMetadata.addAuditMessage(message, decisionResult.getEvaluationStatus().name()); } else { decisionResult.getMessages().forEach(dmnMessage -> { String message = "Execution # " + counter.addAndGet(1) + " - " + dmnMessage.getText(); scenarioResultMetadata.addAuditMessage(message, dmnMessage.getLevel().name()); }); } } return scenarioResultMetadata; }

Target:
protected ScenarioResultMetadata extractResultMetadata(Map<String, Object> requestContext, ScenarioWithIndex scenarioWithIndex) { DMNModel dmnModel = (DMNModel) requestContext.get(DMNScenarioExecutableBuilder.DMN_MODEL); DMNResult dmnResult = (DMNResult) requestContext.get(DMNScenarioExecutableBuilder.DMN_RESULT); ScenarioResultMetadata scenarioResultMetadata = new ScenarioResultMetadata(scenarioWithIndex); for (DecisionNode decision : dmnModel.getDecisions()) { scenarioResultMetadata.addAvailable(decision.getName()); } final AtomicInteger counter = new AtomicInteger(0); for (DMNDecisionResult decisionResult : dmnResult.getDecisionResults()) { if (SUCCEEDED.equals(decisionResult.getEvaluationStatus())) { scenarioResultMetadata.addExecuted(decisionResult.getDecisionName()); } if (decisionResult.getMessages().isEmpty()) { scenarioResultMetadata.addAuditMessage(counter.addAndGet(1), decisionResult.getDecisionName(), decisionResult.getEvaluationStatus().name()); } else { decisionResult.getMessages().forEach(dmnMessage -> scenarioResultMetadata.addAuditMessage(counter.addAndGet(1), dmnMessage.getText(), dmnMessage.getLevel().name())); } } return scenarioResultMetadata; }
Source:
public void renameScriptShell(String newName) { Display.getDefault().asyncExec(() -> { final IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); if (part instanceof ScriptShell) { ((ScriptShell) part).changePartName(newName); } else { final IViewReference[] activeViews = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences(); int activeScriptShell = 0; ScriptShell renamingScriptShell = null; for (final IViewReference activeView : activeViews) { final IViewPart view = activeView.getView(false); if ((view != null) && (ScriptShell.VIEW_ID.equals(activeView.getId()))) { activeScriptShell++; renamingScriptShell = (ScriptShell) view; } } if (activeScriptShell == 1) { renamingScriptShell.changePartName(newName); } else { Logger.error(MODULE_ID, "Detected more than one script shell, no renaming can be performed"); } } }); }

Target:
public void renameScriptShell(String newName) { Display.getDefault().asyncExec(() -> { final IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); if (part instanceof ScriptShell) { ((ScriptShell) part).changePartName(newName); } else { final IViewReference[] viewReferences = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences(); ScriptShell renamingScriptShell = null; for (final IViewReference viewReference : viewReferences) { if (ScriptShell.VIEW_ID.equals(viewReference.getId())) { if (renamingScriptShell != null) { Logger.error(MODULE_ID, "Detected more than one script shell, no renaming can be performed"); return; } else { renamingScriptShell = (ScriptShell) viewReference.getView(true); } } } if (renamingScriptShell != null) renamingScriptShell.changePartName(newName); } }); }
Source:
public Collection<Integer> getSsrcs() { synchronized (critSect) { for(Long ssrcValue : ssrcs_.keySet()){ Number value = ssrcValue; ssrcs.add(value.intValue()); } return ssrcs; } }

Target:
public Collection<Integer> getSsrcs() { synchronized (critSect) { Collection<Integer> ssrcs = new ArrayList<>(); for(Long ssrcValue : ssrcs_.keySet()){ Number value = ssrcValue; ssrcs.add(value.intValue()); } return ssrcs; } }
Source:
public void updateStats(Binary min_value, Binary max_value) { if (comparator().compare(min, min_value) > 0) { min = truncator.truncateMin(min_value.copy(), truncateLength); } if (comparator().compare(max, max_value) < 0) { max = truncator.truncateMax(max_value.copy(), truncateLength); } }

Target:
public void updateStats(Binary min_value, Binary max_value) { if (comparator().compare(min, min_value) > 0) { min = min_value.copy(); } if (comparator().compare(max, max_value) < 0) { max = max_value.copy(); } }
Source:
public IStatus run(IProgressMonitor monitor) { if (session != null) { IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session); if (uiSession.getEditors().isEmpty()) { session.save(monitor); } else { if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null && uiSession.getEditors().contains(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor())) { IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); activeEditor.doSave(monitor); } else { uiSession.getEditors().iterator().next().doSave(monitor); } } } return Status.OK_STATUS; }

Target:
public IStatus run(IProgressMonitor monitor) { if (session != null) { IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session); Collection<DialectEditor> editors = uiSession.getEditors(); if (editors.isEmpty()) { session.save(monitor); } else { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { IEditorPart activeEditor = activeWorkbenchWindow.getActivePage().getActiveEditor(); if (editors.contains(activeEditor)) { activeEditor.doSave(monitor); } } else { editors.iterator().next().doSave(monitor); } } } return Status.OK_STATUS; }
Source:
private void processTransactionsStatus() { if (_transactionUidVector != null) { Enumeration<?> transactionUidEnum = _transactionUidVector.elements(); while (transactionUidEnum.hasMoreElements()) { Uid currentUid = (Uid) transactionUidEnum.nextElement(); try { if (_recoveryStore.currentState(currentUid, _transactionType) != StateStatus.OS_UNKNOWN) { doRecoverTransaction(currentUid); } } catch (ObjectStoreException e) { if (LRALogger.logger.isTraceEnabled()) { LRALogger.logger.tracef("failed to access transaction store %s: %s", currentUid, e.getMessage(), e); } else if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof("failed to access transaction store %s: %s", currentUid, e.getMessage()); } } } } }

Target:
private void processTransactionsStatus() { if (_transactionUidVector != null) { Enumeration<?> transactionUidEnum = _transactionUidVector.elements(); while (transactionUidEnum.hasMoreElements()) { Uid currentUid = (Uid) transactionUidEnum.nextElement(); try { if (_recoveryStore.currentState(currentUid, _transactionType) != StateStatus.OS_UNKNOWN) { doRecoverTransaction(currentUid); } } catch (ObjectStoreException e) { if (LRALogger.logger.isTraceEnabled()) { LRALogger.logger.tracef(e, "LRARecoverModule: Object store exception '%s' while reading the current state of LRA record %s:", e.getMessage(), currentUid.fileStringForm()); } else if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof( "LRARecoverModule: Object store exception '%s' while reading the current state of LRA record %s", e.getMessage(), currentUid.fileStringForm()); } } } } }
Source:
private void setHttpHeaders(Request request, Response response, BinaryContent content) throws MimeTypeException { String mimeType = content.getMimeTypeValue(); String fileExt = getFileExtFromMimeType(mimeType); if (containsGzip(request)) { LOGGER.trace("Request header accepts gzip"); response.header(HttpHeaders.CONTENT_ENCODING, GZIP); } response.type(mimeType); String attachment = String.format("attachment;filename=export-%s%s", Instant.now().toString(), fileExt); response.header(HttpHeaders.CONTENT_DISPOSITION, attachment); }

Target:
private void setHttpHeaders(Request request, Response response, BinaryContent content) throws MimeTypeException { String mimeType = content.getMimeTypeValue(); if (mimeType == null) { LOGGER.debug("Failure to fetch file extension, mime-type is empty"); throw new IllegalArgumentException("Binary Content contains null mime-type value."); } String fileExt = getFileExtFromMimeType(mimeType); if (containsGzip(request)) { LOGGER.trace("Request header accepts gzip"); response.header(HttpHeaders.CONTENT_ENCODING, GZIP); } response.type(mimeType); String attachment = String.format("attachment;filename=export-%s%s", Instant.now().toString(), fileExt); response.header(HttpHeaders.CONTENT_DISPOSITION, attachment); }
Source:
Configuration(String apiKey) { this.apiKey = apiKey; addCallback(new AppCallback(this)); addCallback(new DeviceCallback()); DeviceCallback.initializeCache(); if (ServletCallback.isAvailable()) { addCallback(new ServletCallback()); } sessionDelivery = new AsyncHttpDelivery(); ((HttpDelivery) sessionDelivery).setEndpoint("<LINK_0>"); }

Target:
Configuration(String apiKey) { this.apiKey = apiKey; addCallback(new AppCallback(this)); addCallback(new DeviceCallback()); DeviceCallback.initializeCache(); if (ServletCallback.isAvailable()) { addCallback(new ServletCallback()); } }
Source:
public void onFreed(MgcpEndpoint endpoint) { queue.offer(endpoint); if(logger.isDebugEnabled()) { logger.debug("Endpoint " + endpoint.getName() + " released"); logger.debug("Free " + endpoint.getEndpoint().toString() + " endpoints " + queue.size()); } }

Target:
public void onFreed(MgcpEndpoint endpoint) { queue.offer(endpoint); if(logger.isDebugEnabled()) { logger.debug("Endpoint " + endpoint.getName() + " released (free="+queue.size()+")"); } }
Source:
public void clear() { itens.clear(); selection.clear(); notifiyMissionUpdate(); }

Target:
public void clear() { items.clear(); selection.clear(); notifiyMissionUpdate(); }
Source:
public static String elementToString(Element element) { try { if (element == null) { return null; } TransformerFactory factory = TransformerFactory.newInstance(); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); Transformer transformer = factory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); StringWriter buff = new StringWriter(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.transform(new DOMSource(element), new StreamResult(buff)); return buff.toString(); } catch (Exception e) { log.error("Error while convering element to string: " + e.getMessage(), e); return null; } }

Target:
public static String elementToString(Element element) { try (StringWriter buff = new StringWriter()) { if (element == null) { return null; } TransformerFactory factory = TransformerFactory.newInstance(); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); Transformer transformer = factory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.transform(new DOMSource(element), new StreamResult(buff)); return buff.toString(); } catch (TransformerException e) { log.error("Error while converting element to string: " + e.getMessage(), e); return null; } catch (IOException e) { log.error("Error while closing StringWriter " + e.getMessage(), e); return null; } }
Source:
public List<Long> findCcRemovedJudgmentSourceIds() { log.info("Searching for ccJudgments removed from external repository"); List<Long> removedJudgmentsIds = judgmentRepository.findAllIdsBySourceCode(SourceCode.COMMON_COURT); int pageNumber = 0; while(true) { List<String> judgmentExternalIdsPage = sourceCcjExternalRepository.findJudgmentIds(pageNumber, pageSize, null); log.info("Downloaded judgment ids from external repository", (pageNumber*pageSize) + judgmentExternalIdsPage.size()); if (judgmentExternalIdsPage.isEmpty()) { break; } List<Long> judgmentIdsPage = judgmentRepository.findAllIdsBySourceCodeAndSourceJudgmentIds(SourceCode.COMMON_COURT, judgmentExternalIdsPage); removedJudgmentsIds.removeAll(judgmentIdsPage); ++pageNumber; } return removedJudgmentsIds; }

Target:
public List<Long> findCcRemovedJudgmentSourceIds() { log.info("Searching for ccJudgments removed from external repository"); List<Long> removedJudgmentsIds = judgmentRepository.findAllIdsBySourceCode(SourceCode.COMMON_COURT); int pageNumber = 0; while(true) { List<String> judgmentExternalIdsPage = sourceCcjExternalRepository.findJudgmentIds(pageNumber, externalRepositoryPageSize, null); log.info("Downloaded judgment ids from external repository", (pageNumber*externalRepositoryPageSize) + judgmentExternalIdsPage.size()); if (judgmentExternalIdsPage.isEmpty()) { break; } List<Long> judgmentIdsPage = findCorrespondingJudgmentIds(judgmentExternalIdsPage); removedJudgmentsIds.removeAll(judgmentIdsPage); ++pageNumber; } return removedJudgmentsIds; }
Source:
public void pause() { try { log.debug("Stopping session for EventReciever."); if (!this.consumer.isClosed()) { this.consumer.close(); } } catch (ActiveMQException e) { log.warn("Message receiver could not stop client consumer.", e); } }

Target:
public void pause() { try { log.debug("Pausing message consumption for: {}.", listener); this.consumer.close(); } catch (ActiveMQException e) { log.warn("Message receiver could not stop client consumer.", e); } }
Source:
public List<WorkspaceImpl> getWorkspaces(String user, boolean includeRuntimes) throws ServerException { requireNonNull(user, "Required non-null user id"); final List<WorkspaceImpl> workspaces = workspaceDao.getWorkspaces(user); if (includeRuntimes) { for (WorkspaceImpl workspace : workspaces) { normalizeState(workspace); } } else { for (WorkspaceImpl workspace : workspaces) { workspace.setStatus(runtimes.getStatus(workspace.getId())); } } return workspaces; }

Target:
public List<WorkspaceImpl> getWorkspaces(String user, boolean includeRuntimes) throws ServerException { requireNonNull(user, "Required non-null user id"); final List<WorkspaceImpl> workspaces = workspaceDao.getWorkspaces(user); for (WorkspaceImpl workspace : workspaces) { normalizeState(workspace, includeRuntimes); } return workspaces; }
Source:
private Object handleNonTxWriteCommand(InvocationContext ctx, WriteCommand command) throws Throwable { if (trace) log.tracef("handleNonTxWriteCommand for command %s, topology id %d", command, command.getTopologyId()); if (isLocalOnly(ctx, command)) { return invokeNextInterceptor(ctx, command); } updateTopologyId(command); if (!ctx.isOriginLocal()) { return invokeNextInterceptor(ctx, command); } int commandTopologyId = command.getTopologyId(); Object localResult; try { localResult = invokeNextInterceptor(ctx, command); return localResult; } catch (CacheException e) { Throwable ce = e; while (ce instanceof RemoteException) { ce = ce.getCause(); } if (!(ce instanceof OutdatedTopologyException) && !(ce instanceof SuspectException)) throw e; if (trace) log.tracef("Retrying command because of topology change, current topology is %d: %s", command.getTopologyId(), command); int newTopologyId = Math.max(currentTopologyId(), commandTopologyId + 1); command.setTopologyId(newTopologyId); waitForTransactionData(newTopologyId); command.setFlags(Flag.COMMAND_RETRY); localResult = handleNonTxWriteCommand(ctx, command); } return localResult; }

Target:
private Object handleNonTxWriteCommand(InvocationContext ctx, WriteCommand command) throws Throwable { if (trace) log.tracef("handleNonTxWriteCommand for command %s, topology id %d", command, command.getTopologyId()); if (isLocalOnly(ctx, command)) { return invokeNextInterceptor(ctx, command); } updateTopologyId(command); if (!ctx.isOriginLocal()) { return invokeNextInterceptor(ctx, command); } int commandTopologyId = command.getTopologyId(); Object localResult; try { localResult = invokeNextInterceptor(ctx, command); return localResult; } catch (CacheException e) { Throwable ce = e; while (ce instanceof RemoteException) { ce = ce.getCause(); } if (!(ce instanceof OutdatedTopologyException) && !(ce instanceof SuspectException)) throw e; int currentTopologyId = currentTopologyId(); if (trace) log.tracef("Retrying command because of topology change, current topology is %d: %s", currentTopologyId, command); int newTopologyId = Math.max(currentTopologyId, commandTopologyId + 1); command.setTopologyId(newTopologyId); waitForTransactionData(newTopologyId); command.setFlags(Flag.COMMAND_RETRY); localResult = handleNonTxWriteCommand(ctx, command); } return localResult; }
Source:
private void notifyDataSetChanged() { if (isFinishing()) { return; } if (search == null) { return; } final ScrollView scroll = ButterKnife.findById(this, R.id.detailScroll); cache = search.getFirstCacheFromResult(LoadFlags.LOAD_ALL_DB_ONLY); if (cache == null) { progress.dismiss(); showToast(res.getString(R.string.err_detail_cache_find_some)); finish(); return; } cache.setChangeNotificationHandler(new ChangeNotificationHandler(this, progress)); setCacheTitleBar(cache); imagesList = null; reinitializeViewPager(); invalidateOptionsMenuCompatible(); progress.dismiss(); Settings.addCacheToHistory(cache.getGeocode()); final ScrollView scrollNew = ButterKnife.findById(this, R.id.detailScroll); if ((scroll != null) && (scrollNew != null)) { final int lastScrollPos = scroll.getScrollY(); scrollNew.post(new Runnable() { @Override public void run() { scrollNew.scrollTo(0, lastScrollPos); } }); } }

Target:
private void notifyDataSetChanged() { if (isFinishing()) { return; } if (search == null) { return; } cache = search.getFirstCacheFromResult(LoadFlags.LOAD_ALL_DB_ONLY); if (cache == null) { progress.dismiss(); showToast(res.getString(R.string.err_detail_cache_find_some)); finish(); return; } cache.setChangeNotificationHandler(new ChangeNotificationHandler(this, progress)); setCacheTitleBar(cache); final ScrollView scroll = ButterKnife.findById(this, R.id.detailScroll); imagesList = null; reinitializeViewPager(); invalidateOptionsMenuCompatible(); progress.dismiss(); Settings.addCacheToHistory(cache.getGeocode()); if (scroll != null) { final int lastScrollPos = scroll.getScrollY(); final ScrollView scrollNew = ButterKnife.findById(this, R.id.detailScroll); scrollNew.post(new Runnable() { @Override public void run() { scrollNew.scrollTo(0, lastScrollPos); } }); } }
Source:
public void close_blocksUntilFirstCallToCloseCompletes() throws Exception { gemFireCacheImpl = gemFireCacheImpl(false); CyclicBarrier cyclicBarrier = new CyclicBarrier(3); Future<Boolean> close1 = executorServiceRule.submit(() -> { synchronized (GemFireCacheImpl.class) { cyclicBarrier.await(getTimeout().toMillis(), MILLISECONDS); return gemFireCacheImpl.doClose("test", null, false, false, false); } }); await().until(() -> cyclicBarrier.getNumberWaiting() == 1); Future<Boolean> close2 = executorServiceRule.submit(() -> { cyclicBarrier.await(getTimeout().toMillis(), MILLISECONDS); return gemFireCacheImpl.doClose("test", null, false, false, false); }); cyclicBarrier.await(getTimeout().toMillis(), MILLISECONDS); boolean closedCache1 = close1.get(); boolean closedCache2 = close2.get(); assertThat(closedCache1) .as("closedCache1=" + closedCache1 + " and closedCache2=" + closedCache2) .isTrue(); }

Target:
public void close_blocksUntilFirstCallToCloseCompletes() throws Exception { gemFireCacheImpl = gemFireCacheImpl(false); CyclicBarrier cyclicBarrier = new CyclicBarrier(3); Future<Boolean> close1 = executorServiceRule.submit(() -> { synchronized (GemFireCacheImpl.class) { cyclicBarrier.await(getTimeout().toMillis(), MILLISECONDS); return gemFireCacheImpl.doClose("test", null, false, false, false); } }); await().until(() -> cyclicBarrier.getNumberWaiting() == 1); Future<Boolean> close2 = executorServiceRule.submit(() -> { cyclicBarrier.await(getTimeout().toMillis(), MILLISECONDS); return gemFireCacheImpl.doClose("test", null, false, false, false); }); cyclicBarrier.await(getTimeout().toMillis(), MILLISECONDS); boolean closedCache1 = close1.get(); boolean closedCache2 = close2.get(); assertThat(closedCache1) .as("closedCache1=" + closedCache1 + " and closedCache2=" + closedCache2) .isTrue(); assertThat(closedCache2) .as("closedCache1=" + closedCache1 + " and closedCache2=" + closedCache2) .isFalse(); }
Source:
private Part loadPart(File stateDir, String objectId, String partFileName) { File objectStateDir = getObjectStateDir(stateDir, objectId); File partFile = new File(objectStateDir, partFileName); val mapper = new ObjectMapper(); Part part = null; try (val partStream = new FileInputStream(partFile)) { part = mapper.readValue(partStream, Part.class); } catch (IOException e) { throw new NotRetryableException(e); } return part; }

Target:
private Part loadPart(File stateDir, String objectId, String partFileName) { File objectStateDir = getObjectStateDir(stateDir, objectId); File partFile = new File(objectStateDir, partFileName); return readPart(partFile); }
Source:
public void partitionPage(Page page) { int positionCount = page.getPositionCount(); int initialPositionCountForEachBuffer = min(positionCount, (positionCount / partitionFunction.getPartitionCount() + 1) * 2); for (int i = 0; i < partitionBuffers.length; i++) { partitionBuffers[i].resetPositions(initialPositionCountForEachBuffer); } Block nullBlock = nullChannel.isPresent() ? page.getBlock(nullChannel.getAsInt()) : null; Page partitionFunctionArgs = getPartitionFunctionArguments(page); for (int position = 0; position < positionCount; position++) { boolean shouldReplicate = (replicatesAnyRow && !hasAnyRowBeenReplicated) || nullBlock != null && nullBlock.isNull(position); if (shouldReplicate) { for (int i = 0; i < partitionBuffers.length; i++) { partitionBuffers[i].addPosition(position); } hasAnyRowBeenReplicated = true; } else { int partition = partitionFunction.getPartition(partitionFunctionArgs, position); partitionBuffers[partition].addPosition(position); } } decodedBlocksRetainedSize = 0; for (int i = 0; i < decodedBlocks.length; i++) { decodedBlocks[i] = decodeBlock(flattener, blockLeaseCloser, page.getBlock(i)); decodedBlocksRetainedSize += decodedBlocks[i].getRetainedSizeInBytes(); } for (int i = 0; i < partitionBuffers.length; i++) { partitionBuffers[i].appendData(decodedBlocks, decodedBlocksRetainedSize, fixedWidthRowSize, variableWidthChannels, outputBuffer); } try { blockLeaseCloser.close(); } catch (IOException e) { throw new UncheckedIOException(e); } }

Target:
public void partitionPage(Page page) { int positionCount = page.getPositionCount(); int initialPositionCountForEachBuffer = min(positionCount, (positionCount / partitionFunction.getPartitionCount() + 1) * 2); for (int i = 0; i < partitionBuffers.length; i++) { partitionBuffers[i].resetPositions(initialPositionCountForEachBuffer); } Block nullBlock = nullChannel.isPresent() ? page.getBlock(nullChannel.getAsInt()) : null; Page partitionFunctionArgs = getPartitionFunctionArguments(page); for (int position = 0; position < positionCount; position++) { boolean shouldReplicate = (replicatesAnyRow && !hasAnyRowBeenReplicated) || nullBlock != null && nullBlock.isNull(position); if (shouldReplicate) { for (int i = 0; i < partitionBuffers.length; i++) { partitionBuffers[i].addPosition(position); } hasAnyRowBeenReplicated = true; } else { int partition = partitionFunction.getPartition(partitionFunctionArgs, position); partitionBuffers[partition].addPosition(position); } } long estimatedSerializedPageSize = 0; for (int i = 0; i < decodedBlocks.length; i++) { decodedBlocks[i] = decodeBlock(flattener, blockLeaseCloser, page.getBlock(i)); estimatedSerializedPageSize += decodedBlocks[i].getEstimatedSerializedSizeInBytes(); } for (int i = 0; i < partitionBuffers.length; i++) { partitionBuffers[i].appendData(decodedBlocks, estimatedSerializedPageSize, fixedWidthRowSize, variableWidthChannels, outputBuffer); } try { blockLeaseCloser.close(); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
private boolean added(Provider<E> provider, E element, Collection<E> providerElements) { final K uid = element.getUID(); if (identifierToElement.containsKey(uid)) { logger.warn( "{} with key '{}' already exists from provider {}! Failed to add a second with the same UID from provider {}!", element.getClass().getSimpleName(), uid, elementToProvider.get(identifierToElement.get(uid)).getClass().getSimpleName(), provider.getClass().getSimpleName()); return false; } try { onAddElement(element); } catch (final RuntimeException ex) { logger.warn("Could not add element: {}", ex.getMessage(), ex); return false; } identifierToElement.put(element.getUID(), element); elementToProvider.put(element, provider); providerElements.add(element); elements.add(element); return true; }

Target:
private boolean added(Provider<E> provider, E element, Collection<E> providerElements) { final K uid = element.getUID(); if (identifierToElement.containsKey(uid)) { logger.warn( "Cannot add \"{}\" with key \"{}\". It exists already from provider \"{}\"! Failed to add a second with the same UID from provider \"{}\"!", element.getClass().getSimpleName(), uid, elementToProvider.get(identifierToElement.get(uid)).getClass().getSimpleName(), provider.getClass().getSimpleName()); return false; } try { onAddElement(element); } catch (final RuntimeException ex) { logger.warn("Cannot add \"{}\" with key \"{}\": {}", element.getClass().getSimpleName(), uid, ex.getMessage(), ex); return false; } identifierToElement.put(element.getUID(), element); elementToProvider.put(element, provider); providerElements.add(element); elements.add(element); return true; }
Source:
private void assertExpectedValueDisplayed(String dsName, String attribute, String expectedValue) { page.invokeViewDatasource(dsName); ConnectionConfig connection = page.getConnectionConfig(); String actualValue = connection.getAttributeValueBySubstring(attribute); Assert.assertEquals("Incorrect value of " + attribute + " displayed. See <LINK_0>", expectedValue, actualValue); }

Target:
private void assertExpectedValueDisplayed(String dsName, String attribute, String expectedValue) { page.invokeViewDatasource(dsName); ConnectionConfig connection = page.getConnectionConfig(); String actualValue = connection.getAttributeValueBySubstring(attribute); Assert.assertEquals("Incorrect value of " + attribute + " displayed. See <LINK_1>", expectedValue, actualValue); }
Source:
private List<ServerChecker> getServerCheckers() throws InfrastructureException { ArrayList<ServerChecker> checkers = new ArrayList<>(servers.size()); for (Map.Entry<String, ServerImpl> serverEntry : servers.entrySet()) { if (!livenessChecksPaths.containsKey(serverEntry.getKey())) { continue; } checkers.add(getChecker(serverEntry.getKey(), serverEntry.getValue())); } return checkers; }

Target:
private List<ServerChecker> getServerCheckers() throws InfrastructureException { ArrayList<ServerChecker> checkers = new ArrayList<>(servers.size()); for (Map.Entry<String, ServerImpl> serverEntry : servers.entrySet()) { if (LIVENESS_CHECKS_PATHS.containsKey(serverEntry.getKey())) { checkers.add(getChecker(serverEntry.getKey(), serverEntry.getValue())); } } return checkers; }
Source:
public void clearMessageSentToClientWithRegisteredInterest() throws Exception { Region<Object, Object> testRegion = client.getCache().getRegion(NAME); assertThat(testRegion).isEmpty(); server1.invoke(() -> addRecord(10)); assertThat(testRegion).hasSize(0); testRegion.registerInterestForAllKeys(); assertThat(testRegion).hasSize(10); Boolean cleared = false; for (int i = 0; i < servers.size(); i++) { if (!cleared) { cleared = servers.get(i).invoke( PartitionRegionClearMessageQueueDUnitTest::clearRegionOnNoClientProxyMember); } } assertThat(cleared).isTrue(); assertThat(testRegion).hasSize(0); }

Target:
public void clearMessageSentToClientWithRegisteredInterest() throws Exception { Region<Object, Object> testRegion = client.getCache().getRegion(NAME); assertThat(testRegion).isEmpty(); server1.invoke(() -> addRecord(10)); assertThat(testRegion).hasSize(0); testRegion.registerInterestForAllKeys(); assertThat(testRegion).hasSize(10); Boolean cleared = false; for (int i = 0; i < servers.size(); i++) { cleared = servers.get(i).invoke( PartitionRegionClearMessageQueueDUnitTest::clearRegionOnNoClientProxyMember); if (cleared) { break; } } assertThat(cleared).isTrue(); assertThat(testRegion).hasSize(0); }
Source:
private List<IASTInitializerClause> initializerList(boolean allowSkipping) throws EndOfFileException, BacktrackException { List<IASTInitializerClause> result= new ArrayList<IASTInitializerClause>(); loop: while (true) { IASTInitializerClause clause = initClause(allowSkipping); if (allowSkipping && maximumTrivialExpressionsInAggregateInitializers <= result.size()) { if (!ASTQueries.canContainName(clause)) { translationUnit.setHasNodesOmitted(true); clause= null; } } if (LT(1) == IToken.tELLIPSIS) { final int endOffset = consume(IToken.tELLIPSIS).getEndOffset(); if (clause instanceof ICPPASTPackExpandable) { ((ICPPASTPackExpandable) clause).setIsPackExpansion(true); adjustEndOffset(clause, endOffset); } else if (clause instanceof IASTExpression) { IASTExpression packExpansion= nodeFactory.newPackExpansionExpression((IASTExpression) clause); clause= setRange(packExpansion, clause, endOffset); } } result.add(clause); if (LT(1) != IToken.tCOMMA) break; switch (LT(2)) { case IToken.tRBRACE: case IToken.tRPAREN: case IToken.tEOC: break loop; } consume(IToken.tCOMMA); } return result; }

Target:
private List<IASTInitializerClause> initializerList(boolean allowSkipping) throws EndOfFileException, BacktrackException { List<IASTInitializerClause> result= new ArrayList<IASTInitializerClause>(); loop: while (true) { IASTInitializerClause clause = initClause(allowSkipping); if (allowSkipping && result.size() >= maximumTrivialExpressionsInAggregateInitializers && !ASTQueries.canContainName(clause)) { translationUnit.setHasNodesOmitted(true); clause= null; } if (LT(1) == IToken.tELLIPSIS) { final int endOffset = consume(IToken.tELLIPSIS).getEndOffset(); if (clause instanceof ICPPASTPackExpandable) { ((ICPPASTPackExpandable) clause).setIsPackExpansion(true); adjustEndOffset(clause, endOffset); } else if (clause instanceof IASTExpression) { IASTExpression packExpansion= nodeFactory.newPackExpansionExpression((IASTExpression) clause); clause= setRange(packExpansion, clause, endOffset); } } result.add(clause); if (LT(1) != IToken.tCOMMA) break; switch (LT(2)) { case IToken.tRBRACE: case IToken.tRPAREN: case IToken.tEOC: break loop; } consume(IToken.tCOMMA); } return result; }
Source:
public KnoxShellTableFilter name(String name) { for (int i = 0; i < tableToFilter.headers.size(); i++) { if (tableToFilter.headers.get(i).equalsIgnoreCase(name)) { index = i; break; } else { index = -1; } } return this; }

Target:
public KnoxShellTableFilter name(String name) throws KnoxShellTableFilterException { for (int i = 0; i < tableToFilter.headers.size(); i++) { if (tableToFilter.headers.get(i).equalsIgnoreCase(name)) { index = i; break; } } if (index == -1) { throw new KnoxShellTableFilterException("Column name not found"); } return this; }