auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ResponsePayload uninstallApplication(ApplicationWrapper applicationWrapper, @PathParam("tenantDomain") String tenantDomain) throws MDMAPIException { ResponsePayload responseMsg = new ResponsePayload(); ApplicationManager appManagerConnector; org.wso2.carbon.device.mgt.common.operation.mgt.Operation operation = null; ArrayList<DeviceIdentifier> deviceIdentifiers; try { appManagerConnector = MDMAPIUtils.getAppManagementService(); MobileApp mobileApp = applicationWrapper.getApplication(); if (applicationWrapper.getDeviceIdentifiers() != null) { for (DeviceIdentifier deviceIdentifier : applicationWrapper.getDeviceIdentifiers()) { deviceIdentifiers = new ArrayList<DeviceIdentifier>(); if (deviceIdentifier.getType().equals(Platform.android.toString())) { operation = MDMAndroidOperationUtil.createAppUninstallOperation(mobileApp); } else if (deviceIdentifier.getType().equals(Platform.ios.toString())) { operation = MDMIOSOperationUtil.createAppUninstallOperation(mobileApp); } deviceIdentifiers.add(deviceIdentifier); } appManagerConnector.installApplicationForDevices(operation, applicationWrapper.getDeviceIdentifiers()); } Response.status(HttpStatus.SC_CREATED); responseMsg.setMessageFromServer("Application has uninstalled successfully."); return responseMsg; } catch (ApplicationManagementException e) { String msg = "Error occurred while saving the operation"; log.error(msg, e); throw new MDMAPIException(msg, e); } }

Target:
public ResponsePayload uninstallApplication(ApplicationWrapper applicationWrapper, @PathParam("tenantDomain") String tenantDomain) throws MDMAPIException { ResponsePayload responseMsg = new ResponsePayload(); ApplicationManager appManagerConnector; org.wso2.carbon.device.mgt.common.operation.mgt.Operation operation = null; ArrayList<DeviceIdentifier> deviceIdentifiers; try { appManagerConnector = MDMAPIUtils.getAppManagementService(); MobileApp mobileApp = applicationWrapper.getApplication(); if (applicationWrapper.getDeviceIdentifiers() != null) { for (DeviceIdentifier deviceIdentifier : applicationWrapper.getDeviceIdentifiers()) { deviceIdentifiers = new ArrayList<DeviceIdentifier>(); if (deviceIdentifier.getType().equals(Platform.android.toString())) { operation = MDMAndroidOperationUtil.createAppUninstallOperation(mobileApp); } else if (deviceIdentifier.getType().equals(Platform.ios.toString())) { operation = MDMIOSOperationUtil.createAppUninstallOperation(mobileApp); } deviceIdentifiers.add(deviceIdentifier); } appManagerConnector.installApplicationForDevices(operation, applicationWrapper.getDeviceIdentifiers()); } Response.status(HttpStatus.SC_CREATED); responseMsg.setMessageFromServer("Application removal request has been sent to the device."); return responseMsg; } catch (ApplicationManagementException e) { String msg = "Error occurred while saving the operation"; log.error(msg, e); throw new MDMAPIException(msg, e); } }
Source:
Table<K, V, M> getTable(String namespace, String tableName) { String fullyQualifiedTableName = getFullyQualifiedTableName(namespace, tableName); if (!tableMap.containsKey(fullyQualifiedTableName)) { UUID tableStreamId = CorfuRuntime.getStreamID(fullyQualifiedTableName); long tableStreamTail = runtime.getSequencerView().query(tableStreamId); if (tableStreamTail != Address.NON_EXIST) { throw new IllegalArgumentException("Insufficient parameters to re-open existing table " + tableName + " in namespace " + namespace); } else { throw new NoSuchElementException( String.format("No such table found: namespace: %s, tableName: %s", namespace, tableName)); } } return (Table<K, V, M>) tableMap.get(fullyQualifiedTableName); }

Target:
Table<K, V, M> getTable(String namespace, String tableName) { String fullyQualifiedTableName = getFullyQualifiedTableName(namespace, tableName); if (!tableMap.containsKey(fullyQualifiedTableName)) { if (registryTable.containsKey( TableName.newBuilder() .setNamespace(namespace) .setTableName(tableName) .build()) ) { throw new IllegalArgumentException("Please provide Key, Value & Metadata schemas to re-open" + " this existing table " + tableName + " in namespace " + namespace); } else { throw new NoSuchElementException( String.format("No such table found: namespace: %s, tableName: %s", namespace, tableName)); } } return (Table<K, V, M>) tableMap.get(fullyQualifiedTableName); }
Source:
protected void onPostExecuteInternal(final Boolean result) { if (activity != null) { final Context nonNullActivity = activity; if (result) { ActivityMixin.showToast(activity, uploadFailed == 0 ? nonNullActivity.getString(R.string.export_modifiedcoords_success) : nonNullActivity.getString(R.string.export_modifiedcoords_result, uploadFailed, uploadOk)); } else { ActivityMixin.showToast(activity, nonNullActivity.getString(R.string.export_modifiedcoords_error)); } Log.e("upload finished: ok=" + uploadOk + " / failed=" + uploadFailed + " / total=" + uploadProgress); } }

