auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Ample.TabletMutator deleteBulkFile(Ample.FileMeta bulkref) { <START> throw new UnsupportedOperationException(); <END> }</code><technical_language>java Preconditions.checkState(updatesEnabled, "Cannot updates calling mutate."); mutation.putDelete(TabletsSection.BulkFileColumnFamily.NAME, bulkref.meta());</technical_language>

Target:
public Ample.TabletMutator deleteBulkFile(Ample.FileMeta bulkref) { Preconditions.checkState(updatesEnabled, "Cannot make updates after calling mutate."); mutation.putDelete(TabletsSection.BulkFileColumnFamily.NAME, bulkref.meta()); return this; }
Source:
<code>public static void typedCharacter(char c, boolean isSeparator) { <START> boolean isSpace = c == ' '; <END> boolean isEnter = c == '\n'; switch (sState) { case IN_WORD: if (isSpace || isSeparator) { sState = State.START; } break; case ACCEPTED_DEFAULT: if (isSpace) { sState = State.SPACE_AFTER_ACCEPTED; } else if (isEnter) { sState = State.UNKNOWN; } else if (isSeparator) { sState = State.PUNCTUATION_AFTER_ACCEPTED; } else { sState = State.IN_WORD; } break; case PERFORMED_GESTURE: case PICKED_CORRECTION: case PICKED_SUGGESTION: case PICKED_TYPED_ADDED_TO_DICTIONARY: if (isSpace) { sState = State.SPACE_AFTER_PICKED; } else if (isEnter) { sState = State.UNKNOWN; } else if (isSeparator) { sState = State.PUNCTUATION_AFTER_PICKED; } else { sState = State.IN_WORD; } break; case START: case UNKNOWN: case SPACE_AFTER_ACCEPTED: case SPACE_AFTER_PICKED: case PUNCTUATION_AFTER_ACCEPTED: case PUNCTUATION_AFTER_PICKED: if (!isSpace && !isSeparator) { sState = State.IN_WORD; } else { sState = State.START; } break; case UNDO_COMMIT: if (isSpace || isSeparator) { sState = State.ACCEPTED_DEFAULT; } else { sState = State.IN_WORD; } break; } displayState(); }</code><technical_language>If final stay, preferable</technical_language>

Target:
public static void typedCharacter(char c, boolean isSeparator) { final boolean isSpace = c == ' '; final boolean isEnter = c == '\n'; switch (sState) { case IN_WORD: if (isSpace || isSeparator) { sState = State.START; } break; case ACCEPTED_DEFAULT: if (isSpace) { sState = State.SPACE_AFTER_ACCEPTED; } else if (isEnter) { sState = State.UNKNOWN; } else if (isSeparator) { sState = State.PUNCTUATION_AFTER_ACCEPTED; } else { sState = State.IN_WORD; } break; case PERFORMED_GESTURE: case PICKED_CORRECTION: case PICKED_SUGGESTION: case PICKED_TYPED_ADDED_TO_DICTIONARY: if (isSpace) { sState = State.SPACE_AFTER_PICKED; } else if (isEnter) { sState = State.UNKNOWN; } else if (isSeparator) { sState = State.PUNCTUATION_AFTER_PICKED; } else { sState = State.IN_WORD; } break; case START: case UNKNOWN: case SPACE_AFTER_ACCEPTED: case SPACE_AFTER_PICKED: case PUNCTUATION_AFTER_ACCEPTED: case PUNCTUATION_AFTER_PICKED: if (!isSpace && !isSeparator) { sState = State.IN_WORD; } else { sState = State.START; } break; case UNDO_COMMIT: if (isSpace || isSeparator) { sState = State.ACCEPTED_DEFAULT; } else { sState = State.IN_WORD; } break; } displayState(); }
Source:
<code>public Map<TableScanNode, Void> visitTableScan(TableScanNode node, Void context) { <START> Map<TableScanNode, Void> ret = new IdentityHashMap<>(); <END> ret.put(node, null); return ret; }</code><technical_language>spell out ret</technical_language>

Target:
public Map<TableScanNode, Void> visitTableScan(TableScanNode node, Void context) { Map<TableScanNode, Void> result = new IdentityHashMap<>(); result.put(node, null); return result; }
Source:
<code>ChangeAndCommit(@Nullable Change change, @Nullable PatchSet ps, RevCommit c) { if (change != null) { changeId = change.getKey().get(); _changeNumber = change.getChangeId(); _revisionNumber = ps != null ? ps.getPatchSetId() : null; PatchSet.Id curr = change.currentPatchSetId(); _currentRevisionNumber = curr != null ? curr.get() : null; } commit = new CommitInfo(); commit.commit = c.name(); commit.parents = Lists.newArrayListWithCapacity(c.getParentCount()); for (int i = 0; i < c.getParentCount(); i++) { CommitInfo p = new CommitInfo(); p.commit = c.getParent(i).name(); commit.parents.add(p); } commit.author = toGitPerson(c.getAuthorIdent()); commit.subject = c.getShortMessage(); IncludedInDetail <START> _detail <END> = new IncludedInDetail(); try { _detail = resolveBranches(c); } catch (Exception e) { e.printStackTrace(); } branches = _detail.getBranches(); }</code><technical_language>_ prefix is necessary</technical_language>

Target:
ChangeAndCommit(@Nullable Change change, @Nullable PatchSet ps, RevCommit c) { if (change != null) { changeId = change.getKey().get(); _changeNumber = change.getChangeId(); _revisionNumber = ps != null ? ps.getPatchSetId() : null; PatchSet.Id curr = change.currentPatchSetId(); _currentRevisionNumber = curr != null ? curr.get() : null; } commit = new CommitInfo(); commit.commit = c.name(); commit.parents = Lists.newArrayListWithCapacity(c.getParentCount()); for (int i = 0; i < c.getParentCount(); i++) { CommitInfo p = new CommitInfo(); p.commit = c.getParent(i).name(); commit.parents.add(p); } commit.author = toGitPerson(c.getAuthorIdent()); commit.subject = c.getShortMessage(); IncludedInDetail detail = new IncludedInDetail(); try { detail = resolveBranches(c); } catch (Exception e) { e.printStackTrace(); } branches = detail.getBranches(); }
Source:
<code>private int getNumericValue(String name, int defaultValue) { try { <START> return Integer.parseInt( getProperties().getSingleProperty( name, "" + defaultValue ) ); <END> } catch (NumberFormatException nfe) { return defaultValue; } }</code><technical_language>If User supplies a x < Integer.MIN_VALUE || x > Integer.MAX_VALUE default; lead User confused generated salience values expected. tempted log substitution of _provided_ _default_. TBH I thought eluded throwing a RTE discussing IRC</technical_language>

