auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAllComposingConstraintsMustBeApplicableToAnnotatedType() { validator.validate( new Shoe( 41 ) ); fail( "Shoe defines @NotEmpty on an int. Validation should have failed." ); }

Target:
public void testAllComposingConstraintsMustBeApplicableToAnnotatedType() { validator.validate( new Shoe( 41 ) ); }
Source:
protected void updateTreeNode(ITreeNode node) { if (getSwtTreeViewer() != null) { getSwtTreeViewer().update(node, null); } }

Target:
protected void updateTreeNode(ITreeNode node) { getSwtTreeViewer().update(node, null); }
Source:
private static TypeCompatibility compatibility(DataType<?> fromType, DataType<?> toType) { if (fromType.equals(toType)) { return compatible(toType, true); } if (fromType.equals(UndefinedType.INSTANCE)) { return compatible(toType, true); } if (toType.equals(UndefinedType.INSTANCE)) { return compatible(fromType, false); } String fromTypeBaseName = fromType.getTypeSignature().getBaseTypeName(); String toTypeBaseName = toType.getTypeSignature().getBaseTypeName(); if (fromTypeBaseName.equals(toTypeBaseName)) { if (!fromType.getTypeParameters().isEmpty() || !toType.getTypeParameters().isEmpty()) { return typeCompatibilityForParametrizedType(fromType, toType); } return compatible(fromType, false); } DataType<?> commonType = convertTypeByPrecedence(fromType, toType); if (commonType != null) { return compatible(commonType, commonType.equals(toType)); } return INCOMPATIBLE; }

Target:
private static DataType<?> compatibility(DataType<?> fromType, DataType<?> toType) { if (fromType.equals(toType)) { return toType; } if (fromType.equals(UndefinedType.INSTANCE)) { return toType; } if (toType.equals(UndefinedType.INSTANCE)) { return fromType; } String fromTypeBaseName = fromType.getTypeSignature().getBaseTypeName(); String toTypeBaseName = toType.getTypeSignature().getBaseTypeName(); if (fromTypeBaseName.equals(toTypeBaseName)) { if (!fromType.getTypeParameters().isEmpty() || !toType.getTypeParameters().isEmpty()) { return typeCompatibilityForParametrizedType(fromType, toType); } return fromType; } return convertTypeByPrecedence(fromType, toType); }
Source:
public CloudToStoreReplicationManager(ReplicationConfig replicationConfig, ClusterMapConfig clusterMapConfig, StoreConfig storeConfig, StoreManager storeManager, StoreKeyFactory storeKeyFactory, ClusterMap clusterMap, ScheduledExecutorService scheduler, DataNodeId currentNode, ConnectionPool connectionPool, MetricRegistry metricRegistry, NotificationSystem requestNotification, StoreKeyConverterFactory storeKeyConverterFactory, String transformerClassName, ClusterSpectator vcrClusterSpectator, ClusterParticipant clusterParticipant) throws ReplicationException { super(replicationConfig, clusterMapConfig, storeKeyFactory, clusterMap, scheduler, currentNode, Collections.emptyList(), connectionPool, metricRegistry, requestNotification, storeKeyConverterFactory, transformerClassName); this.clusterMapConfig = clusterMapConfig; this.storeConfig = storeConfig; this.storeManager = storeManager; this.vcrClusterSpectator = vcrClusterSpectator; this.clusterParticipant = clusterParticipant; this.instanceNameToCloudDataNode = new AtomicReference<>(new ConcurrentHashMap<>()); this.vcrNodes = new AtomicReference<>(new ConcurrentSkipListSet<>()); this.persistor = new DiskTokenPersistor(cloudReplicaTokenFileName, mountPathToPartitionInfos, replicationMetrics, clusterMap, tokenHelper, storeManager); this.localPartitionNameToPartition = mapPartitionNameToPartition(clusterMap, currentNode); this.partitionsToReplicate = replicationConfig.vcrRecoveryPartitions.isEmpty() ? new HashSet<>() : Arrays.stream(replicationConfig.vcrRecoveryPartitions.split(",")).collect(Collectors.toSet()); }

Target:
public CloudToStoreReplicationManager(ReplicationConfig replicationConfig, ClusterMapConfig clusterMapConfig, StoreConfig storeConfig, StoreManager storeManager, StoreKeyFactory storeKeyFactory, ClusterMap clusterMap, ScheduledExecutorService scheduler, DataNodeId currentNode, ConnectionPool connectionPool, MetricRegistry metricRegistry, NotificationSystem requestNotification, StoreKeyConverterFactory storeKeyConverterFactory, String transformerClassName, ClusterSpectator vcrClusterSpectator, ClusterParticipant clusterParticipant) throws ReplicationException { super(replicationConfig, clusterMapConfig, storeKeyFactory, clusterMap, scheduler, currentNode, Collections.emptyList(), connectionPool, metricRegistry, requestNotification, storeKeyConverterFactory, transformerClassName); this.clusterMapConfig = clusterMapConfig; this.storeConfig = storeConfig; this.storeManager = storeManager; this.vcrClusterSpectator = vcrClusterSpectator; this.clusterParticipant = clusterParticipant; this.instanceNameToCloudDataNode = new AtomicReference<>(new ConcurrentHashMap<>()); this.vcrNodes = new AtomicReference<>(new ConcurrentSkipListSet<>()); this.persistor = new DiskTokenPersistor(cloudReplicaTokenFileName, mountPathToPartitionInfos, replicationMetrics, clusterMap, tokenHelper, storeManager); this.localPartitionNameToPartition = mapPartitionNameToPartition(clusterMap, currentNode); }
Source:
public void writeInfoFromNode(List<ITmfStateInterval> stateInfo, long t) throws TimeRangeException { fRwl.readLock().lock(); try { for (int i = getStartIndexFor(t); i < fIntervals.size(); i++) { ITmfStateInterval interval = fIntervals.get(i); if (interval.getStartTime() <= t && interval.getEndTime() >= t && interval.getAttribute() < stateInfo.size()) { stateInfo.set(interval.getAttribute(), interval); } } } finally { fRwl.readLock().unlock(); } }