Target:
protected void onPostExecuteInternal(final Boolean result) { if (activity != null) { final Context nonNullActivity = activity; if (result) { ActivityMixin.showToast(activity, uploadFailed == 0 ? nonNullActivity.getString(R.string.export_modifiedcoords_success) : nonNullActivity.getString(R.string.export_modifiedcoords_result, uploadFailed, uploadOk)); } else { ActivityMixin.showToast(activity, nonNullActivity.getString(R.string.export_modifiedcoords_error)); } Log.d("upload finished: ok=" + uploadOk + " / failed=" + uploadFailed + " / total=" + uploadProgress); } }
Source:
public Folder createFolders(String path, Host host, User user, boolean respectFrontEndPermissions) throws DotHibernateException, DotSecurityException, DotDataException { StringTokenizer st = new StringTokenizer(path, ROOT_PATH); StringBuffer sb = new StringBuffer(ROOT_PATH); Folder parent = null; while (st.hasMoreTokens()) { String name = st.nextToken(); sb.append(name + ROOT_PATH); Folder f = findFolderByPath(sb.toString(), host, user, respectFrontEndPermissions); if (f == null || !InodeUtils.isSet(f.getInode())) { f= new Folder(); f.setName(name); f.setTitle(name); f.setShowOnMenu(false); f.setSortOrder(0); f.setFilesMasks(""); f.setHostId(host.getIdentifier()); f.setDefaultFileType(CacheLocator.getContentTypeCache().getStructureByVelocityVarName(APILocator.getFileAssetAPI().DEFAULT_FILE_ASSET_STRUCTURE_VELOCITY_VAR_NAME).getInode()); Identifier newIdentifier = new Identifier(); if(!UtilMethods.isSet(parent)){ newIdentifier = APILocator.getIdentifierAPI().createNew(f, host); }else{ newIdentifier = APILocator.getIdentifierAPI().createNew(f, parent); } f.setIdentifier(newIdentifier.getId()); save(f, user, respectFrontEndPermissions); } parent = f; } return parent; }

Target:
public Folder createFolders(String path, Host host, User user, boolean respectFrontEndPermissions) throws DotHibernateException, DotSecurityException, DotDataException { StringTokenizer st = new StringTokenizer(path, ROOT_PATH); StringBuffer sb = new StringBuffer(ROOT_PATH); Folder parent = null; while (st.hasMoreTokens()) { String name = st.nextToken(); sb.append(name + ROOT_PATH); Folder folder = findFolderByPath(sb.toString(), host, user, respectFrontEndPermissions); if (folder == null || !InodeUtils.isSet(folder.getInode())) { folder = new Folder(); folder.setName(name); folder.setTitle(name); folder.setShowOnMenu(false); folder.setSortOrder(0); folder.setFilesMasks(""); folder.setHostId(host.getIdentifier()); folder.setDefaultFileType(CacheLocator.getContentTypeCache().getStructureByVelocityVarName(APILocator.getFileAssetAPI().DEFAULT_FILE_ASSET_STRUCTURE_VELOCITY_VAR_NAME).getInode()); Identifier newIdentifier = new Identifier(); if(!UtilMethods.isSet(parent)){ newIdentifier = APILocator.getIdentifierAPI().createNew(folder, host); }else{ newIdentifier = APILocator.getIdentifierAPI().createNew(folder, parent); } folder.setIdentifier(newIdentifier.getId()); save(folder, user, respectFrontEndPermissions); } parent = folder; } return parent; }
Source:
public boolean isPage200(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.NOTFOUND_404) || isCustomPage(msg, CustomPage.Type.ERROR_500)) { return false; } return isCustomPage(msg, CustomPage.Type.OK_200) ? true : msg.getResponseHeader().getStatusCode() == HttpStatusCode.OK; }

Target:
public boolean isPage200(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.NOTFOUND_404) || isCustomPage(msg, CustomPage.Type.ERROR_500)) { return false; } if (isCustomPage(msg, CustomPage.Type.OK_200)) { return true; } return msg.getResponseHeader().getStatusCode() == HttpStatusCode.OK; }
Source:
public MergeCommand include(String name, AnyObjectId commit) { checkCallable(); this.commits.put(name, commit); return this; }

Target:
public MergeCommand include(String name, AnyObjectId commit) { return include(new ObjectIdRef.Unpeeled(Storage.LOOSE, name, commit.copy())); }
Source:
private void registerHandlers() { for (MessageHandlerMetrics source : handlers) { MessageHandlerMetrics monitor = enhanceHandlerMonitor(source); String name = monitor.getManagedName(); this.allHandlersByName.put(name, monitor); if (!PatternMatchUtils.simpleMatch(this.componentNamePatterns, name)) { continue; } if (!handlersByName.containsKey(name)) { String beanKey = getHandlerBeanKey(monitor); if (name != null) { handlersByName.put(name, monitor); } Boolean enabled = enabled(this.enabledCountsPatterns, name); if (enabled != null) { monitor.enableCounts(enabled); } enabled = enabled(this.enabledStatsPatterns, name); if (enabled != null) { monitor.enableStats(enabled); } registerBeanNameOrInstance(monitor, beanKey); } } }

Target:
private void registerHandlers() { for (MessageHandlerMetrics handler : handlers) { MessageHandlerMetrics monitor = enhanceHandlerMonitor(handler); String name = monitor.getManagedName(); this.allHandlersByName.put(name, monitor); if (!matches(this.componentNamePatterns, name)) { continue; } if (!handlersByName.containsKey(name)) { String beanKey = getHandlerBeanKey(monitor); if (name != null) { handlersByName.put(name, monitor); } Boolean enabled = smartMatch(this.enabledCountsPatterns, name); if (enabled != null) { monitor.enableCounts(enabled); } enabled = smartMatch(this.enabledStatsPatterns, name); if (enabled != null) { monitor.enableStats(enabled); } registerBeanNameOrInstance(monitor, beanKey); } } }
Source:
private ITimeGraphState createTimeGraphState(ITmfStateInterval interval, ITmfStateSystem ss) throws StateSystemDisposedException { long startTime = interval.getStartTime(); long endTime = interval.getEndTime(); long duration = endTime - startTime + 1; Object statusObj = interval.getValue(); Type type = fEntryModelTypes.get(interval.getAttribute()); if (statusObj instanceof Integer) { int status = (int) statusObj; if (type == Type.CPU) { if (status == StateValues.CPU_STATUS_RUN_USERMODE || status == StateValues.CPU_STATUS_RUN_SYSCALL) { return fTimeEventNames.getUnchecked(interval); } } else if (type == Type.CURRENT_THREAD) { Object processName = null; if (fExecNamesCache.containsEntry(status, interval)) { processName = fExecNamesCache.get(status).first().getValue(); } else { int quark = ss.optQuarkAbsolute(Attributes.THREADS, Integer.toString(status), Attributes.EXEC_NAME); if (quark != ITmfStateSystem.INVALID_ATTRIBUTE) { ITmfStateInterval namedInterval = ss.querySingleState(endTime, quark); fExecNamesCache.put(status, namedInterval); processName = namedInterval.getValue(); } } if (processName instanceof String) { return new TimeGraphState(startTime, duration, status, (String) processName + '/' + status); } } return new TimeGraphState(startTime, duration, status); } return new TimeGraphState(startTime, duration, Integer.MIN_VALUE); }