Target:
private int getNumericValue(String name, int defaultValue) { try { return Integer.parseInt( getProperties().getSingleProperty( name, "" + defaultValue ) ); } catch (NumberFormatException nfe) { throw new DecisionTableParseException( "Invalid numeric value for option: " + name, nfe ); } }
Source:
<code>public List<Integer> getQuarks() { String[] paths = <START> fPath.split(File.separator); <END> List<Integer> quarks = Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK); for (String path : paths) { List<Integer> subQuarks = new LinkedList<>(); String name = WILDCARD_PATTERN.matcher(path).replaceAll(".*"); for (int relativeQuark : quarks) { subQuarks.addAll(fStateSystem.getSubAttributes(relativeQuark, false, name)); } quarks = subQuarks; } return quarks; }</code><technical_language>wait File.separator if this is a file path, if attribute tree path..</technical_language>

Target:
public List<Integer> getQuarks() { String[] paths = fPath.split(SPLIT_STRING); List<Integer> quarks = Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK); for (String path : paths) { List<Integer> subQuarks = new LinkedList<>(); String name = WILDCARD_PATTERN.matcher(path).replaceAll(".*"); for (int relativeQuark : quarks) { subQuarks.addAll(fStateSystem.getSubAttributes(relativeQuark, false, name)); } quarks = subQuarks; } return quarks; }
Source:
<code>public String getURL(DocumentReference docRef, String action, String queryString) { URL url = context.getXWikiContext().getURLFactory().createURL( docRef.getLastSpaceReference().getName(), docRef.getName(), action, queryString, null, <START> docRef.getRoot().getName(), context.getXWikiContext()); <END> return celementsweb.encodeUrlToUtf8(context.getXWikiContext().getURLFactory().getURL(url, context.getXWikiContext())); }</code><technical_language>createURL accepts a lot of parameters. for a readability please local variables name them, e.g.: createURL(spaceName, docName, action, queryString, anchor, wikiName, context)</technical_language>

Target:
public String getURL(DocumentReference docRef, String action, String queryString) { return urlService.getURL(docRef, action, queryString); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); <START> AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { <END> @Override public void onResult(UserStateDetails userStateDetails) { Log.i(TAG, "AWSMobileClient initialized. User State is : " + userStateDetails.getUserState()); } @Override public void onError(Exception e) { Log.e(TAG, "Initialization error.", e); } }); initUI(); }</code><technical_language>if this is needed</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initUI(); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); if (discussionTopic == null) { String topicId = getArguments().getString(Router.EXTRA_DISCUSSION_TOPIC_ID); GetSpecificCourseTopicsTask getTopicsTask = new GetSpecificCourseTopicsTask(getContext(), courseData.getCourse().getId(), Collections.singletonList(topicId)) { @Override protected void onSuccess(CourseTopics courseTopics) throws Exception { discussionTopic = courseTopics.getCoursewareTopics().get(0).getChildren().get(0); if (!getArguments().getBoolean(ARG_DISCUSSION_HAS_TOPIC_NAME)) { getActivity().setTitle(discussionTopic.getName()); } if (populatePostListRunnable != null) { populatePostListRunnable.run(); } } }; <START> getTopicsTask.setProgressDialog(loadingIndicator); <END> getTopicsTask.execute(); } else { getActivity().setTitle(discussionTopic.getName()); } }</code><technical_language>progress bar is hidden onFinally() callback of Task, is called _after_ onSuccess(), causing potentially hidden immediately shown pagination loader initialization. solution manually managed here, ensure hidden _before_ potential call populatePostListRunnable.run()</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); }
Source:
<code>private T processResponse(HttpResponse httpResponse) throws E { <START> T value; END> long responseStart = System.nanoTime(); state.set(NettyAsyncHttpState.PROCESSING_RESPONSE); NettyResponse response = null; try { response = new NettyResponse(httpResponse); value = responseHandler.handle(request, response); } finally { Duration responseProcessingTime = Duration.nanosSince(responseStart); Duration requestProcessingTime = new Duration(responseStart - requestStart, TimeUnit.NANOSECONDS); if (response != null) { stats.record(request.getMethod(), response.getStatusCode(), response.getBytesRead(), response.getBytesRead(), requestProcessingTime, responseProcessingTime); } } return value; }</code><technical_language>Missing a newline</technical_language>

Target:
private T processResponse(HttpResponse httpResponse) throws E { long responseStart = System.nanoTime(); state.set(NettyAsyncHttpState.PROCESSING_RESPONSE); NettyResponse response = null; T value; try { response = new NettyResponse(httpResponse); value = responseHandler.handle(request, response); } finally { Duration responseProcessingTime = Duration.nanosSince(responseStart); Duration requestProcessingTime = new Duration(responseStart - requestStart, TimeUnit.NANOSECONDS); if (response != null) { stats.record(request.getMethod(), response.getStatusCode(), response.getBytesRead(), response.getBytesRead(), requestProcessingTime, responseProcessingTime); } } return value; }
Source:
<code><START> protected static boolean isNewWatchdogEvent(VmDynamic vmDynamic, VM vmTo) { <END> Double lastWatchdogEvent = vmDynamic.getLastWatchdogEvent(); return vmTo != null && lastWatchdogEvent != null && (vmTo.getLastWatchdogEvent() == null || vmTo.getLastWatchdogEvent() < lastWatchdogEvent); }</code><technical_language>static</technical_language>