Target:
public void writeInfoFromNode(List<ITmfStateInterval> stateInfo, long t) throws TimeRangeException { fRwl.readLock().lock(); try { for (int i = getStartIndexFor(t); i < fIntervals.size(); i++) { ITmfStateInterval interval = fIntervals.get(i); if (t >= interval.getStartTime() && interval.getAttribute() < stateInfo.size()) { stateInfo.set(interval.getAttribute(), interval); } } } finally { fRwl.readLock().unlock(); } }
Source:
public void validateAndDeleteCertificate() throws CertificateManagerException { if (isHashTokenEmpty()) { String hashToken = service.getHashToken(trustStorePasskey); if (service.validateTrustStorePassKey(trustStorePasskey)) { saveHashToken(hashToken); RequestContext.getCurrentInstance().execute("PF('deletePassKeyDlg').hide();"); deleteCertificate(hashToken); } else { HelperUtil.addMessageError(DELETE_PASS_ERR_MSG_ID, INVALID_PASS_ERR_MSG); } } else { deleteCertificate(getHashTokenFromSession()); } trustStorePasskey = null; }

Target:
public void validateAndDeleteCertificate() throws CertificateManagerException { if (isHashTokenEmpty()) { String hashToken = service.getHashToken(trustStorePasskey); if (deleteCertificate(hashToken)) { saveHashToken(hashToken); RequestContext.getCurrentInstance().execute("PF('deletePassKeyDlg').hide();"); } else { HelperUtil.addMessageError(DELETE_PASS_ERR_MSG_ID, BAD_MISMATCH_TOKEN); } } else { deleteCertificate(getHashTokenFromSession()); } trustStorePasskey = null; }
Source:
public void validateInputTask(PluginTask task) { super.validateInputTask(task); if (StringUtils.isBlank(task.getCustomObjectFilterType())) { throw new ConfigException("`custom_object_filter_type` cannot empty"); } if (StringUtils.isBlank(task.getCustomObjectAPIName())) { throw new ConfigException("`custom_object_api_name` cannot empty"); } if (task.getToValue().isPresent() && task.getToValue().get() < task.getFromValue()) { throw new ConfigException(String.format("`to_value` (%s) cannot less than the `from_value` (%s)", task.getToValue().get(), task.getFromValue())); } }

Target:
public void validateInputTask(PluginTask task) { super.validateInputTask(task); if (StringUtils.isBlank(task.getCustomObjectFilterType())) { throw new ConfigException("`custom_object_filter_type` cannot be empty"); } if (StringUtils.isBlank(task.getCustomObjectAPIName())) { throw new ConfigException("`custom_object_api_name` cannot be empty"); } if (task.getToValue().isPresent() && task.getToValue().get() < task.getFromValue()) { throw new ConfigException(String.format("`to_value` (%s) cannot be less than the `from_value` (%s)", task.getToValue().get(), task.getFromValue())); } }
Source:
private static ZipOutputStream newZipOutputStreamFor(Path decryptFile) { Validate.notNull(decryptFile, "invalid null decrypt file"); try { return new ZipOutputStream( new BufferedOutputStream(new FileOutputStream(decryptFile.toFile()))); } catch (SecurityException | FileNotFoundException e) { throw new MigrationException(Messages.DECRYPT_FILE_CREATE_ERROR, decryptFile, e); } }

Target:
private static ZipOutputStream newZipOutputStreamFor(Path decryptFile) { Validate.notNull(decryptFile, "invalid null decrypt file"); try { return new ZipOutputStream( new BufferedOutputStream(new FileOutputStream(decryptFile.toFile()))); } catch (FileNotFoundException e) { throw new MigrationException(Messages.DECRYPT_FILE_CREATE_ERROR, decryptFile, e); } }
Source:
private static String createTabletDirectoryName(ServerContext context, Text endRow) { if (endRow == null) { return Constants.DEFAULT_TABLET_DIR_NAME; } else { UniqueNameAllocator namer = context.getUniqueNameAllocator(); return Constants.GENERATED_TABLET_DIRECTORY_PREFIX + namer.getNextName(); } }