Target:
private ITimeGraphState createTimeGraphState(ITmfStateInterval interval, ITmfStateSystem ss) throws StateSystemDisposedException { long startTime = interval.getStartTime(); long endTime = interval.getEndTime(); long duration = endTime - startTime + 1; Object statusObj = interval.getValue(); Type type = fEntryModelTypes.get(interval.getAttribute()); if (statusObj instanceof Integer) { int status = (int) statusObj; if (type == Type.CPU) { if (status == StateValues.CPU_STATUS_RUN_USERMODE || status == StateValues.CPU_STATUS_RUN_SYSCALL) { return fTimeEventNames.getUnchecked(interval); } } else if (type == Type.CURRENT_THREAD) { Object processName = null; if (fExecNamesCache.containsEntry(status, interval)) { processName = fExecNamesCache.get(status).first().getValue(); } else { int quark = ss.optQuarkAbsolute(Attributes.THREADS, Integer.toString(status), Attributes.EXEC_NAME); if (quark != ITmfStateSystem.INVALID_ATTRIBUTE) { ITmfStateInterval namedInterval = ss.querySingleState(endTime, quark); fExecNamesCache.put(status, namedInterval); processName = namedInterval.getValue(); } } if (processName instanceof String) { return new TimeGraphState(startTime, duration, status, (String) processName); } } return new TimeGraphState(startTime, duration, status); } return new TimeGraphState(startTime, duration, Integer.MIN_VALUE); }
Source:
protected void revertTask() { getEnclosingCommand().getParameters().getDiskImage().setImageStatus(ImageStatus.ILLEGAL); ImagesHandler.updateImageStatus( getEnclosingCommand().getParameters().getDestinationImageId(), ImageStatus.ILLEGAL); }

Target:
protected void revertTask() { }
Source:
public JobManagerRunner createJobManagerRunner( JobGraph jobGraph, Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, JobManagerSharedServices jobManagerSharedServices, JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory, FatalErrorHandler fatalErrorHandler) throws Exception { assertEquals(expectedJobId, jobGraph.getJobID()); createdJobManagerRunnerLatch.countDown(); JobManagerRunner jobManagerRunner = DefaultJobManagerRunnerFactory.INSTANCE.createJobManagerRunner( jobGraph, configuration, rpcService, highAvailabilityServices, heartbeatServices, jobManagerSharedServices, jobManagerJobMetricGroupFactory, fatalErrorHandler); return jobManagerRunner; }

Target:
public JobManagerRunner createJobManagerRunner( JobGraph jobGraph, Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, JobManagerSharedServices jobManagerSharedServices, JobManagerJobMetricGroupFactory jobManagerJobMetricGroupFactory, FatalErrorHandler fatalErrorHandler) throws Exception { assertEquals(expectedJobId, jobGraph.getJobID()); createdJobManagerRunnerLatch.countDown(); return DefaultJobManagerRunnerFactory.INSTANCE.createJobManagerRunner( jobGraph, configuration, rpcService, highAvailabilityServices, heartbeatServices, jobManagerSharedServices, jobManagerJobMetricGroupFactory, fatalErrorHandler); }
Source:
private static void addReplacementsForPackage( ConcurrentHashMap<MethodSignature, MethodSignature> replacementMap, String originalPackage, String replacementPackage, ClassLoader loader) throws ReplacementException, IOException, ClassNotFoundException { boolean found = false; Enumeration<URL> resources; resources = loader.getResources(replacementPackage.replace('.', '/')); while (resources.hasMoreElements()) { URL url = resources.nextElement(); try { URLConnection connection = url.openConnection(); if (connection instanceof JarURLConnection) { JarFile jarFile = ((JarURLConnection) connection).getJarFile(); addReplacementsFromAllClassesOfPackage( replacementMap, originalPackage, replacementPackage, jarFile); } else { File path = new File(URLDecoder.decode(url.getPath(), "UTF-8")); if (path.exists() && path.isDirectory()) { addReplacementsForPackage(replacementMap, originalPackage, replacementPackage, path); found = true; } } } catch (IOException e) { String msg = String.format( "Error identifying replacement %s with a package: %s", replacementPackage, e.getMessage()); throw new ReplacementException(msg, e); } } if (!found) { String msg = String.format( "No package or class for replacement %s found on classpath", replacementPackage); throw new ReplacementException(msg); } }

Target:
private static void addReplacementsForPackage( ConcurrentHashMap<MethodSignature, MethodSignature> replacementMap, String originalPackage, String replacementPackage, ClassLoader loader) throws ReplacementException, IOException, ClassNotFoundException { boolean found = false; Enumeration<URL> resources = loader.getResources(replacementPackage.replace('.', '/')); while (resources.hasMoreElements()) { URL url = resources.nextElement(); try { URLConnection connection = url.openConnection(); if (connection instanceof JarURLConnection) { JarFile jarFile = ((JarURLConnection) connection).getJarFile(); addReplacementsFromAllClassesOfPackage( replacementMap, originalPackage, replacementPackage, jarFile); } else { File path = new File(URLDecoder.decode(url.getPath(), "UTF-8")); if (path.exists() && path.isDirectory()) { addReplacementsForPackage(replacementMap, originalPackage, replacementPackage, path); found = true; } } } catch (IOException e) { String msg = String.format( "Error identifying replacement %s with a package: %s", replacementPackage, e.getMessage()); throw new ReplacementException(msg, e); } } if (!found) { String msg = String.format("No package for replacement %s found on classpath", replacementPackage); throw new ReplacementException(msg); } }
Source:
private void removeState(String workspaceId) throws ServerException { try (@SuppressWarnings("unused") Unlocker u = locks.writeLock(workspaceId)) { states.remove(workspaceId); } }

Target:
private void removeState(String workspaceId) { try (@SuppressWarnings("unused") Unlocker u = locks.writeLock(workspaceId)) { states.remove(workspaceId); } }
Source:
public CommandResult<V> undo(final C context, final Command<C, V> command) { if (null != getDelegate()) { final CommandResult<V> r = getDelegate().undo(context, command); postUndo(context, command, r); return r; } return null; }