Target:
protected static boolean isNewWatchdogEvent(VmDynamic vmDynamic, VM vmTo) { Long lastWatchdogEvent = vmDynamic.getLastWatchdogEvent(); return vmTo != null && lastWatchdogEvent != null && (vmTo.getLastWatchdogEvent() == null || vmTo.getLastWatchdogEvent() < lastWatchdogEvent); }
Source:
<code>private void onInsertedData(List<Metric<?>> metrics) { List<Data> data = new ArrayList<>(metrics.size()); metrics.stream().forEach(m -> addToData(m, data)); if (!data.isEmpty()) { try { <START> log.tracef("Sending: %s", data); <END> alertsService.sendData(data); } catch (Exception e) { log.warnf("Failed to send alerting data.", e); } } }</code><technical_language>guarded if(trace_enabeld)</technical_language>

Target:
private void onInsertedData(List<Metric<?>> metrics) { List<Data> dataToSend = new ArrayList<>(metrics.size()); CacheKey reusableKey = new CacheKey("", ""); metrics.stream().forEach(m -> addToData(m, dataToSend, reusableKey)); if (!dataToSend.isEmpty()) { try { alertsService.sendData(dataToSend, true); } catch (Exception e) { log.warnf("Failed to send alerting data.", e); } } }
Source:
<code>public void init() { super.init(); router = addChild(EntitySpec.create(MongoDBRouter.class) .configure(MongoDBRouter.CONFIG_SERVERS, DependentConfiguration.attributeWhenReady( getConfig(CoLocatedMongoDBRouter.SHARDED_DEPLOYMENT), MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES))); for (EntitySpec<?> siblingSpec : getConfig(CoLocatedMongoDBRouter.SIBLING_SPECS)) { addChild(siblingSpec); } <START> sensors().set(ROUTER, (MongoDBRouter) Iterables.tryFind(getChildren(), Predicates.instanceOf(MongoDBRouter.class)).get()); <END> }</code><technical_language>a reference router</technical_language>

Target:
public void init() { super.init(); MongoDBRouter router = addChild(EntitySpec.create(MongoDBRouter.class) .configure(MongoDBRouter.CONFIG_SERVERS, DependentConfiguration.attributeWhenReady( getConfig(CoLocatedMongoDBRouter.SHARDED_DEPLOYMENT), MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES))); for (EntitySpec<?> siblingSpec : getConfig(CoLocatedMongoDBRouter.SIBLING_SPECS)) { addChild(siblingSpec); } sensors().set(ROUTER, router); }
Source:
<code>private void updateConfig() { final GlusterVolumeGeoReplicationSessionConfigModel geoRepConfigModel = (GlusterVolumeGeoReplicationSessionConfigModel) getWindow(); geoRepConfigModel.startProgress(null); geoRepConfigModel.setLocked(true); <START> setConfig(geoRepConfigModel); resetConfig(geoRepConfigModel); <END> }</code><technical_language>do u need handle set reset seperatly. loop configs, if reset flag is set, add reset list if reset is a change add changed list perform reset set . this approach of this methods merged u need this lock flan GlusterVolumeGeoReplicationSessionConfigModel</technical_language>

Target:
private void updateConfig() { int n = 0; ArrayList<VdcActionType> actionTypes = new ArrayList<VdcActionType>(); ArrayList<VdcActionParametersBase> parameters = new ArrayList<VdcActionParametersBase>(); IFrontendActionAsyncCallback[] callbacks; final GlusterVolumeGeoReplicationSessionConfigModel geoRepConfigModel = (GlusterVolumeGeoReplicationSessionConfigModel) getWindow(); LinkedHashMap<String, String> oldConfigs = geoRepConfigModel.getConfigs(); geoRepConfigModel.startProgress(null); for (EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> newConfigEntity : geoRepConfigModel.getConfigsModel() .getItems()) { Pair<Boolean, GlusterGeoRepSessionConfiguration> newConfigPair = newConfigEntity.getEntity(); GlusterGeoRepSessionConfiguration newConfig = newConfigPair.getSecond(); if (newConfigPair.getFirst()) { actionTypes.add(VdcActionType.ResetDefaultGeoRepConfig); } else { if (!newConfig.getValue().equals(oldConfigs.get(newConfig.getKey()))) { actionTypes.add(VdcActionType.SetGeoRepConfig); } } parameters.add(geoRepConfigModel.formGeoRepConfigParameters(newConfig)); } callbacks = new IFrontendActionAsyncCallback[n]; callbacks[n - 1] = new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { geoRepConfigModel.stopProgress(); closeWindow(); } }; Frontend.getInstance().runMultipleActions(actionTypes, parameters, Arrays.asList(callbacks), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { fetchConfigForSession(geoRepConfigModel.getGeoRepSession()); } }, this); }
Source:
<code>public Datum get(int fieldId) { if (values[fieldId] != null) return values[fieldId]; else if (textBytes.length <= fieldId) { values[fieldId] = NullDatum.get(); } else if (textBytes[fieldId] != null) { try { values[fieldId] = serializeDeserialize.deserialize(schema.getColumn(fieldId), textBytes[fieldId], 0, textBytes[fieldId].length, nullBytes); } catch (Exception e) { values[fieldId] = NullDatum.get(); } textBytes[fieldId] = null; } else { <START> values[fieldId] = NullDatum.get(); END> } return values[fieldId]; }</code><technical_language>This code fills NullDatum values array of LazyTuple user insert data this index. However, VTuple class initialize values array itself</technical_language>

Target:
public Datum get(int fieldId) { if (values[fieldId] != null) return values[fieldId]; else if (textBytes.length <= fieldId) { values[fieldId] = NullDatum.get(); } else if (textBytes[fieldId] != null) { try { values[fieldId] = serializeDeserialize.deserialize(schema.getColumn(fieldId), textBytes[fieldId], 0, textBytes[fieldId].length, nullBytes); } catch (Exception e) { values[fieldId] = NullDatum.get(); } textBytes[fieldId] = null; } else { } return values[fieldId]; }
Source:
<code>void addTileToCurrentTileCanvasView( final Tile tile ) { mTileRenderHandler.post( new Runnable() { @Override public void run() { tile.setTransitionsEnabled( mTransitionsEnabled ); tile.setTransitionDuration( mTransitionDuration ); tile.stampTime(); mTilesAlreadyRendered.add( tile ); mCurrentTileCanvasView.addTile( tile ); } <START> }); <END> }</code><technical_language>space missing ;)</technical_language>