Target:
private static String createTabletDirectoryName(ServerContext context, Text endRow) { if (endRow == null) { return ServerColumnFamily.DEFAULT_TABLET_DIR_NAME; } else { UniqueNameAllocator namer = context.getUniqueNameAllocator(); return Constants.GENERATED_TABLET_DIRECTORY_PREFIX + namer.getNextName(); } }
Source:
private void initFragmentsWithFile() { if (getAccount() != null && getFile() != null) { OCFileListFragment listOfFiles = getListOfFilesFragment(); if (listOfFiles != null) { listOfFiles.listDirectory(getCurrentDir()); } else { Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >("); } OCFile file = getFile(); Fragment secondFragment = chooseInitialSecondFragment(file); if (secondFragment != null) { setSecondFragment(secondFragment); updateFragmentsVisibility(true); updateActionBarTitleAndHomeButton(file); } else { cleanSecondFragment(); if (file.isDown() && PreviewTextFragment.canBePreviewed(file)) startTextPreview(file); } switchLayout(getFile()); } else { Log_OC.wtf(TAG, "initFragments() called with invalid NULLs!"); if (getAccount() == null) { Log_OC.wtf(TAG, "\t account is NULL"); } if (getFile() == null) { Log_OC.wtf(TAG, "\t file is NULL"); } } }

Target:
private void initFragmentsWithFile() { if (getAccount() != null && getFile() != null) { OCFileListFragment listOfFiles = getListOfFilesFragment(); if (listOfFiles != null) { listOfFiles.listDirectory(getCurrentDir()); } else { Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >("); } OCFile file = getFile(); Fragment secondFragment = chooseInitialSecondFragment(file); if (secondFragment != null) { setSecondFragment(secondFragment); updateFragmentsVisibility(true); updateActionBarTitleAndHomeButton(file); } else { cleanSecondFragment(); if (file.isDown() && PreviewTextFragment.canBePreviewed(file)) startTextPreview(file); } } else { Log_OC.wtf(TAG, "initFragments() called with invalid NULLs!"); if (getAccount() == null) { Log_OC.wtf(TAG, "\t account is NULL"); } if (getFile() == null) { Log_OC.wtf(TAG, "\t file is NULL"); } } }
Source:
public TextEdit formatModuleInfoFile(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator) { boolean tmp = this.isInModuleInfo; this.isInModuleInfo = true; TextEdit edit = format(kind, source, new IRegion[] { new Region(offset, length) }, indentationLevel, lineSeparator); this.isInModuleInfo = tmp; return edit; }

Target:
public TextEdit formatModuleInfoFile(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator) { boolean tmp = this.isInModuleInfo; try { this.isInModuleInfo = true; return format(kind, source, new IRegion[] { new Region(offset, length) }, indentationLevel, lineSeparator); } finally { this.isInModuleInfo = tmp; } }
Source:
public boolean getRequiredParamBoolean(final String key) throws ActionParamsException { final String errMsg = "Required parameter '" + key + "' missing!"; final String val = getRequiredParam(key, errMsg); try { return Boolean.parseBoolean(val); } catch (Exception e) { throw new ActionParamsException(errMsg); } }

Target:
public boolean getRequiredParamBoolean(final String key) throws ActionParamsException { final String val = getRequiredParam(key); try { return Boolean.parseBoolean(val); } catch (Exception e) { throw new ActionParamsException(e.getMessage()); } }
Source:
protected void executeCommand() { List<VDS> hosts = vdsDao.getAllForCluster(getParameters().getClusterId()); List<ActionParametersBase> params = new LinkedList<>(); int i = 0; for (VDS host: hosts) { params.add(i++, new VdsActionParameters(host.getId())); } runInternalMultipleActions(ActionType.SyncAllHostNetworks, params, getExecutionContext()); setSucceeded(true); }

Target:
protected void executeCommand() { List<ActionParametersBase> params = hosts.stream() .map(host -> new VdsActionParameters(host.getId())) .collect(Collectors.toList()); runInternalMultipleActions(ActionType.SyncAllHostNetworks, params); setSucceeded(true); }
Source:
public void close() { read = null; hasChanges = HasChanges.MAYBE; addedNodes = emptySet(); reset(); if ( labelCursor != null ) { labelCursor.close(); labelCursor = null; } if ( pageCursor != null ) { pageCursor.close(); pageCursor = null; if ( pool != null ) { pool.accept( this ); } } }

Target:
public void close() { read = null; hasChanges = HasChanges.MAYBE; addedNodes = emptySet(); reset(); if ( labelCursor != null ) { labelCursor.close(); labelCursor = null; } if ( pageCursor != null ) { pageCursor.close(); pageCursor = null; pool.accept( this ); } }
Source:
public void preparePaint(final Request request) { doTransform = true; if (doTransform && request instanceof ServletRequest) { HttpServletRequest httpServletRequest = ((ServletRequest) request).getBackingRequest(); String userAgentString = httpServletRequest.getHeader("User-Agent"); if (userAgentString != null && userAgentString.contains(NO_XSLT_FLAG)) { doTransform = false; } } super.preparePaint(request); }

Target:
public void preparePaint(final Request request) { if (doTransform && request instanceof ServletRequest) { HttpServletRequest httpServletRequest = ((ServletRequest) request).getBackingRequest(); String userAgentString = httpServletRequest.getHeader("User-Agent"); if (userAgentString != null && userAgentString.contains(NO_XSLT_FLAG)) { doTransform = false; } } super.preparePaint(request); }
Source:
private boolean isAcceptedConfigurationAdminEntry(ImportMigrationConfigurationAdminEntry entry) { if (ACCEPTED_ENTRY_PIDS.contains(entry.getPid())) { return true; } for (String entryFactoryPid : ACCEPTED_ENTRY_FACTORY_PIDS) { if (entryFactoryPid.equals(entry.getFactoryPid())) { return true; } } return false; }

Target:
private boolean isAcceptedConfigurationAdminEntry(ImportMigrationConfigurationAdminEntry entry) { if (ACCEPTED_ENTRY_PIDS.contains(entry.getPid())) { return true; } if (ACCEPTED_ENTRY_FACTORY_PIDS.contains(entry.getFactoryPid())) { return true; } return false; }
Source:
public synchronized TopLevelItem createProject( TopLevelItemDescriptor type, String name, boolean notify ) throws IOException { acl.checkPermission(Item.CREATE); acl.getACL().checkCreatePermission(parent, type); Jenkins.getInstance().getProjectNamingStrategy().checkName(name); if(parent.getItem(name)!=null) throw new IllegalArgumentException("Project of the name "+name+" already exists"); TopLevelItem item = type.newInstance(parent, name); try { callOnCreatedFromScratch(item); } catch (AbstractMethodError e) { } item.save(); add(item); Jenkins.getInstance().rebuildDependencyGraphAsync(); if (notify) ItemListener.fireOnCreated(item); return item; }

Target:
public synchronized TopLevelItem createProject( TopLevelItemDescriptor type, String name, boolean notify ) throws IOException { acl.checkPermission(Item.CREATE); type.checkApplicableIn(parent); acl.getACL().checkCreatePermission(parent, type); Jenkins.getInstance().getProjectNamingStrategy().checkName(name); if(parent.getItem(name)!=null) throw new IllegalArgumentException("Project of the name "+name+" already exists"); TopLevelItem item = type.newInstance(parent, name); try { callOnCreatedFromScratch(item); } catch (AbstractMethodError e) { } item.save(); add(item); Jenkins.getInstance().rebuildDependencyGraphAsync(); if (notify) ItemListener.fireOnCreated(item); return item; }
Source:
for (PropertyAccessorFactory factory : ServiceLoader.load(PropertyAccessorFactory.class)) { boolean nonCached = factory instanceof SimpleFeaturePropertyAccessorFactory || factory instanceof DirectPropertyAccessorFactory || factory instanceof NullPropertyAccessorFactory; if (!nonCached) cache.add(factory); }

Target:
for (PropertyAccessorFactory factory : ServiceLoader.load(PropertyAccessorFactory.class)) { boolean nonCached = factory instanceof SimpleFeaturePropertyAccessorFactory || factory instanceof DirectPropertyAccessorFactory || factory instanceof NullPropertyAccessorFactory; if (!nonCached) { cache.add(factory); } }
Source:
public static <TSource, TInner, TKey> Enumerable<TSource> semiJoin( final Enumerable<TSource> outer, final Enumerable<TInner> inner, final Function1<TSource, TKey> outerKeySelector, final Function1<TInner, TKey> innerKeySelector, final EqualityComparer<TKey> comparer) { return new AbstractEnumerable<TSource>() { private Enumerable<TKey> innerLookup = null; private Enumerable<TKey> getInnerLookup() { if (innerLookup == null) { innerLookup = comparer == null ? inner.select(innerKeySelector).distinct() : inner.select(innerKeySelector).distinct(comparer); } return innerLookup; } public Enumerator<TSource> enumerator() { return EnumerableDefaults.where(outer.enumerator(), v0 -> { final TKey key = outerKeySelector.apply(v0); return getInnerLookup().contains(key); }); } }; }

Target:
public static <TSource, TInner, TKey> Enumerable<TSource> semiJoin( final Enumerable<TSource> outer, final Enumerable<TInner> inner, final Function1<TSource, TKey> outerKeySelector, final Function1<TInner, TKey> innerKeySelector, final EqualityComparer<TKey> comparer) { return new AbstractEnumerable<TSource>() { public Enumerator<TSource> enumerator() { final Supplier<Enumerable<TKey>> innerLookup = Suppliers.memoize(() -> comparer == null ? inner.select(innerKeySelector).distinct() : inner.select(innerKeySelector).distinct(comparer)); return EnumerableDefaults.where(outer.enumerator(), v0 -> { final TKey key = outerKeySelector.apply(v0); return innerLookup.get().contains(key); }); } }; }
Source:
private void serveAssetFile(HttpServletRequest requestFromClient, HttpServletResponse responseToClient, String assetId) throws IOException { try (CloseableHttpResponse responseFromService = soaService.requestAsset(assetId, HttpMessageUtil.getRequestHeaders(requestFromClient, ASSET_REQUEST_HEADER_WHITELIST))) { if (responseFromService.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_MODIFIED) { responseToClient.setStatus(HttpStatus.SC_NOT_MODIFIED); } else { HttpMessageUtil.copyResponseWithHeaders(responseFromService, responseToClient, ASSET_RESPONSE_HEADER_FILTER); } } catch (EntityNotFoundException e) { throw new NotFoundException(e); } }

Target:
private void serveAssetFile(HttpServletRequest requestFromClient, HttpServletResponse responseToClient, String assetId) throws IOException { try (CloseableHttpResponse responseFromService = soaService.requestAsset(assetId, HttpMessageUtil.getRequestHeaders(requestFromClient, ASSET_REQUEST_HEADER_WHITELIST))) { forwardAssetResponse(responseFromService, responseToClient); } catch (EntityNotFoundException e) { throw new NotFoundException(e); } }
Source:
private void removeTagsFromChildrenCacheEntries(TagCacheEntry entry, CVSTag[] tags) { for (int i = 0; i < tags.length; i++) { removeTagFromChildrenCacheEntries(entry, tags[i]); } entry.getTags().removeAll(Arrays.asList(tags)); if (entry.getTags().size() == 0 && entry.children.size() == 0) { removeTagCacheEntry(entry); } }

Target:
private void removeTagsFromChildrenCacheEntries(TagCacheEntry entry, CVSTag[] tags) { for (int i = 0; i < tags.length; i++) { removeTagFromChildrenCacheEntries(entry, tags[i]); } entry.getTags().removeAll(Arrays.asList(tags)); if (entry.isEmpty()) { removeTagCacheEntry(entry); } }
Source:
private SortedMap getLabelsColumns(ChangeInfo[] loadedReviews) { LinkedHashMap<String, String> mapAcronym = new LinkedHashMap<String, String>(); if (loadedReviews != null && loadedReviews.length > 0) { for (ChangeInfo changeinfo : loadedReviews) { Iterator<Entry<String, LabelInfo>> iterLabels = changeinfo.getLabels().iterator(); while (iterLabels.hasNext()) { Entry<String, LabelInfo> entry = iterLabels.next(); String acr = getAcronymLabel(entry.getKey()); mapAcronym.put(entry.getKey(), acr); LabelInfo labelInfo = entry.getValue(); Iterator<Entry<String, String>> iterValues = labelInfo.getValues().iterator(); while (iterValues.hasNext()) { Entry<String, String> entryVal = iterValues.next(); } } } } SortedMap mapAcronymSorted = new TreeMap<String, String>(); mapAcronymSorted.putAll(mapAcronym); Iterator iterator = mapAcronymSorted.entrySet().iterator(); while (iterator.hasNext()) { Entry<String, String> map = (Entry<String, String>) iterator.next(); } return mapAcronymSorted; }

Target:
private SortedMap<String, String> getLabelsColumns(ChangeInfo[] loadedReviews) { if (loadedReviews == null || loadedReviews.length == 0) { return new TreeMap<>(); } SortedMap<String, String> mapAcronym = new TreeMap<String, String>(); for (ChangeInfo changeinfo : loadedReviews) { Collection<String> iterLabels = changeinfo.getLabels().keySet(); for (String label : iterLabels) { mapAcronym.put(label, getAcronymLabel(label)); } } return mapAcronym; }
Source:
protected boolean canDoAction() { if (getParameters().getVdsId() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_UPDATE_MOM_POLICY_UPDATE_NULL_HOST); } vds = getVdsDao().get(getParameters().getVdsId()); if (vds == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_UPDATE_MOM_POLICY_UPDATE_NULL_HOST); } if (vds.getStatus() != VDSStatus.Up) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_UPDATE_MOM_POLICY_UPDATE_HOST_DOWN); } return true; }

Target:
protected boolean canDoAction() { VdsValidator vdsValidator = new VdsValidator(getVds()); ValidationResult exists = vdsValidator.exists(); if (!exists.isValid()) { return failCanDoAction(exists.getMessage()); } ValidationResult up = vdsValidator.validateStatus(VDSStatus.Up); if (!up.isValid()) { return failCanDoAction(up.getMessage()); } return true; }
Source:
public boolean hasFiveHeroUnits() { return heroMosaic.findElements(By.cssSelector(".clickable-unit")).size() == 5; }

Target:
public boolean hasFiveHeroUnits() { return heroMosaic.findElements(By.cssSelector(".hero")).size() == 5; }
Source:
public void removeRMEventListener() throws RMException { UniqueID id = PAActiveObject.getContext().getCurrentRequest().getSourceBodyID(); String shortId = id.shortString(); if (removeRMEventListener(id)) { logger.debug("Removing the RM listner for " + shortId); } else { throw new RMException("Unknow listener found: " + shortId); } }

Target:
public void removeRMEventListener() throws RMException { UniqueID id = PAActiveObject.getContext().getCurrentRequest().getSourceBodyID(); String shortId = id.shortString(); if (removeRMEventListener(id)) { logger.debug("Removing the RM listener for " + shortId); } else { throw new RMException("Unknown listener found: " + shortId); } }
Source:
protected void executeQueryCommand() { Provider<?> provider = getProvider(); ProviderProxy proxy = ProviderProxyFactory.getInstance().create(provider); List<? extends Certificate> chain = proxy.getCertificateChain(); if (!chain.isEmpty()) { try { getQueryReturnValue().setReturnValue(Arrays.<CertificateInfo> asList(createCertificateInfo(chain.get(chain.size() - 1)))); } catch (CertificateEncodingException e) { getQueryReturnValue().setSucceeded(false); log.error("Error in encoding certificate. Error is " + e.getMessage()); if (log.isDebugEnabled()) { log.debug("", e); } } getQueryReturnValue().setSucceeded(true); } else { getQueryReturnValue().setSucceeded(false); } }

Target:
protected void executeQueryCommand() { Provider<?> provider = getProvider(); ProviderProxy proxy = ProviderProxyFactory.getInstance().create(provider); List<? extends Certificate> chain = proxy.getCertificateChain(); getQueryReturnValue().setSucceeded(false); try { if (!chain.isEmpty()) { List<CertificateInfo> results = new ArrayList<CertificateInfo>(); for (Certificate cert : chain) { results.add(createCertificateInfo(cert)); } getQueryReturnValue().setReturnValue(results); getQueryReturnValue().setSucceeded(true); } else { getQueryReturnValue().setSucceeded(false); } } catch (CertificateEncodingException e) { getQueryReturnValue().setSucceeded(false); log.error("Error in encoding certificate. Error is " + e.getMessage()); if (log.isDebugEnabled()) { log.debug("", e); } } }
Source:
public static synchronized @NonNull Map<String, File> listFiles() { IPath pathToFiles = XmlUtils.getXmlFilesPath(); File folder = pathToFiles.toFile(); Map<String, File> fileMap = new HashMap<>(); if ((folder.isDirectory() && folder.exists())) { File[] listOfFiles = getXmlFilesPath().toFile().listFiles(); for (File file : checkNotNull(listOfFiles)) { IPath path = new Path(file.getName()); if (path.getFileExtension().equals(XML_EXTENSION)) { fileMap.put(file.getName(), file); } } } return Collections.unmodifiableMap(fileMap); }

Target:
public static synchronized @NonNull Map<String, File> listFiles() { IPath pathToFiles = XmlUtils.getXmlFilesPath(); File folder = pathToFiles.toFile(); Map<String, File> fileMap = new HashMap<>(); if ((folder.isDirectory() && folder.exists())) { File[] listOfFiles = folder.listFiles(); if (listOfFiles != null) { for (File file : listOfFiles) { IPath path = new Path(file.getName()); if (path.getFileExtension().equals(XML_EXTENSION)) { fileMap.put(file.getName(), file); } } } else { Activator.logError("I/O error occured while accessing files in folder " + folder.getPath()); } } return Collections.unmodifiableMap(fileMap); }
Source:
public <X> X unwrap(Long value, Class<X> type, WrapperOptions options) { log.debug( " unwrap !" ); byte[] bytes = ByteBuffer.allocate( Long.SIZE ).putLong( value ).array(); return (X) new BsonBinary( bytes ); }

Target:
public <X> X unwrap(Long value, Class<X> type, WrapperOptions options) { byte[] bytes = ByteBuffer.allocate( Long.SIZE ).putLong( value ).array(); return (X) new BsonBinary( bytes ); }
Source:
private String getAuthorizationCode() { try { AuthenticationRequestBuilder builder = OAuthClientRequest.authorizationLocation(authorizationLocation.toString()) .setClientId(clientID).setRedirectURI(callbackURL.toString()); if (responseType != null) { builder.setResponseType(responseType); } OAuthClientRequest request = builder.buildQueryMessage(); System.out.println("Paste this URL into a web browser to authorize access:"); System.out.println(request.getLocationUri()); SimpleTalendHttpServer service = new SimpleTalendHttpServer(callbackURL.getHost(), callbackURL.getPort(), 10 * 60 * 1000); service.run(); String code = service.getAuthorizationCode(); service.stop(); return code; } catch (Exception e) { throw new RuntimeException(e); } }

Target:
private String getAuthorizationCode() { try { AuthenticationRequestBuilder builder = OAuthClientRequest.authorizationLocation(authorizationLocation.toString()) .setClientId(clientID).setRedirectURI(callbackURL.toString()); if (responseType != null) { builder.setResponseType(responseType); } OAuthClientRequest request = builder.buildQueryMessage(); logger.info("Paste this URL into a web browser to authorize access:"); logger.info(request.getLocationUri()); OAuth2ImplicitGrantServer service = new OAuth2ImplicitGrantServer(callbackURL.getHost(), callbackURL.getPort(), 10 * 60 * 1000); service.run(); String code = service.getAuthorizationCode(); service.stop(); return code; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public VeluxProductReference(VeluxProductName name, int type) { this.name = name; this.typeId = VeluxProductType.get(type); if (this.typeId == null) { logger.warn( "Please report this to maintainer of the bindung: VeluxProductReference({}) has found an unregistered ProductTypeId.", VeluxBindingConstants.BINDING_ID, type); } }

Target:
public VeluxProductReference(VeluxProductName name, int type) { this.name = name; this.typeId = VeluxProductType.get(type); if (this.typeId == null) { logger.warn( "Please report this to maintainer of the binding: VeluxProductReference({}) has found an unregistered ProductTypeId.", VeluxBindingConstants.BINDING_ID, type); } }
Source:
private ImmutableArray<Entity> registerFamily(Family family) { ImmutableArray<Entity> immutableEntities = immutableFamilies.get(family); if (immutableEntities == null) { Array<Entity> entities = new Array<Entity>(false, 16, Entity.class); immutableEntities = new ImmutableArray<Entity>(entities); families.put(family, entities); immutableFamilies.put(family, immutableEntities); for(Entity e : this.entities){ if(family.matches(e)) { entities.add(e); e.getFamilyBits().set(family.getIndex()); } } } return immutableEntities; }

Target:
private ImmutableArray<Entity> registerFamily(Family family) { ImmutableArray<Entity> immutableEntities = immutableFamilies.get(family); if (immutableEntities == null) { Array<Entity> entities = new Array<Entity>(false, 16); immutableEntities = new ImmutableArray<Entity>(entities); families.put(family, entities); immutableFamilies.put(family, immutableEntities); for(Entity e : this.entities){ if(family.matches(e)) { entities.add(e); e.getFamilyBits().set(family.getIndex()); } } } return immutableEntities; }
Source:
public Object getAnyAttribute(final String key) { if (key.equals(VCFConstants.GENOTYPE_KEY)) { return getAlleles(); } else if (key.equals(VCFConstants.GENOTYPE_QUALITY_KEY)) { return getGQ(); } else if (key.equals(VCFConstants.GENOTYPE_ALLELE_DEPTHS)) { List<Integer> intList = new ArrayList<Integer>(); for(int i : getAD()) intList.add(i); return intList; } else if (key.equals(VCFConstants.GENOTYPE_PL_KEY)) { List<Integer> intList = new ArrayList<Integer>(); for(int i : getPL()) intList.add(i); return intList; } else if (key.equals(VCFConstants.DEPTH_KEY)) { return getDP(); } else { return getExtendedAttribute(key); } }

Target:
public Object getAnyAttribute(final String key) { if (key.equals(VCFConstants.GENOTYPE_KEY)) { return getAlleles(); } else if (key.equals(VCFConstants.GENOTYPE_QUALITY_KEY)) { return getGQ(); } else if (key.equals(VCFConstants.GENOTYPE_ALLELE_DEPTHS)) { if(hasAD()) { List<Integer> intList = new ArrayList<Integer>(getAD().length); for(int i : getAD()) intList.add(i); return intList; } return Collections.EMPTY_LIST; } else if (key.equals(VCFConstants.GENOTYPE_PL_KEY)) { if(hasPL()) { List<Integer> intList = new ArrayList<Integer>(getPL().length); for(int i : getPL()) intList.add(i); return intList; } return Collections.EMPTY_LIST; } else if (key.equals(VCFConstants.DEPTH_KEY)) { return getDP(); } else { return getExtendedAttribute(key); } }
Source:
public boolean discoverPatient(final PatientSearchBean patientQuerySearch) { final gov.hhs.fha.nhinc.patientdiscovery.model.Patient patientBean = new gov.hhs.fha.nhinc.patientdiscovery.model.Patient(); patientBean.setOrganization(patientQuerySearch.getOrganization()); final DateFormat df = new SimpleDateFormat(UTCDateUtil.DATE_ONLY_FORMAT); patientBean.setBirthDate(df.format(patientQuerySearch.getDateOfBirth())); patientBean.setFirstName(patientQuerySearch.getFirstName()); patientBean.setLastName(patientQuerySearch.getLastName()); patientBean.setGender(patientQuerySearch.getGender()); try { final PatientSearchResults patientDiscoveryResults = patientService.queryPatient(patientBean); LOG.debug("Patient Discovery call successful. Total number of patients found:" + patientDiscoveryResults.getPatientList().size()); if (patientDiscoveryResults.getPatientList().isEmpty()) { return false; } populatePatientBean(patientDiscoveryResults, patientQuerySearch); return true; } catch (final Exception ex) { LOG.error("Failed to Retrieve Patient Data: {}", ex.getLocalizedMessage(), ex); return false; } }

Target:
public boolean discoverPatient(final PatientSearchBean patientQuerySearch) { final gov.hhs.fha.nhinc.patientdiscovery.model.Patient patientBean = new gov.hhs.fha.nhinc.patientdiscovery.model.Patient(); patientBean.setOrganization(patientQuerySearch.getOrganization()); final DateFormat df = new SimpleDateFormat(UTCDateUtil.DATE_ONLY_FORMAT); patientBean.setBirthDate(df.format(patientQuerySearch.getDateOfBirth())); patientBean.setFirstName(patientQuerySearch.getFirstName()); patientBean.setLastName(patientQuerySearch.getLastName()); patientBean.setGender(patientQuerySearch.getGender()); try { final PatientSearchResults patientDiscoveryResults = patientService.queryPatient(patientBean); LOG.debug("Patient Discovery call successful. Total number of patients found: {}", patientDiscoveryResults.getPatientList().size()); if (patientDiscoveryResults.getPatientList().isEmpty()) { return false; } populatePatientBean(patientDiscoveryResults, patientQuerySearch); return true; } catch (final Exception ex) { LOG.error("Failed to Retrieve Patient Data: {}", ex.getLocalizedMessage(), ex); return false; } }
Source:
private void validate() { if(strategy != null && !StringUtils.isEmpty(strategy) && !VALID_STRATEGIES.contains(strategy)) { logger.warn("Not valid strategy (valid values are \"ledger-only\", \"future-behaviour\" or empty); using the default strategy"); strategy = null; } }

Target:
private void validate() { if(!StringUtils.isBlank(strategy) && !VALID_STRATEGIES.contains(strategy)) { logger.warn("Not valid strategy (valid values are \"ledger-only\", \"future-behaviour\" or empty); using the default strategy"); strategy = null; } }
Source:
private Position decodeLbsWifi(Channel channel, SocketAddress remoteAddress, String sentence) { Parser parser = new Parser(PATTERN_LBSWIFI, sentence); if (!parser.matches()) { return null; } DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); decodeType(position, parser.next(), "0"); getLastLocation(position, null); getLastBatteryPower(position); Network network = new Network(); network.addCellTower(CellTower.from( parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt())); int wifiCount = parser.nextInt(); if (parser.hasNext()) { String[] wifimacs = parser.next().split(","); if (wifimacs.length == wifiCount) { for (int i = 0; i < wifiCount; i++) { String[] wifiinfo = wifimacs[i].split("\\*"); network.addWifiAccessPoint(WifiAccessPoint.from( wifiinfo[0], Integer.parseInt(wifiinfo[1]), Integer.parseInt(wifiinfo[2]))); } } } if (network.getCellTowers() != null || network.getWifiAccessPoints() != null) { position.setNetwork(network); } DateBuilder dateBuilder = new DateBuilder() .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()) .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); return position; }

Target:
private Position decodeLbsWifi(Channel channel, SocketAddress remoteAddress, String sentence) { Parser parser = new Parser(PATTERN_LBSWIFI, sentence); if (!parser.matches()) { return null; } DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); decodeType(position, parser.next(), "0"); getLastLocation(position, null); Network network = new Network(); network.addCellTower(CellTower.from( parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt())); int wifiCount = parser.nextInt(); if (parser.hasNext()) { String[] wifimacs = parser.next().split(","); if (wifimacs.length == wifiCount) { for (int i = 0; i < wifiCount; i++) { String[] wifiinfo = wifimacs[i].split("\\*"); network.addWifiAccessPoint(WifiAccessPoint.from( wifiinfo[0], Integer.parseInt(wifiinfo[1]), Integer.parseInt(wifiinfo[2]))); } } } if (network.getCellTowers() != null || network.getWifiAccessPoints() != null) { position.setNetwork(network); } position.setTime(parser.nextDateTime(Parser.DateTimeFormat.DMY_HMS)); return position; }
Source:
public void registerDataSetContent(DataSetContent content) { try { DataSetContentType contentType = content.getContentType(); switch (contentType) { case CSV: storage.storeCSV(content.getId(), content.getContent()); break; case DEFINITION: registerDataSetDefinition(content); break; default: logger.error("Unknow DataSet Content Type: {}", contentType.name(), null); break; } } catch (Exception e) { logger.error("Error registering dataset", e); } }

Target:
public void registerDataSetContent(DataSetContent content) { try { DataSetContentType contentType = content.getContentType(); switch (contentType) { case CSV: storage.storeCSV(content.getId(), content.getContent()); break; case DEFINITION: registerDataSetDefinition(content); break; default: logger.error("Unknown DataSet Content Type: {}", contentType.name(), null); break; } } catch (Exception e) { logger.error("Error registering dataset", e); } }
Source:
public static List<FileStatus> filterInvalid(FileStatus[] files) { ArrayList<FileStatus> fileList = new ArrayList<>(files.length); for (FileStatus fileStatus : files) { String fname = fileStatus.getPath().getName(); if (fileStatus.isDirectory()) { log.debug("{} is a directory, ignoring.", fileStatus.getPath()); continue; } if (fname.equals("_SUCCESS") || fname.equals("_logs")) { log.debug("Ignoring file likely created by map reduce : {}", fileStatus.getPath()); continue; } if (FileOperations.getWorkingFiles().contains(fname)) { log.debug("{} is an internal working file, ignoring.", fileStatus.getPath()); continue; } if (!FileOperations.getValidExtensions().contains(FilenameUtils.getExtension(fname))) { log.warn("{} does not have a valid extension, ignoring", fileStatus.getPath()); continue; } fileList.add(fileStatus); } return fileList; }

Target:
public static List<FileStatus> filterInvalid(FileStatus[] files) { ArrayList<FileStatus> fileList = new ArrayList<>(files.length); for (FileStatus fileStatus : files) { String fname = fileStatus.getPath().getName(); if (fileStatus.isDirectory()) { log.debug("{} is a directory, ignoring.", fileStatus.getPath()); continue; } if (FileOperations.getBulkWorkingFiles().contains(fname)) { log.debug("{} is an internal working file, ignoring.", fileStatus.getPath()); continue; } if (!FileOperations.getValidExtensions().contains(FilenameUtils.getExtension(fname))) { log.warn("{} does not have a valid extension, ignoring", fileStatus.getPath()); continue; } fileList.add(fileStatus); } return fileList; }
Source:
public void onServingModeChanged(final boolean enabled, Location currentLocation) { serviceHelper.changeServingState(this, selectedTruck.id, enabled, currentLocation); final VendorMapFragment fragment = (VendorMapFragment) getSupportFragmentManager().findFragmentById(R.id.vendor_map_fragment); runOnUiThread(new Runnable() { @Override public void run() { fragment.setMapControlsEnabled(!enabled); } }); if (enabled && sharedPreferences.getBoolean(getString(R.string.setting_item_unavailable_warning), true)) { WhereClause whereClause = new WhereClause.Builder() .where(PublicContract.Menu.TRUCK_ID, EQUALS, selectedTruck.id) .and() .where(PublicContract.Menu.IS_AVAILABLE, EQUALS, 0) .build(); String[] projection = ItemsOutOfStockQuery.PROJECTION; Uri uri = PublicContract.MENU_URI; Cursor cursor = getContentResolver().query(uri, projection, whereClause.selection, whereClause.selectionArgs, null); if (cursor.getCount() > 0 ) { showWarning(cursor.getCount()); } } }

Target:
public void onServingModeChanged(final boolean enabled, Location currentLocation) { serviceHelper.changeServingState(this, selectedTruck.id, enabled, currentLocation); final VendorMapFragment fragment = (VendorMapFragment) getSupportFragmentManager().findFragmentById(R.id.vendor_map_fragment); runOnUiThread(new Runnable() { @Override public void run() { fragment.setMapControlsEnabled(!enabled); } }); if (enabled && sharedPreferences.getBoolean(getString(R.string.setting_item_unavailable_warning), true)) { WhereClause whereClause = new WhereClause.Builder() .where(PublicContract.Menu.TRUCK_ID, EQUALS, selectedTruck.id) .and() .where(PublicContract.Menu.IS_AVAILABLE, EQUALS, 0) .build(); String[] projection = ItemsOutOfStockQuery.PROJECTION; Uri uri = PublicContract.MENU_URI; Cursor cursor = getContentResolver().query(uri, projection, whereClause.selection, whereClause.selectionArgs, null); if (cursor.getCount() > 0 ) { showWarning(cursor.getCount()); } cursor.close(); } }
Source:
public SubscriptionInfo createSubscription(SubscriptionInfo sinfo) { if (sinfo == null) { throw new IllegalArgumentException("sinfo is null"); } if (StringUtils.isBlank(sinfo.getId())) { throw new IllegalArgumentException("subscription is lacking an identifier: " + sinfo); } if (this.subscriptionMap.containsKey(sinfo.getId())) { throw new IllegalStateException("subscription already exists: " + sinfo.getId()); } Subscription sdata = new Subscription(); sdata.setId(sinfo.getId()); sdata.setOwner(this.resolveOwner(sinfo.getOwner())); sdata.setProduct(this.resolveProduct(sinfo.getProduct())); if (sdata.getProduct() != null) { sdata.setProvidedProducts(sdata.getProduct().getProvidedProducts()); } sdata.setDerivedProduct(this.resolveProduct(sinfo.getDerivedProduct())); if (sdata.getDerivedProduct() != null) { sdata.setDerivedProvidedProducts( sdata.getDerivedProduct().getProvidedProducts()); } sdata.setQuantity(sinfo.getQuantity()); sdata.setStartDate(sinfo.getStartDate()); sdata.setEndDate(sinfo.getEndDate()); sdata.setModified(sinfo.getLastModified()); sdata.setContractNumber(sinfo.getContractNumber()); sdata.setAccountNumber(sinfo.getAccountNumber()); sdata.setOrderNumber(sinfo.getOrderNumber()); sdata.setUpstreamPoolId(sinfo.getUpstreamPoolId()); sdata.setUpstreamEntitlementId(sinfo.getUpstreamEntitlementId()); sdata.setUpstreamConsumerId(sinfo.getUpstreamConsumerId()); sdata.setCertificate(this.convertSubscriptionCertificate(sinfo.getCertificate())); sdata.setCdn(this.convertCdn(sinfo.getCdn())); this.subscriptionMap.put(sdata.getId(), sdata); this.updateSubscriptionProductMappings(sdata); return sdata; }

Target:
public SubscriptionInfo createSubscription(SubscriptionInfo sinfo) { if (sinfo == null) { throw new IllegalArgumentException("sinfo is null"); } if (StringUtils.isBlank(sinfo.getId())) { throw new IllegalArgumentException("subscription is lacking an identifier: " + sinfo); } if (this.subscriptionMap.containsKey(sinfo.getId())) { throw new IllegalStateException("subscription already exists: " + sinfo.getId()); } Subscription sdata = new Subscription(); sdata.setId(sinfo.getId()); sdata.setOwner(this.resolveOwner(sinfo.getOwner())); sdata.setProduct(this.resolveProduct(sinfo.getProduct())); sdata.setDerivedProduct(this.resolveProduct(sinfo.getDerivedProduct())); sdata.setQuantity(sinfo.getQuantity()); sdata.setStartDate(sinfo.getStartDate()); sdata.setEndDate(sinfo.getEndDate()); sdata.setModified(sinfo.getLastModified()); sdata.setContractNumber(sinfo.getContractNumber()); sdata.setAccountNumber(sinfo.getAccountNumber()); sdata.setOrderNumber(sinfo.getOrderNumber()); sdata.setUpstreamPoolId(sinfo.getUpstreamPoolId()); sdata.setUpstreamEntitlementId(sinfo.getUpstreamEntitlementId()); sdata.setUpstreamConsumerId(sinfo.getUpstreamConsumerId()); sdata.setCertificate(this.convertSubscriptionCertificate(sinfo.getCertificate())); sdata.setCdn(this.convertCdn(sinfo.getCdn())); this.subscriptionMap.put(sdata.getId(), sdata); this.updateSubscriptionProductMappings(sdata); return sdata; }
Source:
public ParametersDefinitionProperty(@Nonnull List<ParameterDefinition> parameterDefinitions) { if (parameterDefinitions != null) { this.parameterDefinitions = parameterDefinitions; } else { this.parameterDefinitions = Collections.emptyList(); } }

Target:
public ParametersDefinitionProperty(@Nonnull List<ParameterDefinition> parameterDefinitions) { if (parameterDefinitions == null) { throw new NullPointerException("ParameterDefinitions is null when this is a not valid value"); } this.parameterDefinitions = parameterDefinitions; }
Source:
public ImsSmsDispatcher(Phone phone, SmsDispatchersController smsDispatchersController) { super(phone, smsDispatchersController); mImsManagerConnector = new ImsManager.Connector(mContext, mPhone.getPhoneId(), new ImsManager.Connector.Listener() { @Override public void connectionReady(ImsManager manager) throws ImsException { Rlog.d(TAG, "ImsManager: connection ready."); setListeners(); mIsImsServiceUp = true; } @Override public void connectionUnavailable() { Rlog.d(TAG, "ImsManager: connection unavailable."); mIsImsServiceUp = false; } }); mImsManagerConnector.connect(); }

Target:
public ImsSmsDispatcher(Phone phone, SmsDispatchersController smsDispatchersController) { super(phone, smsDispatchersController); mImsManagerConnector = new ImsManager.Connector(mContext, mPhone.getPhoneId(), new ImsManager.Connector.Listener() { @Override public void connectionReady(ImsManager manager) throws ImsException { Rlog.d(TAG, "ImsManager: connection ready."); synchronized (mLock) { setListeners(); mIsImsServiceUp = true; } } @Override public void connectionUnavailable() { Rlog.d(TAG, "ImsManager: connection unavailable."); synchronized (mLock) { mIsImsServiceUp = false; } } }); mImsManagerConnector.connect(); }
Source:
public String getColumnText(@Nullable Object element, int columnIndex) { String value = ""; if (element instanceof HiddenTreeViewerEntry) { if (columnIndex == 0) { value = ((HiddenTreeViewerEntry) element).getName(); } } else { SegmentStoreStatisticsEntry obj = (SegmentStoreStatisticsEntry) element; if (obj != null) { if (columnIndex == 0) { return checkNotNull(String.valueOf(obj.getName())); } if (obj.getEntry().getNbSegments() > 0) { if (columnIndex == 1) { value = toFormattedString(obj.getEntry().getMin()); } else if (columnIndex == 2) { value = String.valueOf(toFormattedString(obj.getEntry().getMax())); } else if (columnIndex == 3) { value = String.valueOf(toFormattedString(obj.getEntry().getAverage())); } } } } return checkNotNull(value); }

Target:
public String getColumnText(@Nullable Object element, int columnIndex) { String value = ""; if (element instanceof HiddenTreeViewerEntry) { if (columnIndex == 0) { value = ((HiddenTreeViewerEntry) element).getName(); } } else if (element instanceof SegmentStoreStatisticsEntry) { SegmentStoreStatisticsEntry entry = (SegmentStoreStatisticsEntry) element; if (columnIndex == 0) { return checkNotNull(String.valueOf(entry.getName())); } if (entry.getEntry().getNbSegments() > 0) { if (columnIndex == 1) { value = toFormattedString(entry.getEntry().getMin()); } else if (columnIndex == 2) { value = String.valueOf(toFormattedString(entry.getEntry().getMax())); } else if (columnIndex == 3) { value = String.valueOf(toFormattedString(entry.getEntry().getAverage())); } } } return checkNotNull(value); }