Target:
public CommandResult<V> undo(final C context, final Command<C, V> command) { if (null != getDelegate()) { preUndo(context, command); final CommandResult<V> result = getDelegate().undo(context, command); postUndo(context, command, result); return result; } return null; }
Source:
private void updateECActions(boolean redo) { for (ECState state : fbType.getECC().getECState()) { for (ECAction action : state.getECAction()) { if (redo == true) { if (action.getAlgorithm() == oldAlgorithm) { action.setAlgorithm(newAlgorithm); } } else { if (action.getAlgorithm() == newAlgorithm) { action.setAlgorithm(oldAlgorithm); } } } } }

Target:
private void updateECActions(boolean redo) { if (fbType instanceof BasicFBType) { for (ECState state : ((BasicFBType) fbType).getECC().getECState()) { for (ECAction action : state.getECAction()) { if (true == redo) { if (action.getAlgorithm() == oldAlgorithm) { action.setAlgorithm(newAlgorithm); } } else { if (action.getAlgorithm() == newAlgorithm) { action.setAlgorithm(oldAlgorithm); } } } } } }
Source:
protected SimpleFeatureCollection getFeatures(OskariLayer layer, Envelope bbox, String requestSrsName, String targetSrsName) throws ActionException { CoordinateReferenceSystem requestCRS; CoordinateReferenceSystem targetCRS; try { requestCRS = CRS.decode(requestSrsName, true); targetCRS = CRS.decode(targetSrsName, true); } catch (Exception e) { throw new ActionException(ERR_CRS_DECODE_FAIL); } if (!isWithin(targetCRS, bbox)) { throw new ActionParamsException(ERR_BBOX_OUT_OF_CRS); } boolean shouldTransform = !CRS.equalsIgnoreMetadata(requestCRS, targetCRS); MathTransform transformFromRequested; MathTransform transformToRequested; Envelope requestBbox; if (shouldTransform) { try { transformFromRequested = CRS.findMathTransform(requestCRS, targetCRS, true); transformToRequested = CRS.findMathTransform(targetCRS, requestCRS, true); } catch (Exception e) { throw new ActionException(ERR_TRANSFORM_FIND_FAIL); } try { requestBbox = JTS.transform(bbox, transformToRequested); } catch (Exception e) { throw new ActionException(ERR_REPOJECTION_FAIL); } } else { transformFromRequested = null; transformToRequested = null; requestBbox = bbox; } SimpleFeatureCollection features = getFeatures(layer, requestSrsName, requestBbox); if (shouldTransform) { try { features = transform(features, targetCRS, transformFromRequested); } catch (Exception e) { throw new ActionException(ERR_REPOJECTION_FAIL); } } return features; }

Target:
protected SimpleFeatureCollection getFeatures(OskariLayer layer, Envelope bbox, String requestSrsName, String targetSrsName) throws ActionException { CoordinateReferenceSystem requestCRS; CoordinateReferenceSystem targetCRS; try { requestCRS = CRS.decode(requestSrsName, true); targetCRS = CRS.decode(targetSrsName, true); } catch (Exception e) { throw new ActionParamsException(ERR_CRS_DECODE_FAIL); } if (!isWithin(targetCRS, bbox)) { throw new ActionParamsException(ERR_BBOX_OUT_OF_CRS); } boolean shouldTransform = !CRS.equalsIgnoreMetadata(requestCRS, targetCRS); MathTransform transformFromRequested; MathTransform transformToRequested; Envelope requestBbox; if (shouldTransform) { try { transformFromRequested = CRS.findMathTransform(requestCRS, targetCRS, true); transformToRequested = CRS.findMathTransform(targetCRS, requestCRS, true); } catch (Exception e) { throw new ActionParamsException(ERR_TRANSFORM_FIND_FAIL); } try { requestBbox = JTS.transform(bbox, transformToRequested); } catch (Exception e) { throw new ActionException(ERR_REPOJECTION_FAIL, e); } } else { transformFromRequested = null; transformToRequested = null; requestBbox = bbox; } SimpleFeatureCollection features = getFeatures(layer, requestSrsName, requestBbox); if (shouldTransform) { try { features = transform(features, targetCRS, transformFromRequested); } catch (Exception e) { throw new ActionException(ERR_REPOJECTION_FAIL, e); } } return features; }
Source:
private void parseAnnotatedNameOrEmail(final String annotatedNameOrEmail) throws UnloggedFailure, OrmException { char action = annotatedNameOrEmail.charAt(0); if (action != '+' && action != '-') { throw error("\"" + annotatedNameOrEmail + "\" must begin with a '+' or '-'"); } final String nameOrEmail = annotatedNameOrEmail.substring(1); final Account account = accountResolver.find(nameOrEmail); if (account == null || !account.isActive()) { throw error("\"" + nameOrEmail + "\" is not an active user"); } if (allReviewers.containsKey(account.getId())) { throw error("\"" + nameOrEmail + "\" and \"" + allReviewers.get(account.getId()) + "\" are the same user"); } allReviewers.put(account.getId(), nameOrEmail); if (action == '+') { reviewersToAdd.add(nameOrEmail); } else { reviewersToRemove.add(account.getId()); } }