Target:
void addTileToCurrentTileCanvasView( final Tile tile ) { mTileRenderHandler.post( new PrepareTileForRenderRunnable( tile ) ); }
Source:
<code>public void init(Composite parent, String viewerName, ITmfTrace trace) { super.init(parent, viewerName); fCountInstance++; fInstanceNb = fCountInstance; fTrace = trace; <START> fModel = new TmfStatisticsModel(); <END> fProcessAll = (trace instanceof TmfExperiment); initContent(parent); initInput(); }</code><technical_language>remove</technical_language>

Target:
public void init(Composite parent, String viewerName, ITmfTrace trace) { super.init(parent, viewerName); fCountInstance++; fInstanceNb = fCountInstance; fTrace = trace; fProcessAll = (trace instanceof TmfExperiment); initContent(parent); initInput(); }
Source:
<code>public static void main(String args[]) { if (args.length != 3) { System.out.println("USAGE: java [options] %s server.properties hardwarelayout partitionlayout" .format(AmbryServer.class.getSimpleName())); System.exit(1); } try { Properties props = Utils.loadProps(args[0]); VerifiableProperties vprops = new VerifiableProperties(props); ClusterMap clusterMap = new ClusterMapManager(args[1], args[2], new ClusterMapConfig(vprops)); <START> final AmbryServer server = new AmbryServer(vprops, clusterMap, SystemTime.getInstance()); <END> Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { server.shutdown(); } }); server.startup(); server.awaitShutdown(); } catch (Exception e) { System.out.println("error " + e); } System.exit(0); }</code><technical_language>This break internal LI. in mind</technical_language>

Target:
public static void main(String args[]) { if (args.length != 3) { System.out.println("USAGE: java [options] " + AmbryMain.class.getCanonicalName() + " server.properties hardwarelayout partitionlayout"); System.exit(1); } try { Properties props = Utils.loadProps(args[0]); VerifiableProperties vprops = new VerifiableProperties(props); ClusterMap clusterMap = new ClusterMapManager(args[1], args[2], new ClusterMapConfig(vprops)); final AmbryServer server = new AmbryServer(vprops, clusterMap, SystemTime.getInstance()); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { server.shutdown(); } }); server.startup(); server.awaitShutdown(); } catch (Exception e) { System.out.println("error " + e); } System.exit(0); }
Source:
<code>public void saveProjects(Collection<Project> projects) throws IOException { log.info("Migrating projects..."); User user = serviceManager.getAuthorizationManager().getCurrentUser(); for (Project project : projects) { project.setSecurityProfile(new SecurityProfile(user)); if (project.getStudies() == null) project.setStudies(new HashSet<Study>()); if (project.getStudies().isEmpty()) { Study study = new StudyImpl(project, user); study.setAlias(project.getShortName() + " study"); study.setDescription(""); study.setStudyType("Other"); study.setLastModifier(user); project.getStudies().add(study); } project.setId(serviceManager.getProjectDao().save(project)); for (Study study : project.getStudies()) { <START> study.setId(serviceManager.getStudyDao().save(study)); <END> } log.debug("Saved project " + project.getAlias()); } log.info(projects.size() + " projects migrated."); }</code><technical_language>Do need set study's project saving</technical_language>

Target:
public void saveProjects(Collection<Project> projects) throws IOException { log.info("Migrating projects..."); User user = serviceManager.getAuthorizationManager().getCurrentUser(); for (Project project : projects) { project.setSecurityProfile(new SecurityProfile(user)); if (project.getStudies() == null) project.setStudies(new HashSet<Study>()); if (project.getStudies().isEmpty()) { Study study = new StudyImpl(); study.setAlias(project.getShortName() + " study"); study.setDescription(""); study.setStudyType("Other"); study.setLastModifier(user); project.getStudies().add(study); } project.setId(serviceManager.getProjectDao().save(project)); for (Study study : project.getStudies()) { study.setProject(project); study.inheritPermissions(project); study.setId(serviceManager.getStudyDao().save(study)); } log.debug("Saved project " + project.getAlias()); } log.info(projects.size() + " projects migrated."); }
Source:
<code>public void setup(OperatorContext arg0) { LOG.debug("Store with partitions {}", super.getFileStore(), new PartitionKeys(this.partitionMask, this.partitions)); <START> if (!numberOfBucketsFinalized) { <END> numberOfBucketsFinalized = true; } super.setup(arg0); try { this.codec = getCodec(); Class<?> cls = this.codec.getClass(); while (cls != null) { for (Field field : cls.getDeclaredFields()) { if (field.getType().isAssignableFrom(this.getClass())) { field.setAccessible(true); field.set(this.codec, this); } } cls = cls.getSuperclass(); } } catch (Exception e) { throw new RuntimeException("Failed to create codec", e); } }</code><technical_language>Check is needed. simply assign it</technical_language>

Target:
public void setup(OperatorContext arg0) { LOG.debug("Store with partitions {}", super.getFileStore(), new PartitionKeys(this.partitionMask, this.partitions)); if (!numberOfBucketsFinalized) { this.partitionMask = setPartitionMask(); this.numberOfBuckets = this.partitionMask + 1; for (long i = 0; i < this.numberOfBuckets; i++) { this.bucketKeys.add(i); } numberOfBucketsFinalized = true; } super.setup(arg0); try { this.codec = getCodec(); Class<?> cls = this.codec.getClass(); while (cls != null) { for (Field field : cls.getDeclaredFields()) { if (field.getType().isAssignableFrom(this.getClass())) { field.setAccessible(true); field.set(this.codec, this); } } cls = cls.getSuperclass(); } } catch (Exception e) { throw new RuntimeException("Failed to create codec", e); } }
Source:
<code>public Void getResult() { <START> throw new UnsupportedOperationException(getClass().getName()); <END> }</code><technical_language>This is effectively final class, throw new UnsupportedOperationException()</technical_language>