Target:
private boolean parseAnnotatedNameOrEmail(final String annotatedNameOrEmail) throws UnloggedFailure { Set<String> matchingSet; Set<String> otherSet; switch (annotatedNameOrEmail.charAt(0)) { case '+': matchingSet = reviewersToAdd; otherSet = reviewersToRemove; break; case '-': matchingSet = reviewersToRemove; otherSet = reviewersToAdd; break; default: return false; } final String nameOrEmail = annotatedNameOrEmail.substring(1); if (otherSet.contains(nameOrEmail)) { throw error("You cannot both add and remove \"" + nameOrEmail + "\""); } matchingSet.add(nameOrEmail); return true; }
Source:
protected void generate(IFile file, JobGroup jobGroup) { String filePath = file.getLocation().toFile().getAbsolutePath(); URI tpdURI = URI.createFileURI(filePath); Converter converter = new Converter(); Injector injector = TargetplatformActivator.getInstance().getInjector(TargetplatformActivator.ORG_ECLIPSE_CBI_TARGETPLATFORM_TARGETPLATFORM); injector.injectMembers(converter); Job job = new Job(Messages.GenerateTargetsHandler_GenerateTargetPlatformFor + file.getLocation().lastSegment()) { @Override protected IStatus run(IProgressMonitor monitor) { Diagnostic result = converter.generateTargetDefinitionFile(tpdURI, new NullProgressMonitor()); if (result.getSeverity() >= Diagnostic.WARNING) { Activator.getDefault().getLog().log(BasicDiagnostic.toIStatus(result)); } try { file.getParent().refreshLocal(IResource.DEPTH_ONE, null); generateEclipseTarget(file); } catch (CoreException ex) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Unexpected exception", ex); } return BasicDiagnostic.toIStatus(result); } }; job.setJobGroup(jobGroup); job.schedule(); }

Target:
protected void generate(IFile file, JobGroup jobGroup) { String filePath = file.getLocation().toFile().getAbsolutePath(); URI tpdURI = URI.createFileURI(filePath); Converter converter = new Converter(); Injector injector = TargetplatformActivator.getInstance().getInjector(TargetplatformActivator.ORG_ECLIPSE_CBI_TARGETPLATFORM_TARGETPLATFORM); injector.injectMembers(converter); Job job = new Job(Messages.GenerateTargetsHandler_GenerateTargetPlatformFor + file.getLocation().lastSegment()) { @Override protected IStatus run(IProgressMonitor monitor) { Diagnostic result = converter.generateTargetDefinitionFile(tpdURI, new NullProgressMonitor()); if (result.getSeverity() >= Diagnostic.WARNING) { Activator.getDefault().getLog().log(BasicDiagnostic.toIStatus(result)); } try { file.getParent().refreshLocal(IResource.DEPTH_ONE, null); generateEclipseTarget(file); } catch (CoreException ex) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.GenerateTargetsHandler_UnexpectedException, ex); } return BasicDiagnostic.toIStatus(result); } }; job.setJobGroup(jobGroup); job.schedule(); }
Source:
private void updateCheckpointFileCache(final Map<TopicPartition, Long> checkpointableOffsetsFromProcessing) { final Map<TopicPartition, Long> restoredOffsets = validCheckpointableOffsets(changelogReader.restoredOffsets()); log.trace("Checkpointable offsets updated with restored offsets: {}", checkpointFileCache); for (final TopicPartition topicPartition : validCheckpointableTopics()) { if (checkpointableOffsetsFromProcessing.containsKey(topicPartition)) { checkpointFileCache.put(topicPartition, checkpointableOffsetsFromProcessing.get(topicPartition) + 1); } else if (standbyRestoredOffsets.containsKey(topicPartition)) { checkpointFileCache.put(topicPartition, standbyRestoredOffsets.get(topicPartition)); } else if (restoredOffsets.containsKey(topicPartition)) { checkpointFileCache.put(topicPartition, restoredOffsets.get(topicPartition)); } else if (checkpointFileCache.containsKey(topicPartition)) { } else { final Long loadedOffset = validCheckpointableOffsets(initialLoadedCheckpoints).get(topicPartition); if (loadedOffset != null) { checkpointFileCache.put(topicPartition, loadedOffset); } } } }

Target:
private void updateCheckpointFileCache(final Map<TopicPartition, Long> checkpointableOffsetsFromProcessing) { final Set<TopicPartition> validCheckpointableTopics = validCheckpointableTopics(); final Map<TopicPartition, Long> restoredOffsets = validCheckpointableOffsets( changelogReader.restoredOffsets(), validCheckpointableTopics ); log.trace("Checkpointable offsets updated with restored offsets: {}", checkpointFileCache); for (final TopicPartition topicPartition : validCheckpointableTopics) { if (checkpointableOffsetsFromProcessing.containsKey(topicPartition)) { checkpointFileCache.put(topicPartition, checkpointableOffsetsFromProcessing.get(topicPartition) + 1); } else if (standbyRestoredOffsets.containsKey(topicPartition)) { checkpointFileCache.put(topicPartition, standbyRestoredOffsets.get(topicPartition)); } else if (restoredOffsets.containsKey(topicPartition)) { checkpointFileCache.put(topicPartition, restoredOffsets.get(topicPartition)); } else if (checkpointFileCache.containsKey(topicPartition)) { } else { final Long loadedOffset = validCheckpointableOffsets(initialLoadedCheckpoints, validCheckpointableTopics).get(topicPartition); if (loadedOffset != null) { checkpointFileCache.put(topicPartition, loadedOffset); } } } }
Source:
public synchronized void leave() { if (!active) { return; } hazelcast.getCluster().removeMembershipListener(nodeID); hazelcast.getLifecycleService().shutdown(); active = false; }

Target:
public synchronized void leave() { if (!active) { return; } boolean left = hazelcast.getCluster().removeMembershipListener(membershipListenerId); if (!left) { log.warn("Unable to remove membership listener"); } hazelcast.getLifecycleService().shutdown(); active = false; }
Source:
public int deleteRuntimeStats(int maxRetainSecs) throws MetaException { if (maxRetainSecs < 0) { LOG.warn("runtime stats retention is disabled"); return 0; } boolean committed = false; try (Query q = pm.newQuery(MRuntimeStat.class)) { openTransaction(); int maxCreateTime = (int) (System.currentTimeMillis() / 1000) - maxRetainSecs; q.setFilter("createTime <= maxCreateTime"); q.declareParameters("int maxCreateTime"); long deleted = q.deletePersistentAll(maxCreateTime); committed = commitTransaction(); return (int) deleted; } catch (Exception e) { throw new MetaException(e.getMessage()); } finally { if (!committed) { rollbackTransaction(); } } }

Target:
public int deleteRuntimeStats(int maxRetainSecs) throws MetaException { if (maxRetainSecs < 0) { LOG.warn("runtime stats retention is disabled"); return 0; } boolean committed = false; Query q = null; try { openTransaction(); int maxCreateTime = (int) (System.currentTimeMillis() / 1000) - maxRetainSecs; q = pm.newQuery(MRuntimeStat.class); q.setFilter("createTime <= maxCreateTime"); q.declareParameters("int maxCreateTime"); long deleted = q.deletePersistentAll(maxCreateTime); committed = commitTransaction(); return (int) deleted; } finally { rollbackAndCleanup(committed, q); } }
Source:
public Integer getNumberOfImageFiles(URI directory) { int count = 0; if (directory.isAbsolute()) { if (isDirectory(directory)) { count = getSubUris(Helper.imageNameFilter, directory).size(); ArrayList<URI> children = getSubUris(directory); for (URI aChildren : children) { count += getNumberOfImageFiles(aChildren); } } } else { directory = getAbsoluteURI(directory, MappingType.DATA, null, null); count = getSubUris(Helper.imageNameFilter, directory).size(); ArrayList<URI> children = getSubUris(directory); for (URI aChildren : children) { count += getNumberOfImageFiles(aChildren); } } return count; }

Target:
public Integer getNumberOfImageFiles(URI directory) { int count = 0; if (directory.isAbsolute()) { count += iterateOverImageDirectories(directory); } else { directory = getAbsoluteURI(directory, MappingType.DATA, null, null); count += iterateOverImageDirectories(directory); } return count; }
Source:
<T> StatefulEJBLocator<T> createSession(final StatelessEJBLocator<T> statelessLocator, final AuthenticationConfiguration authenticationConfiguration, final SSLContext sslContext) throws Exception { final LocatedAction<StatefulEJBLocator<T>, StatelessEJBLocator<T>, T> action = (receiver, originalLocator, newAffinity, ac, sc) -> receiver.createSession(originalLocator.withNewAffinity(newAffinity), ac, sc); if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("Calling createSession(module = %s, strong affinity = %s): ", ((EJBLocator)statelessLocator).getIdentifier(), statelessLocator.getAffinity()); } return performLocatedAction(statelessLocator, action, Affinity.NONE, authenticationConfiguration, sslContext); }

Target:
<T> StatefulEJBLocator<T> createSession(final StatelessEJBLocator<T> statelessLocator, final AuthenticationConfiguration authenticationConfiguration, final SSLContext sslContext) throws Exception { final LocatedAction<StatefulEJBLocator<T>, StatelessEJBLocator<T>, T> action = (receiver, originalLocator, newAffinity, ac, sc) -> receiver.createSession(originalLocator.withNewAffinity(newAffinity), ac, sc); Logs.INVOCATION.tracef("Calling createSession(locator = %s)",statelessLocator); return performLocatedAction(statelessLocator, action, Affinity.NONE, authenticationConfiguration, sslContext); }
Source:
public String serializeToString() { StringBuilder str = new StringBuilder(); return str.append(this.getClass().getSimpleName()).append(":[").append( "id=<").append(getId()).append(">").append( ", login=<").append(getLogin() == null ? "\\0" : BeansUtils.createEscaping(getLogin())).append(">").append( ", source=<").append(extSource == null ? "\\0" : getExtSource().serializeToString()).append(">").append( ", userId=<").append(getUserId()).append(">").append( ", loa=<").append(getLoa()).append(">").append( ", lastAccess=<").append(lastAccess).append(">").append( ']').toString(); }

Target:
public String serializeToString() { StringBuilder str = new StringBuilder(); return str.append(this.getClass().getSimpleName()).append(":[").append( "id=<").append(getId()).append(">").append( ", login=<").append(getLogin() == null ? "\\0" : BeansUtils.createEscaping(getLogin())).append(">").append( ", source=<").append(extSource == null ? "\\0" : getExtSource().serializeToString()).append(">").append( ", userId=<").append(getUserId()).append(">").append( ", loa=<").append(getLoa()).append(">").append( ", lastAccess=<").append(lastAccess == null ? "\\0" : BeansUtils.createEscaping(lastAccess)).append(">").append( ']').toString(); }
Source:
public void testTokensNotNull() { final UnnecessarySemicolonInEnumerationCheck check = new UnnecessarySemicolonInEnumerationCheck(); Assert.assertNotNull("Acceptable tokens should not be null", check.getAcceptableTokens()); Assert.assertNotNull("Default tokens should not be null", check.getDefaultTokens()); Assert.assertNotNull("Required tokens should not be null", check.getRequiredTokens()); }

Target:
public void testTokensNotNull() { final UnnecessarySemicolonInEnumerationCheck check = new UnnecessarySemicolonInEnumerationCheck(); final int[] expected = { TokenTypes.ENUM_DEF, }; Assert.assertArrayEquals("Acceptable required tokens are invalid", expected, check.getAcceptableTokens()); Assert.assertArrayEquals("Default required tokens are invalid", expected, check.getDefaultTokens()); Assert.assertArrayEquals("Required required tokens are invalid", expected, check.getRequiredTokens()); }
Source:
protected long getIdleTimeout(String wsId) throws NotFoundException, ServerException { return defaultTimeout; }