Target:
public Void getResult() { throw new UnsupportedOperationException(); }
Source:
<code>public void actionPerformed(ActionEvent event) { <START> debuggerPresenter.onRemoveExpressionBtnClicked(selectedExpression); <END> }</code><technical_language>store selectedExperssion a global variable. Retrieve method</technical_language>

Target:
public void actionPerformed(ActionEvent event) { WatchExpression expression = debuggerPresenter.getSelectedWatchExpression(); if (expression != null) { debuggerPresenter.onRemoveExpressionBtnClicked(expression); } }
Source:
<code>public void testAnnotationParser() throws Exception { FileDescriptorSource fileDescriptorSource = FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"); Map<String, FileDescriptor> descriptors = parseAndResolve(fileDescriptorSource); for (FileDescriptor fileDescriptor : descriptors.values()) { for (Descriptor messageDescriptor : fileDescriptor.getMessageTypes()) { messageDescriptor.getAnnotations(); for (FieldDescriptor fieldDescriptor : messageDescriptor.getFields()) { <START> fieldDescriptor.getAnnotations(); <END> } } } }</code><technical_language>Missing assertion(s)</technical_language>

Target:
public void testAnnotationParser() throws Exception { Configuration config = new Configuration.Builder() .messageAnnotation("Indexed") .annotationMetadataCreator(new AnnotationMetadataCreator<Object, Descriptor>() { @Override public Object create(Descriptor descriptor, AnnotationElement.Annotation annotation) { AnnotationElement.Value value = annotation.getDefaultAttributeValue(); if (value == null) { return Boolean.TRUE; } if (Boolean.TRUE.equals(value.getValue())) { return Boolean.TRUE; } else if (Boolean.FALSE.equals(value.getValue())) { return Boolean.FALSE; } throw new AnnotationParserException("Invalid value " + value.getValue()); } }) .build(); FileDescriptorSource fileDescriptorSource = FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"); Map<String, FileDescriptor> descriptors = new SquareProtoParser(config).parseAndResolve(fileDescriptorSource); FileDescriptor fileDescriptor = descriptors.get("sample_bank_account/bank.proto"); List<Descriptor> messageTypes = fileDescriptor.getMessageTypes(); Descriptor userMessageType = messageTypes.get(0); assertEquals("sample_bank_account.User", userMessageType.getFullName()); assertEquals(Boolean.TRUE, userMessageType.getParsedAnnotation("Indexed")); Descriptor accountMessageType = messageTypes.get(1); assertEquals("sample_bank_account.Account", accountMessageType.getFullName()); assertEquals(Boolean.TRUE, accountMessageType.getParsedAnnotation("Indexed")); }
Source:
<code>public void visitLiteralReturn(int maxAssigned, Boolean voidReturn) { <START> context.isVoidContext = voidReturn; <END> if (maxAllowed == null) { maxAllowed = maxAssigned; } ++count; }</code><technical_language>do set property outer class field? Please refer isVoidContext object: java isVoidContext = voidReturn;</technical_language>

Target:
public void visitLiteralReturn(int maxAssigned, Boolean voidReturn) { isVoidContext = voidReturn; if (maxAllowed == null) { maxAllowed = maxAssigned; } ++count; }
Source:
<code><START> public String getClusterName() { <END> return clusterId; }</code><technical_language>getClusterId()</technical_language>

Target:
public String getClusterName() { return clusterName; }
Source:
<code>public void copy(Path source, Path destination, String destinationFilename) { log.info("Copying to {}", source, destination); Path destinationPath = destination.resolve(destinationFilename); try { Files.createDirectories(destination); Files.copy(source, destinationPath); } catch (FileAlreadyExistsException e) { if (!calculateMd5sum(source).equals(calculateMd5sum(destinationPath))) { <START> Throwables.propagate(e); <END> } } catch (IOException e) { throw Throwables.propagate(e); } }</code><technical_language>Yeah, open TODO replace a number of guava propagate/Optional in Singularity. If replace propagate usage @pschoenfelder do class least? good start cleaning</technical_language>

Target:
public void copy(Path source, Path destination, String destinationFilename) { log.info("Copying to {}", source, destination); Path destinationPath = destination.resolve(destinationFilename); try { Files.createDirectories(destination); Files.copy(source, destinationPath); } catch (FileAlreadyExistsException e) { if (!calculateMd5sum(source).equals(calculateMd5sum(destinationPath))) { throw new RuntimeException(e); } } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public EventBuilder setEventData(Eventful entity) { if (entity != null) { if (entity instanceof Named && ((Named) entity).getName() != null) { event.setTargetName(((Named) entity).getName()); } if (entity instanceof Owned) { String ownerId = ((Owned) entity).getOwnerId(); if (ownerId != null) { event.setOwnerId(ownerId); } } if (entity instanceof Entitlement) { event.setReferenceType(Event.ReferenceType.POOL); Pool referencedPool = ((Entitlement) entity).getPool(); if (referencedPool != null && referencedPool.getId() != null) { event.setReferenceId(referencedPool.getId()); } } if (entity.getId() != null) { event.setEntityId((String) entity.getId()); if (entity instanceof ConsumerProperty) { Consumer owningConsumer = ((ConsumerProperty) entity).getConsumer(); if (owningConsumer != null && owningConsumer.getUuid() != null) { event.setConsumerUuid(owningConsumer.getUuid()); } } } if (event.getTarget().equals(Target.POOL) && event.getType().equals(Type.CREATED)) { Map<String, String> eventData = new HashMap<>(); eventData.put("subscriptionId", ((Pool) entity).getSubscriptionId()); String output = Util.toJson(eventData); <START> if (output == null) { <END> throw new IseException("Error while building JSON for pool.created event."); } event.setEventData(output); } } return this; }</code><technical_language>This odd me. Util.toJson throw exception if is unable serialize JSON</technical_language>

Target:
public EventBuilder setEventData(Eventful entity) { if (entity != null) { if (entity instanceof Named && ((Named) entity).getName() != null) { event.setTargetName(((Named) entity).getName()); } if (entity instanceof Owned) { String ownerId = ((Owned) entity).getOwnerId(); if (ownerId != null) { event.setOwnerId(ownerId); } } if (entity instanceof Entitlement) { event.setReferenceType(Event.ReferenceType.POOL); Pool referencedPool = ((Entitlement) entity).getPool(); if (referencedPool != null && referencedPool.getId() != null) { event.setReferenceId(referencedPool.getId()); } } if (entity.getId() != null) { event.setEntityId((String) entity.getId()); if (entity instanceof ConsumerProperty) { Consumer owningConsumer = ((ConsumerProperty) entity).getConsumer(); if (owningConsumer != null && owningConsumer.getUuid() != null) { event.setConsumerUuid(owningConsumer.getUuid()); } } } if (event.getTarget().equals(Target.POOL) && event.getType().equals(Type.CREATED)) { Map<String, String> eventData = new HashMap<>(); eventData.put("subscriptionId", ((Pool) entity).getSubscriptionId()); try { event.setEventData(Util.toJson(eventData)); } catch (JsonProcessingException e) { log.error("Error while building JSON for pool.created event.", e); throw new IseException("Error while building JSON for pool.created event.", e); } } } return this; }
Source:
<code>protected Map getImgMetadata(InputStream input) { <START> Map<String, String> map = new HashMap<>(); <END> try { Metadata meta = ImageMetadataReader.readMetadata(input); map = processMetaData(meta); } catch (ImageProcessingException ex) { logger.error("Error reading metadata from file " + this.getFileName() + " - message " + ex.getMessage()); } catch (IOException ioex) { logger.error("Error reading inputStream", ioex); } return map; }</code><technical_language>Bad variable declaration</technical_language>

Target:
protected Map getImgMetadata(InputStream input) { Map<String, String> imgMetadata = new HashMap<>(); try { Metadata meta = ImageMetadataReader.readMetadata(input); imgMetadata = processMetaData(meta); } catch (ImageProcessingException ex) { logger.error("Error reading metadata from file " + this.getFileName() + " - message " + ex.getMessage(), ex); } catch (IOException ioex) { logger.error("Error reading inputStream", ioex); } return imgMetadata; }
Source:
<code>protected void runImpl() throws IOException, Failure { final Set<AccountGroup.Id> uploadGroup = getServerCommandConfig().getUploadGroup(); if (uploadGroup != null && !uploadGroup.isEmpty()) { if (!CollectionsUtil.isAnyIncludedIn(currentUser.getEffectiveGroups(), uploadGroup)) { <START> throw new Failure(1, "User: " + currentUser.getUserName() <END> + " not allowed to execute this command on this server"); } } final UploadPack up = new UploadPack(repo); if (!projectControl.allRefsAreVisible()) { up.setRefFilter(new VisibleRefFilter(repo, projectControl, db.get())); } up.setTimeout(config.getTimeout()); try { up.upload(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } }</code><technical_language>note in Receive</technical_language>

Target:
protected void runImpl() throws IOException, Failure { if (!projectControl.canPerformPackAction(uploadGroup)) { throw new Failure(1, "fatal: upload-pack not permitted on this server"); } final UploadPack up = new UploadPack(repo); if (!projectControl.allRefsAreVisible()) { up.setRefFilter(new VisibleRefFilter(repo, projectControl, db.get())); } up.setTimeout(config.getTimeout()); try { up.upload(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } }
Source:
<code><START> private void putBlob(MessageInfo messageInfo, ByteBuffer messageBuf, long size) throws Exception { <END> boolean performUpload = messageInfo.getExpirationTimeInMs() == Utils.Infinite_Time && !messageInfo.isDeleted(); if (performUpload) { BlobId blobId = (BlobId) messageInfo.getStoreKey(); cloudDestination.uploadBlob(blobId, size, new ByteBufferInputStream(messageBuf)); } }</code><technical_language>this is a bit weird. this function in class it</technical_language>

Target:
private void putBlob(MessageInfo messageInfo, ByteBuffer messageBuf, long size) throws CloudStorageException { boolean performUpload = messageInfo.getExpirationTimeInMs() == Utils.Infinite_Time && !messageInfo.isDeleted(); if (performUpload) { BlobId blobId = (BlobId) messageInfo.getStoreKey(); cloudDestination.uploadBlob(blobId, size, new ByteBufferInputStream(messageBuf)); } }
Source:
<code>public void start() { final KeyStore rootca = getParams().getRootca(); if (rootca == null) { try { createNewRootCa(); } catch (Exception e) { logger.error("Failed to create new root CA certificate:", e); } return; } try { setRootCa(rootca); } catch (final Exception e) { logger.error("Couldn't initialize Root CA", e); } <START> X509Certificate caCert = getCaCertificate(); <END> if (isCertExpired(caCert)) { warnCertExpired(caCert); } }</code><technical_language>Mixed indentation chars. (There's extra space equals.)</technical_language>

Target:
public void start() { final KeyStore rootca = getParams().getRootca(); if (rootca == null) { try { createNewRootCa(); } catch (Exception e) { logger.error("Failed to create new root CA certificate:", e); } return; } try { setRootCa(rootca); } catch (final Exception e) { logger.error("Couldn't initialize Root CA", e); } if (isCertExpired(getRootCaCertificate())) { warnRooCaCertExpired(); } }
Source:
<code>public Role(@Nonnull String name, @CheckForNull String pattern, @CheckForNull Set <String> permissionIds, @CheckForNull String description) { this(name, Pattern.compile(pattern != null ? pattern : GLOBAL_ROLE_PATTERN), <START> PermissionHelper.fromStrings(permissionIds, true), <END> description); }</code><technical_language>I do is a right fix, impact XML loading I</technical_language>

Target:
public Role(@Nonnull String name, @CheckForNull String pattern, @CheckForNull Set <String> permissionIds, @CheckForNull String description) { this(name, Pattern.compile(pattern != null ? pattern : GLOBAL_ROLE_PATTERN), PermissionHelper.fromStrings(permissionIds, DangerousPermissionHandlingMode.getCurrent() != DangerousPermissionHandlingMode.ENABLED), description); }
Source:
<code>public boolean isEnabled() { IStructuredSelection selection = getSelection(); if (selection.size() != 1) return false; IResource resource = (IResource) getAdapter(selection.getFirstElement(), IResource.class); <START> if (resource == null || resource instanceof IFolder) <END> return false; Repository repository = getRepository(); if (repository == null) return false; return isStaged(repository, resource); }</code><technical_language>user selected a project. this check consider that</technical_language>

Target:
public boolean isEnabled() { IStructuredSelection selection = getSelection(); if (selection.size() != 1) return false; IResource resource = (IResource) getAdapter(selection.getFirstElement(), IResource.class); if (resource == null || !(resource instanceof IFile)) return false; Repository repository = getRepository(); if (repository == null) return false; return isStaged(repository, resource); }
Source:
<code>public QueryRunner<Result<TimeseriesResultValue>> preMergeQueryDecoration(final QueryRunner<Result<TimeseriesResultValue>> runner) { return intervalChunkingQueryRunnerDecorator.decorate( (queryPlus, responseContext) -> { TimeseriesQuery timeseriesQuery = (TimeseriesQuery) queryPlus.getQuery(); if (timeseriesQuery.getDimensionsFilter() != null) { timeseriesQuery = timeseriesQuery.withDimFilter(timeseriesQuery.getDimensionsFilter().optimize()); queryPlus = queryPlus.withQuery(timeseriesQuery); } <START> if (timeseriesQuery.getLimit() < Integer.MAX_VALUE) { <END> timeseriesQuery = timeseriesQuery.withLimit(timeseriesQuery.getLimit()); queryPlus = queryPlus.withQuery(timeseriesQuery); } return runner.run(queryPlus, responseContext); }, this); }</code><technical_language>I this block of code is anything? is re-creating timeseriesQuery limit has</technical_language>

Target:
public QueryRunner<Result<TimeseriesResultValue>> preMergeQueryDecoration(final QueryRunner<Result<TimeseriesResultValue>> runner) { return intervalChunkingQueryRunnerDecorator.decorate( (queryPlus, responseContext) -> { TimeseriesQuery timeseriesQuery = (TimeseriesQuery) queryPlus.getQuery(); if (timeseriesQuery.getDimensionsFilter() != null) { timeseriesQuery = timeseriesQuery.withDimFilter(timeseriesQuery.getDimensionsFilter().optimize()); queryPlus = queryPlus.withQuery(timeseriesQuery); } return runner.run(queryPlus, responseContext); }, this); }
Source:
<code>public static int run(final AppBase app, final String[] testClasses, final String... args) { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); DateTimeZone.setDefault(DateTimeZone.UTC); final CmdLineParser p = new CmdLineParser(app); try { p.parseArgument(args); LOGGER.info("Start"); final int retval = app.runTests(testClasses); LOGGER.info("End. Retval = {}", retval); return retval; } catch (final CmdLineException e) { <START> LOGGER.error(e.getMessage()); <END> LOGGER.error("java -jar <...>.jar [opts] ..."); p.printUsage(System.err); return -1; } }</code><technical_language>This result in a Critical SonarQube. resolve this, use: LOGGER.error("your custom message", e);</technical_language>

Target:
public static int run(final AppBase app, final String[] testClasses, final String... args) { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); DateTimeZone.setDefault(DateTimeZone.UTC); final CmdLineParser p = new CmdLineParser(app); try { p.parseArgument(args); LOGGER.info("Start"); final int retval = app.runTests(testClasses); LOGGER.info("End. Retval = {}", retval); return retval; } catch (final CmdLineException e) { LOGGER.error("Incorrect usage", e); LOGGER.error("java -jar <...>.jar [opts] ..."); p.printUsage(System.err); return -1; } }
Source:
<code>private void updateInsertedRowsColumn(int insertedRows, RowMap startBootstrapRow, BinlogPosition position, Connection connection) throws SQLException, NoSuchElementException { long now = System.currentTimeMillis(); if ( now - lastInsertedRowsUpdateTimeMillis > INSERTED_ROWS_UPDATE_PERIOD_MILLIS ) { long rowId = ( long ) startBootstrapRow.getData("id"); String sql = "update `bootstrap` set inserted_rows = ?, binlog_file = ?, binlog_position = ? where id = ?"; <START> connection.setCatalog(this.context.getConfig().databaseName); <END> PreparedStatement preparedStatement = connection.prepareStatement(sql); preparedStatement.setInt(1, insertedRows); preparedStatement.setString(2, position.getFile()); preparedStatement.setLong(3, position.getOffset()); preparedStatement.setLong(4, rowId); if ( preparedStatement.executeUpdate() == 0 ) { throw new NoSuchElementException(); } lastInsertedRowsUpdateTimeMillis = now; } }</code><technical_language>hmmm, profilerate setCatalog calls out -- do a setCatalog connection once, check out of pool... missing</technical_language>

Target:
private void updateInsertedRowsColumn(int insertedRows, RowMap startBootstrapRow, BinlogPosition position, Connection connection) throws SQLException, NoSuchElementException { long now = System.currentTimeMillis(); if ( now - lastInsertedRowsUpdateTimeMillis > INSERTED_ROWS_UPDATE_PERIOD_MILLIS ) { long rowId = ( long ) startBootstrapRow.getData("id"); String sql = "update `bootstrap` set inserted_rows = ?, binlog_file = ?, binlog_position = ? where id = ?"; PreparedStatement preparedStatement = connection.prepareStatement(sql); preparedStatement.setInt(1, insertedRows); preparedStatement.setString(2, position.getFile()); preparedStatement.setLong(3, position.getOffset()); preparedStatement.setLong(4, rowId); if ( preparedStatement.executeUpdate() == 0 ) { throw new NoSuchElementException(); } lastInsertedRowsUpdateTimeMillis = now; } }
Source:
<code>protected HealthCheckRegistry getHealthCheckRegistry() { HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry(); LightblueFactory factory = RestConfiguration.getFactory(); CRUDController[] crudControllers = null; try { crudControllers = factory.getFactory().getCRUDControllers(); } catch (Exception e) { <START> } <END> if (crudControllers != null) { for (CRUDController crudController : crudControllers) { healthCheckRegistry.register(crudController.getClass().getName(), new ControllerHealthCheck(crudController)); } } healthCheckRegistry.register("ldap-auth-healthcheck", new RolesProviderHealthCheck(CertLdapLoginModule.getRolesProvider())); return healthCheckRegistry; }</code><technical_language>log a warn error if this happens, fail</technical_language>

Target:
protected HealthCheckRegistry getHealthCheckRegistry() { HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry(); LightblueFactory factory = RestConfiguration.getFactory(); CRUDController[] crudControllers = null; try { crudControllers = factory.getFactory().getCRUDControllers(); } catch (Exception e) { LOGGER.error("Could not fetch CRUD Controllers from Lightblue Factory. Reason: " + e.getMessage()); } if (crudControllers != null) { for (CRUDController crudController : crudControllers) { healthCheckRegistry.register(crudController.getClass().getSimpleName(), new ControllerHealthCheck(crudController)); } } healthCheckRegistry.register("ldap-auth-healthcheck", new RolesProviderHealthCheck(CertLdapLoginModule.getRolesProvider())); return healthCheckRegistry; }
Source:
<code>public void bulkUpsert(List<Entry> entries) { try (RestClient restClient = RestClient.builder(new HttpHost(ElasticManager.hostname, ElasticManager.port, "http")).build()) { String newlineDJSON = getNDJSON(entries); HttpEntity bulkEntity = new NStringEntity(newlineDJSON, ContentType.APPLICATION_JSON); org.elasticsearch.client.Response post = restClient.performRequest("POST", "/entry/_bulk", Collections.emptyMap(), bulkEntity); if (post.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { <START> throw new CustomWebApplicationException("Could not submit index to elastic search", HttpStatus.SC_INTERNAL_SERVER_ERROR); <END> } } catch (IOException e) { throw new CustomWebApplicationException(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } }</code><technical_language>this return a 500 if elastic search is available? I strategy for tool refresh kill refresh if elastic search available</technical_language>

Target:
public void bulkUpsert(List<Entry> entries) { try (RestClient restClient = RestClient.builder(new HttpHost(ElasticManager.hostname, ElasticManager.port, "http")).build()) { String newlineDJSON = getNDJSON(entries); HttpEntity bulkEntity = new NStringEntity(newlineDJSON, ContentType.APPLICATION_JSON); org.elasticsearch.client.Response post = restClient.performRequest("POST", "/entry/_bulk", Collections.emptyMap(), bulkEntity); if (post.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new CustomWebApplicationException("Could not submit index to elastic search", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } catch (IOException e) { LOGGER.error("Could not submit index to elastic search. " + e.getMessage()); } }
Source:
<code>public void verify_count_of_added_components() { ComponentContainer container = new ComponentContainer(); new CeWsModule().configure(container); <START> assertThat(container.size()).isEqualTo(12 + 2 ); <END> }</code><technical_language>FYI, 2 replaced ComponentContainer.COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER</technical_language>

Target:
public void verify_count_of_added_components() { ComponentContainer container = new ComponentContainer(); new CeWsModule().configure(container); assertThat(container.size()).isEqualTo(12 + COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER); }
Source:
<code>private void takeSnapshotSync( <START> Map<OperatorID, OperatorSnapshotFutures> operatorSnapshotsInProgress, CheckpointMetaData checkpointMetaData, <END> CheckpointMetrics checkpointMetrics, CheckpointOptions checkpointOptions, OperatorChain<?, ?> operatorChain, Supplier<Boolean> isCanceled) throws Exception { long checkpointId = checkpointMetaData.getCheckpointId(); long started = System.nanoTime(); ChannelStateWriteResult channelStateWriteResult = checkpointOptions.getCheckpointType() == CHECKPOINT ? channelStateWriter.getWriteResult(checkpointId) : ChannelStateWriteResult.EMPTY; CheckpointStreamFactory storage = checkpointStorage.resolveCheckpointStorageLocation(checkpointId, checkpointOptions.getTargetLocation()); for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) { operatorSnapshotsInProgress.put( operatorWrapper.getStreamOperator().getOperatorID(), buildOperatorSnapshotFutures( checkpointMetaData, checkpointOptions, operatorChain, operatorWrapper.getStreamOperator(), isCanceled, channelStateWriteResult, storage)); } checkpointStorage.clearCacheFor(checkpointId); LOG.debug( "{} - finished synchronous part of checkpoint {}. Alignment duration: ms, snapshot duration ms", taskName, checkpointId, checkpointMetrics.getAlignmentDurationNanos() / 1_000_000, checkpointMetrics.getSyncDurationMillis()); checkpointMetrics.setSyncDurationMillis((System.nanoTime() - started) / 1_000_000); }</code><technical_language>is suggested putting multiple arguments in line. split line for argument</technical_language>

Target:
private void takeSnapshotSync( Map<OperatorID, OperatorSnapshotFutures> operatorSnapshotsInProgress, CheckpointMetaData checkpointMetaData, CheckpointMetrics checkpointMetrics, CheckpointOptions checkpointOptions, OperatorChain<?, ?> operatorChain, Supplier<Boolean> isCanceled) throws Exception { long checkpointId = checkpointMetaData.getCheckpointId(); long started = System.nanoTime(); ChannelStateWriteResult channelStateWriteResult = checkpointOptions.getCheckpointType() == CHECKPOINT ? channelStateWriter.getWriteResult(checkpointId) : ChannelStateWriteResult.EMPTY; CheckpointStreamFactory storage = checkpointStorage.resolveCheckpointStorageLocation(checkpointId, checkpointOptions.getTargetLocation()); try { for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) { operatorSnapshotsInProgress.put( operatorWrapper.getStreamOperator().getOperatorID(), buildOperatorSnapshotFutures( checkpointMetaData, checkpointOptions, operatorChain, operatorWrapper.getStreamOperator(), isCanceled, channelStateWriteResult, storage)); } } finally { checkpointStorage.clearCacheFor(checkpointId); } LOG.debug( "{} - finished synchronous part of checkpoint {}. Alignment duration: ms, snapshot duration ms", taskName, checkpointId, checkpointMetrics.getAlignmentDurationNanos() / 1_000_000, checkpointMetrics.getSyncDurationMillis()); checkpointMetrics.setSyncDurationMillis((System.nanoTime() - started) / 1_000_000); }