Target:
protected long getIdleTimeout(String wsId) { return defaultTimeout; }
Source:
public Mono<Response<Key>> updateKey(KeyBase key) { Objects.requireNonNull(key, "The key input parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .tags(key.tags()) .keyOps(key.keyOperations()) .keyAttributes(new KeyRequestAttributes(key)); return service.updateKey(endpoint, key.name(), key.version(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE); }

Target:
public Mono<Response<Key>> updateKey(KeyBase key) { Objects.requireNonNull(key, "The key input parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .tags(key.tags()) .keyAttributes(new KeyRequestAttributes(key)); return service.updateKey(endpoint, key.name(), key.version(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE); }
Source:
public Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> getQuestionResponseMapSortedByRecipient() { if (questions == null || responses == null) { return null; } Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> sortedMap = new TreeMap<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>(); for (FeedbackQuestionAttributes question : questions.values()) { sortedMap.put(question, new ArrayList<FeedbackResponseAttributes>()); } for (FeedbackResponseAttributes response : responses) { List<FeedbackResponseAttributes> responsesForQuestion = sortedMap .get(questions.get(response.feedbackQuestionId)); responsesForQuestion.add(response); } for (List<FeedbackResponseAttributes> responsesForQuestion : sortedMap.values()) { Collections.sort(responsesForQuestion, compareByRecipientName); } return sortedMap; }

Target:
public Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> getQuestionResponseMapSortedByRecipient() { if (questions == null || responses == null) { return null; } Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> sortedMap = new TreeMap<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>(); for (FeedbackQuestionAttributes question : questions.values()) { sortedMap.put(question, new ArrayList<FeedbackResponseAttributes>()); } for (FeedbackResponseAttributes response : responses) { FeedbackQuestionAttributes question = questions.get(response.feedbackQuestionId); List<FeedbackResponseAttributes> responsesForQuestion = sortedMap.get(question); responsesForQuestion.add(response); } for (List<FeedbackResponseAttributes> responsesForQuestion : sortedMap.values()) { Collections.sort(responsesForQuestion, compareByRecipientName); } return sortedMap; }
Source:
public static <M, OM> StreamOperatorSpec<M, OM> createStreamOperatorSpec( FlatMapFunction<? super M, ? extends OM> transformFn, MessageStreamImpl<OM> nextStream, int opId) { return new StreamOperatorSpec<>(new FlatMapFunction<M, OM>() { @Override public Collection<OM> apply(M message) { ArrayList<OM> retVal = new ArrayList<OM>(); retVal.addAll(transformFn.apply(message)); return retVal; } @Override public void init(Config config, TaskContext context) { transformFn.init(config, context); } }, nextStream, OperatorSpec.OpCode.FLAT_MAP, opId); }

Target:
public static <M, OM> StreamOperatorSpec<M, OM> createStreamOperatorSpec( FlatMapFunction<? super M, ? extends OM> transformFn, MessageStreamImpl<OM> nextStream, int opId) { return new StreamOperatorSpec<>((FlatMapFunction<M, OM>) transformFn, nextStream, OperatorSpec.OpCode.FLAT_MAP, opId); }
Source:
public boolean matches(List<Type> sourceTypes, Type targetType) { if ( sourceTypes.size() > 1 ) { return false; } Type sourceType = sourceTypes.iterator().next(); if ( getReturnType().erasure().isAssignableTo( targetType.erasure() ) && sourceType.erasure().isAssignableTo( getParameter().getType().erasure() ) ) { return doTypeVarsMatch( sourceType, targetType ); } if ( getReturnType().erasure().getFullyQualifiedName().equals( "java.lang.Object" ) && sourceType.erasure().isAssignableTo( getParameter().getType().erasure() ) ) { return doTypeVarsMatch( sourceType, targetType ); } if ( getReturnType().erasure().isAssignableTo( targetType.erasure() ) && getParameter().getType().erasure().getFullyQualifiedName().equals( "java.lang.Object" ) ) { return doTypeVarsMatch( sourceType, targetType ); } return false; }

Target:
public boolean matches(List<Type> sourceTypes, Type targetType) { if ( sourceTypes.size() > 1 ) { return false; } Type sourceType = sourceTypes.iterator().next(); if ( getReturnType().isAssignableTo( targetType.erasure() ) && sourceType.erasure().isAssignableTo( getParameter().getType() ) ) { return doTypeVarsMatch( sourceType, targetType ); } if ( getReturnType().getFullyQualifiedName().equals( "java.lang.Object" ) && sourceType.erasure().isAssignableTo( getParameter().getType() ) ) { return doTypeVarsMatch( sourceType, targetType ); } if ( getReturnType().isAssignableTo( targetType.erasure() ) && getParameter().getType().getFullyQualifiedName().equals( "java.lang.Object" ) ) { return doTypeVarsMatch( sourceType, targetType ); } return false; }
Source:
private void addMapReduceJobState(PigJob pigJob) { JobClient jobClientLocal = getJobClient(); try { String id = pigJob.getId(); RunningJob runningJob = null; try { runningJob = jobClientLocal.getJob(id); } catch (Exception e) { log.warn("Exception while querying job status for jobId=" + id +" message: " + e.getMessage()); log.debug(e); return; } if (runningJob == null) { log.warn("Couldn't find job status for jobId=" + id); return; } Properties jobConfProperties = getJobConfFromFile(runningJob); JobID jobID = runningJob.getID(); TaskReport[] mapTaskReport = jobClientLocal.getMapTaskReports(jobID); TaskReport[] reduceTaskReport = jobClientLocal.getReduceTaskReports(jobID); if (jobConfProperties != null && jobConfProperties.size() > 0) { pigJob.setConfiguration(jobConfProperties); } pigJob.setMapReduceJobState( new MapReduceJobState(runningJob, mapTaskReport, reduceTaskReport)); } catch (IOException e) { log.warn("Error occurred when retrieving job progress info. ", e); } }

Target:
private void addMapReduceJobState(PigJob pigJob) { JobClient jobClientLocal = getJobClient(); try { String id = pigJob.getId(); RunningJob runningJob = null; try { runningJob = jobClientLocal.getJob(id); } catch (Exception e) { log.warn("Exception while querying job status for jobId=" + id +" message: " + e.getMessage()); log.debug(e); return; } if (runningJob == null) { log.warn("Couldn't find job status for jobId=" + id); return; } Properties jobConfProperties = getJobConfFromFile(runningJob); JobID jobID = null; try { jobID = runningJob.getID(); } catch (NullPointerException e) { log.warn("Couldn't get jobID for runningJob."); return; } TaskReport[] mapTaskReport = jobClientLocal.getMapTaskReports(jobID); TaskReport[] reduceTaskReport = jobClientLocal.getReduceTaskReports(jobID); if (jobConfProperties != null && jobConfProperties.size() > 0) { pigJob.setConfiguration(jobConfProperties); } pigJob.setMapReduceJobState( new MapReduceJobState(runningJob, mapTaskReport, reduceTaskReport)); } catch (IOException e) { log.warn("Error occurred when retrieving job progress info. ", e); } }
Source:
private ExecutionList executionList() { for (;;) { ExecutionList executionListLocal = this.executionList; if (executionListLocal != null) { return executionListLocal; } ExecutionList r = new ExecutionList(); if (executionListField.compareAndSet(this, null, r)) { return r; } } }

Target:
private ExecutionList executionList() { ExecutionList executionListLocal = this.executionList; if (executionListLocal != null) { return executionListLocal; } ExecutionList r = new ExecutionList(); if (executionListField.compareAndSet(this, null, r)) { return r; } else { return this.executionList; } }
Source:
public boolean visit(@Nonnull JSwitchStatement switchStmt) { JExpression switchExpr = switchStmt.getExpr(); JType switchExprType = switchExpr.getType(); if (switchExprType != null && switchExprType instanceof JDefinedEnum) { JDefinedEnum enumType = (JDefinedEnum) switchExprType; JDefinedClass syntheticSwitchmapClass = manager.getOrCreateRelatedSyntheticClass( enclosingClass, enumType); SyntheticSwitchmapClassFiller filler = new SyntheticSwitchmapClassFiller(); filler.fillSyntheticClass(supportUtil, enumType, syntheticSwitchmapClass); String syntheticInitializerName = SupportUtil.getSyntheticSwitchmapInitializerName( enumType); JMethod syntheticSwitchmapInitializer = syntheticSwitchmapClass.getMethod( syntheticInitializerName, supportUtil.getPrimitiveIntType().getArray()); JExpression callSwitchValues = new JMethodCall(switchStmt.getSourceInfo(), null, syntheticSwitchmapClass, syntheticSwitchmapInitializer.getMethodId(), supportUtil.getPrimitiveIntType().getArray(), syntheticSwitchmapInitializer.canBePolymorphic()); JMethodId ordinalMethodId = enumType.getOrCreateMethodId(SupportUtil.Ordinal, Collections.<JType>emptyList(), MethodKind.INSTANCE_VIRTUAL); transformRequest.append(new Replace(switchExpr, new JArrayRef(switchStmt.getSourceInfo(), callSwitchValues, new JMethodCall(switchStmt.getSourceInfo(), switchExpr, enumType, ordinalMethodId, supportUtil.getPrimitiveIntType(), ordinalMethodId.canBeVirtual()) ) ) ); } return super.visit(switchStmt); }

Target:
public boolean visit(@Nonnull JSwitchStatement switchStmt) { JExpression switchExpr = switchStmt.getExpr(); JType switchExprType = switchExpr.getType(); if (switchExprType instanceof JDefinedEnum) { JDefinedEnum enumType = (JDefinedEnum) switchExprType; JDefinedClass switchMapClass = manager.getOrCreateRelatedSyntheticClass(enumType); if (switchMapClass == null) { switchMapClass = enclosingClass; } SwitchMapClassFiller classFiller = new SwitchMapClassFiller(); classFiller.fillSwitchMapClass(supportUtil, enumType, switchMapClass); String syntheticInitializerName = SupportUtil.getSyntheticSwitchMapInitializerName( enumType); JMethod syntheticSwitchmapInitializer = switchMapClass.getMethod( syntheticInitializerName, supportUtil.getPrimitiveIntType().getArray()); JExpression getSwitchMapInvocExpr = new JMethodCall(switchStmt.getSourceInfo(), null , switchMapClass, syntheticSwitchmapInitializer.getMethodId(), syntheticSwitchmapInitializer.getType(), syntheticSwitchmapInitializer.canBePolymorphic()); JMethod ordinalMethod = supportUtil.getEnumType().getMethod(SupportUtil.Ordinal, supportUtil.getPrimitiveIntType(), Collections.<JType>emptyList()); transformRequest.append(new Replace(switchExpr, new JArrayRef(switchStmt.getSourceInfo(), getSwitchMapInvocExpr, new JMethodCall(switchStmt.getSourceInfo(), switchExpr, enumType, ordinalMethod.getMethodId(), ordinalMethod.getType(), ordinalMethod.canBePolymorphic()) ) ) ); } return super.visit(switchStmt); }
Source:
public String toString() { return String.format("UfsJournalSystem, based at %s", mBase.toString()); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("Ufs-Uri", mBase) .toString(); }
Source:
protected void taskExecute() { if (log.isDebugEnabled()) { log.debug("Executing RabbitMQ Task Execution."); } rabbitMQConsumer.execute(); }

Target:
protected void taskExecute() { log.debug("Executing RabbitMQ Task Execution."); rabbitMQConsumer.execute(); }
Source:
private void sendWork(List<LuceneWork> works, Address destination) { AffinityUpdateCommand indexUpdateCommand = new AffinityUpdateCommand(ByteString.fromString(cache.getName())); byte[] serializedModel = getSerializer().toSerializedModel(works); indexUpdateCommand.setSerializedWorkList(serializedModel); List<Address> dest = Collections.singletonList(destination); log.infof("Sending work to %s to %s", works, dest); CompletableFuture<Map<Address, Response>> result = rpcManager.invokeRemotelyAsync(dest, indexUpdateCommand, rpcManager.getDefaultRpcOptions(false)); result.whenComplete((responses, error) -> { if (error != null) { log.error("Error forwarding index job", error); } }); }

Target:
private void sendWork(List<LuceneWork> works, Address destination) { AffinityUpdateCommand indexUpdateCommand = new AffinityUpdateCommand(ByteString.fromString(cache.getName())); byte[] serializedModel = getSerializer().toSerializedModel(works); indexUpdateCommand.setSerializedWorkList(serializedModel); List<Address> dest = Collections.singletonList(destination); log.debugf("Sending works %s to %s", works, dest); CompletableFuture<Map<Address, Response>> result = rpcManager.invokeRemotelyAsync(dest, indexUpdateCommand, rpcManager.getDefaultRpcOptions(false)); result.whenComplete((responses, error) -> { if (error != null) { log.error("Error forwarding index job", error); } }); }
Source:
public Term toKApp(List<Term> items) { if(items.size()==0){ return KApp.of(sort().unitLabel()); } Term basedKapp = items.get(items.size()-1); for(int i = items.size()-2; i >= 0; --i){ basedKapp = KApp.of(sort().constructorLabel(), items.get(i), basedKapp); } return basedKapp; }

Target:
public Term toKApp(List<Term> items) { if(items.isEmpty()){ return KApp.of(sort().unitLabel()); } Term current = items.get(items.size() - 1); for(int i = items.size() - 2; i >= 0; --i){ current = KApp.of(sort().constructorLabel(), items.get(i), current); } return current; }