auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object getPayload(CorfuRuntime runtime) { Object value = payload.get(); if (value == null) { synchronized (this.payload) { value = this.payload.get(); if (value == null) { if (data == null) { this.payload.set(null); } else { ByteBuf copyBuf = Unpooled.wrappedBuffer(data); if (hasPayloadCodec()) { <START> ByteBuf temp = ICorfuPayload.fromBuffer(data, ByteBuf.class); byte[] temp2 = new byte[temp.readableBytes()]; temp.readBytes(temp2); copyBuf = Unpooled.wrappedBuffer(getPayloadCodecType() <END> .getInstance().decompress(ByteBuffer.wrap(temp2))); } final Object actualValue; try { actualValue = Serializers.CORFU.deserialize(copyBuf, runtime); } catch (Throwable throwable) { log.error("Exception caught at address {}, {}, {}", getGlobalAddress(), getStreams(), getType()); log.error("Raw data buffer {}", copyBuf.resetReaderIndex().toString(Charset.defaultCharset())); copyBuf.release(); data = null; throw throwable; } if (actualValue instanceof LogEntry) { ((LogEntry) actualValue).setGlobalAddress(getGlobalAddress()); ((LogEntry) actualValue).setRuntime(runtime); } value = actualValue == null ? this.payload : actualValue; this.payload.set(value); copyBuf.release(); lastKnownSize = data.length; data = null; } } } } return value; }</code><technical_language>names compressedBuf, compressed uncompressed, instead of temp, temp2 copyBuf more readable</technical_language>

Target:
public Object getPayload(CorfuRuntime runtime) { Object value = payload.get(); if (value == null) { synchronized (this.payload) { value = this.payload.get(); if (value == null) { if (data == null) { this.payload.set(null); } else { ByteBuf serializedBuf = Unpooled.wrappedBuffer(data); if (hasPayloadCodec()) { ByteBuf compressedBuf = ICorfuPayload.fromBuffer(data, ByteBuf.class); byte[] compressedArrayBuf= new byte[compressedBuf.readableBytes()]; compressedBuf.readBytes(compressedArrayBuf); serializedBuf = Unpooled.wrappedBuffer(getPayloadCodecType() .getInstance().decompress(ByteBuffer.wrap(compressedArrayBuf))); } final Object actualValue; try { actualValue = Serializers.CORFU.deserialize(serializedBuf, runtime); if (actualValue instanceof LogEntry) { ((LogEntry) actualValue).setGlobalAddress(getGlobalAddress()); ((LogEntry) actualValue).setRuntime(runtime); } value = actualValue == null ? this.payload : actualValue; this.payload.set(value); lastKnownSize = data.length; } catch (Throwable throwable) { log.error("Exception caught at address {}, {}, {}", getGlobalAddress(), getStreams(), getType()); log.error("Raw data buffer {}", serializedBuf.resetReaderIndex().toString(Charset.defaultCharset())); throw throwable; } finally { serializedBuf.release(); data = null; } } } } } return value; }
Source:
<code>private void setupKeyEvents() { inputField.textProperty().addListener((observable, oldValue, newValue) -> { handleUpdatedInput(newValue); }); this. inputField.setOnKeyPressed(e -> { if (e.getCode() == KeyCode.DOWN) { e.consume(); state.selectNextBestMatchingMilestone(); refreshUI(state); } <START> if (e.getCode() == KeyCode.UP) { <END> e.consume(); state.selectPreviousBestMatchingMilestone(); refreshUI(state); } }); }</code><technical_language>else if? switch</technical_language>

Target:
private void setupKeyEvents() { inputField.textProperty().addListener((observable, oldValue, newValue) -> { handleUpdatedInput(newValue); }); inputField.setOnKeyPressed(e -> { switch (e.getCode()) { case DOWN: state.selectNextBestMatchingMilestone(); refreshUI(state); e.consume(); break; case UP: state.selectPreviousBestMatchingMilestone(); refreshUI(state); e.consume(); break; default: break; } }); }
Source:
<code>public boolean visit(FunctionInvocation node) { if ((searchKind & IIndexConstants.METHOD_PATTERN) == 0) { return true; } MethodPattern methodPattern = (MethodPattern) pattern; if (!methodPattern.findReferences) { return true; } String name, superName = null; if (node.getName() != null) { name = node.getName().getIdentifier(); } else if <START> (node.getExpression().getNodeType() <END> == ASTNode.FIELD_ACCESS) { FieldAccess fieldAccess = (FieldAccess) node.getExpression(); name = fieldAccess.getName().getIdentifier(); if (fieldAccess.getExpression() != null && fieldAccess.getExpression().getNodeType() == ASTNode.SIMPLE_NAME) { superName = ((SimpleName) fieldAccess.getExpression()).getIdentifier(); } } else { return true; } char[] nodeName = name.toCharArray(); char[] nodeSuper; if (superName != null) { nodeSuper = superName.toCharArray(); } else { nodeSuper = contextNames.isEmpty() ? new char[0] : contextNames.peek(); } char[] patternName = methodPattern.selector; char[] patternSuper = methodPattern.getDeclaringSimpleName(); if (patternSuper != null && !CharOperation.equals(nodeSuper, patternSuper, false)) { return true; } if (matchesName(patternName, nodeName)) { IJavaScriptElement enclosingElement = getEnclosingElement(node); MethodReferenceMatch match = new MethodReferenceMatch( enclosingElement, SearchMatch.A_ACCURATE, node.getStartPosition(), node.getLength(), false, false, false, participant, rootJSUnit.getResource()); matches.add(match); } return true; }</code><technical_language>A check for null is required expression is optional null</technical_language>

Target:
public boolean visit(FunctionInvocation node) { anonymousNameAvailable = false; if ((searchKind & IIndexConstants.METHOD_PATTERN) == 0) { return true; } MethodPattern methodPattern = (MethodPattern) pattern; if (!methodPattern.findReferences) { return true; } String name, superName = null; if (node.getName() != null) { name = node.getName().getIdentifier(); } else if (node.getExpression() != null && node.getExpression().getNodeType() == ASTNode.FIELD_ACCESS) { FieldAccess fieldAccess = (FieldAccess) node.getExpression(); name = fieldAccess.getName().getIdentifier(); if (fieldAccess.getExpression() != null && fieldAccess.getExpression().getNodeType() == ASTNode.SIMPLE_NAME) { superName = ((SimpleName) fieldAccess.getExpression()).getIdentifier(); } } else { return true; } char[] nodeName = name.toCharArray(); char[] nodeSuper; if (superName != null) { nodeSuper = superName.toCharArray(); } else { nodeSuper = contextNames.isEmpty() ? new char[0] : contextNames.peek(); } char[] patternName = methodPattern.selector; char[] patternSuper = methodPattern.getDeclaringSimpleName(); if (patternSuper != null && !CharOperation.equals(nodeSuper, patternSuper, false)) { return true; } if (matchesName(patternName, nodeName)) { IJavaScriptElement enclosingElement = getEnclosingElement(node); MethodReferenceMatch match = new MethodReferenceMatch( enclosingElement, SearchMatch.A_ACCURATE, node.getStartPosition(), node.getLength(), false, false, false, participant, rootJSUnit.getResource()); matches.add(match); } return true; }
Source:
<code>protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final String sid = webSession.get().getToken(); final String username = webSession.get().getCurrentUser().getUserName(); final String what = "sign out"; <START> AuditEvent record = null; <END> final long when = System.currentTimeMillis(); try { doLogout(req, rsp); } finally { record = new AuditEvent(sid, username, what, when, null, "{\"Success\":true}"); audit.dispatch(record); } }</code><technical_language>this local is scoped finally block. declare finally block</technical_language>

Target:
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final String sid = webSession.get().getToken(); final String what = "sign out"; final long when = System.currentTimeMillis(); try { doLogout(req, rsp); } finally { audit.dispatch(new AuditEvent(sid, webSession.get().getCurrentUser(), what, when, null, "{\"Success\":true}")); } }
Source:
<code>public static void main(String[] args) throws Exception { if (args.length < 2) { throw new IllegalArgumentException("The number of arguments is incorrect. Usage:\n" + " <configuration file (conf.xml) path> <job file (.analysis.xml) path> [properties file path]\n" + "Got: " + Arrays.toString(args)); } final SparkConf conf = new SparkConf().setAppName("DataCleaner-spark"); final JavaSparkContext sparkContext = new JavaSparkContext(conf); final String confXmlPath = args[0]; final String analysisJobXmlPath = args[1]; final String propertiesPath; if (args.length > 2) { propertiesPath = args[2]; } else { propertiesPath = null; } final SparkJobContext sparkJobContext = new SparkJobContext(confXmlPath, analysisJobXmlPath, propertiesPath, sparkContext); final SparkAnalysisRunner sparkAnalysisRunner = new SparkAnalysisRunner(sparkContext, sparkJobContext); try { final AnalysisResultFuture result = sparkAnalysisRunner.run(); result.await(); if (sparkJobContext.isResultEnabled()) { final Resource resultResource = ResultFilePathUtils.getResultResource(sparkContext, sparkJobContext); logger.info("DataCleaner result will be written to: {}", resultResource); <START> saveResult(result, resultResource); <END> } else { logger.info("DataCleaner result will not be written - disabled"); } } finally { sparkContext.stop(); } }</code><technical_language>lost fail-fast abilities moving this here</technical_language>

Target:
public static void main(String[] args) throws Exception { if (args.length < 2) { throw new IllegalArgumentException("The number of arguments is incorrect. Usage:\n" + " <configuration file (conf.xml) path> <job file (.analysis.xml) path> [properties file path]\n" + "Got: " + Arrays.toString(args)); } final SparkConf conf = new SparkConf().setAppName("DataCleaner-spark"); final JavaSparkContext sparkContext = new JavaSparkContext(conf); final URI confXmlPath = URI.create(args[0]); final URI analysisJobXmlPath = URI.create(args[1]); final URI propertiesPath; if (args.length > 2) { propertiesPath = URI.create(args[2]); } else { propertiesPath = null; } final SparkJobContext sparkJobContext = new SparkJobContext(confXmlPath, analysisJobXmlPath, propertiesPath, sparkContext); final SparkAnalysisRunner sparkAnalysisRunner = new SparkAnalysisRunner(sparkContext, sparkJobContext); try { final AnalysisResultFuture result = sparkAnalysisRunner.run(); result.await(); if (sparkJobContext.isResultEnabled()) { final Resource resultResource = ResultFilePathUtils.getResultResource(sparkContext, sparkJobContext); logger.info("DataCleaner result will be written to: {}", resultResource); saveResult(result, resultResource); } else { logger.info("DataCleaner result will not be written - disabled"); } } finally { sparkContext.stop(); } }
Source:
<code>private void ensureList() { if (mList != null) { return; } View root = getView(); if (root == null) { throw new IllegalStateException("Content view not yet created"); } View rawList = root.findViewById(android.R.id.list); if (mEmptyView == null) { throw new RuntimeException( "Your content must have a View whose id attribute is 'R.id.empty'"); } if (mProgressContainer == null) { throw new RuntimeException( "Your content must have a View whose id attribute is 'R.id.loading'"); } mProgressContainer.setVisibility(View.GONE); if (rawList == null) { throw new RuntimeException( "Your content must have a ListView whose id attribute is 'R.id.list'"); } <START> if (!(rawList instanceof AdapterView)) { <END> throw new RuntimeException( "Content has view with id attribute 'R.id.list' that is not a AbsListView class"); } mList = (AbsListView) rawList; mListShown = true; mList.setOnItemClickListener(mOnClickListener); mList.setOnScrollListener(mOnScrollListener); if (mAdapter != null) { ListAdapter adapter = mAdapter; mAdapter = null; setListAdapter(adapter); } else { if (mProgressContainer != null) { setListShown(false, false); } } mHandler.post(mRequestFocus); }</code><technical_language>Requires a check for AbsListView now. remove check altogether</technical_language>

Target:
private void ensureList() { if (mList != null) { return; } View root = getView(); if (root == null) { throw new IllegalStateException("Content view not yet created"); } View rawList = root.findViewById(android.R.id.list); if (mEmptyView == null) { throw new RuntimeException( "Your content must have a View whose id attribute is 'R.id.empty'"); } if (mProgressContainer == null) { throw new RuntimeException( "Your content must have a View whose id attribute is 'R.id.loading'"); } mProgressContainer.setVisibility(View.GONE); if (rawList == null) { throw new RuntimeException( "Your content must have a ListView whose id attribute is 'R.id.list'"); } if (!(rawList instanceof AbsListView)) { throw new RuntimeException( "Content has view with id attribute 'R.id.list' that is not a AbsListView class"); } mList = (AbsListView) rawList; mListShown = true; mList.setOnItemClickListener(mOnClickListener); mList.setOnScrollListener(mOnScrollListener); if (mAdapter != null) { ListAdapter adapter = mAdapter; mAdapter = null; setListAdapter(adapter); } else { if (mProgressContainer != null) { setListShown(false, false); } } mHandler.post(mRequestFocus); }
Source:
<code>private String extractStudentRegistrationKey(StudentAttributes student) { String joinLink = Config.getAppUrl(student.getRegistrationUrl()).toAbsoluteString(); <START> int startIndex = joinLink.indexOf("key=") + "key=".length(); <END> return joinLink.substring(startIndex); }</code><technical_language>This changed a constant Const class instead of keeping magic string</technical_language>

Target:
private String extractStudentRegistrationKey(StudentAttributes student) { String joinLink = Config.getAppUrl(student.getRegistrationUrl()).toAbsoluteString(); String keyParam = Const.ParamsNames.REGKEY + "="; int startIndex = joinLink.indexOf(keyParam) + keyParam.length(); return joinLink.substring(startIndex); }
Source:
<code>private Component getComponentWithHistory(ValueResult valueResult, boolean phaseIsEnded, boolean inBanner) { if (getPermission() == PrivacyGroupPermissionEnum.NONE) { return null; } this.phaseIsEnded = phaseIsEnded; final boolean enabled = userCanPerformChangeType(ValueEventChangeType.EDIT); Component component = inBanner ? getComponentInBanner(valueResult) : getComponent(valueResult, enabled); if(getAmendable() && component instanceof Field) { final Field<?> field = (Field<?>)component; field.setFieldLabel(field.getFieldLabel() + "&nbsp;" + IconImageBundle.ICONS.DNABrownGreen().getHTML()); } if (isHistorable() && !(this instanceof BudgetElementDTO)) { if(inBanner || !(component instanceof Field)) { createHistoryMenu(component); } else { final HistoryWrapper wrapper = new HistoryWrapper((Field<?>)component); wrapper.getHistoryButton().addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { loadAndShowHistory(wrapper.getHistoryButton()); } }); <START> if (ElementTypeEnum.CONTACT_LIST == this.getElementType() && Profiler.INSTANCE.getApplicationStateManager().getLastState() == ApplicationState.OFFLINE) { <END> wrapper.getHistoryButton().setVisible(false); } component = wrapper; } } return component; }</code><technical_language>This piece of code java Profiler.INSTANCE.getApplicationStateManager().getLastState() == ApplicationState.OFFLINE is copy-pasted (sometimes in a method, not). factorize in a single method in Profiler.INSTANCE in ApplicationStateManager? I guess for is flag ApplicationStateManager#online</technical_language>

Target:
private Component getComponentWithHistory(ValueResult valueResult, boolean phaseIsEnded, boolean inBanner) { if (getPermission() == PrivacyGroupPermissionEnum.NONE) { return null; } this.phaseIsEnded = phaseIsEnded; final boolean enabled = userCanPerformChangeType(ValueEventChangeType.EDIT); Component component = inBanner ? getComponentInBanner(valueResult) : getComponent(valueResult, enabled); if(getAmendable() && component instanceof Field) { final Field<?> field = (Field<?>)component; field.setFieldLabel(field.getFieldLabel() + "&nbsp;" + IconImageBundle.ICONS.DNABrownGreen().getHTML()); } if (isHistorable() && !(this instanceof BudgetElementDTO)) { if(inBanner || !(component instanceof Field)) { createHistoryMenu(component); } else { final HistoryWrapper wrapper = new HistoryWrapper((Field<?>)component); wrapper.getHistoryButton().addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { loadAndShowHistory(wrapper.getHistoryButton()); } }); if (ElementTypeEnum.CONTACT_LIST == this.getElementType() && Profiler.INSTANCE.isOfflineMode()) { wrapper.getHistoryButton().setVisible(false); } component = wrapper; } } return component; }
Source:
<code>public static Map<String, String> getKiePMMLScorecardModelSourcesMap(final DataDictionary dataDictionary, final Scorecard model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final String packageName) { logger.trace("getKiePMMLScorecardModelSourcesMap {}", dataDictionary, model, packageName); CompilationUnit cloneCU = getKiePMMLModelCompilationUnit(dataDictionary, model, fieldTypeMap, packageName, KIE_PMML_SCORECARD_MODEL_TEMPLATE_JAVA, KIE_PMML_SCORECARD_MODEL_TEMPLATE); String className = getSanitizedClassName(model.getModelName()); ClassOrInterfaceDeclaration modelTemplate = cloneCU.getClassByName(className) <START> .orElseThrow(() -> new KiePMMLException(MAIN_CLASS_NOT_FOUND)); <END> final ConstructorDeclaration constructorDeclaration = modelTemplate.getDefaultConstructor().orElseThrow(() -> new KiePMMLInternalException(String.format("Missing default constructor in ClassOrInterfaceDeclaration %s ", modelTemplate.getName()))); setSuperInvocation(model, constructorDeclaration, modelTemplate.getName()); Map<String, String> toReturn = new HashMap<>(); String fullClassName = packageName + "." + className; toReturn.put(fullClassName, cloneCU.toString()); return toReturn; }</code><technical_language>please add className error message</technical_language>

Target:
public static Map<String, String> getKiePMMLScorecardModelSourcesMap(final DataDictionary dataDictionary, final Scorecard model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final String packageName) { logger.trace("getKiePMMLScorecardModelSourcesMap {}", dataDictionary, model, packageName); CompilationUnit cloneCU = getKiePMMLModelCompilationUnit(dataDictionary, model, fieldTypeMap, packageName, KIE_PMML_SCORECARD_MODEL_TEMPLATE_JAVA, KIE_PMML_SCORECARD_MODEL_TEMPLATE); String className = getSanitizedClassName(model.getModelName()); ClassOrInterfaceDeclaration modelTemplate = cloneCU.getClassByName(className) .orElseThrow(() -> new KiePMMLException(MAIN_CLASS_NOT_FOUND + ": " + className)); final ConstructorDeclaration constructorDeclaration = modelTemplate.getDefaultConstructor().orElseThrow(() -> new KiePMMLInternalException(String.format("Missing default constructor in ClassOrInterfaceDeclaration %s ", modelTemplate.getName()))); setSuperInvocation(model, constructorDeclaration, modelTemplate.getName()); Map<String, String> toReturn = new HashMap<>(); String fullClassName = packageName + "." + className; toReturn.put(fullClassName, cloneCU.toString()); return toReturn; }
Source:
<code>public static PMMLConstants byName(String name) { <START> return Arrays.stream(PMMLConstants.values()).filter(value -> Objects.equals(name, value.name)).findFirst().orElseThrow(() -> new RuntimeException("Failed to find PMMLConstants with name: " + name)); <END> }</code><technical_language>split this stream multiple lambdas</technical_language>

Target:
public static PMMLConstants byName(String name) { return Arrays.stream(PMMLConstants.values()) .filter(getFilterPredicate(name)) .findFirst() .orElseThrow(getRuntimeExceptionSupplier(name)); }
Source:
<code>private synchronized void asyncAuth(int cmd, Buffer buffer, boolean authed) { <START> try { <END> if (authed) { handleAuthenticationSuccess(cmd, buffer); } else { handleAuthenticationFailure(cmd, buffer); } } catch (Exception e) { log.warn("Error performing async authentication: {}", e.getMessage(), e); } }</code><technical_language>_protected_ allow users override if want</technical_language>

Target:
protected synchronized void asyncAuth(int cmd, Buffer buffer, boolean authed) { try { if (authed) { handleAuthenticationSuccess(cmd, buffer); } else { handleAuthenticationFailure(cmd, buffer); } } catch (Exception e) { log.warn("Error performing async authentication: {}", e.getMessage(), e); } }
Source:
<code>public Cluster get() { <START> Clusters clusters = parent.list(); <END> for (Cluster cluster : clusters.getClusters()) { if (cluster.getId().equals(guid.toString())) { return cluster; } } return notFound(); }</code><technical_language>this call is efficient map N clusters in list() while (potentially) answer cluster.getId().equals(guid.toString()) condition (or none), instead please implement public method in parent VdcQueryType.GetVdsGroupsByStoragePoolId reuse in parent this class</technical_language>

Target:
public Cluster get() { Cluster cluster = parent.getClusterById(id); if (cluster == null) { return notFound(); } return cluster; }
Source:
<code>public void before() { Whitebox.setInternalState(lawJournalEntry, "id", 114); lawJournalEntry.setYear(2011); <START> lawJournalEntry.setEntry(11); <END> lawJournalEntry.setEntry(1); lawJournalEntry.setTitle("Title title"); when(lawJournalEntryRepository.findOneByYearAndEntry(Mockito.eq(lawJournalEntry.getYear()), Mockito.eq(lawJournalEntry.getEntry()))).thenReturn(lawJournalEntry); lawJournalEntryCreator.setLawJournalEntryRepository(lawJournalEntryRepository); }</code><technical_language>setJournalNo</technical_language>

Target:
public void before() { Whitebox.setInternalState(lawJournalEntry, "id", 114); lawJournalEntry.setYear(2011); lawJournalEntry.setJournalNo(11); lawJournalEntry.setEntry(1); lawJournalEntry.setTitle("Title title"); when(lawJournalEntryRepository.findOneByYearAndEntry(Mockito.eq(lawJournalEntry.getYear()), Mockito.eq(lawJournalEntry.getEntry()))).thenReturn(lawJournalEntry); lawJournalEntryCreator.setLawJournalEntryRepository(lawJournalEntryRepository); }
Source:
<code>public KeyboardShortcutsApi produce() { if (WindowRef.isEnvelopeAvailable()) { return new KeyboardShortcutsService(); } <START> DomGlobal.console.info("[KeyboardShortcutsServiceProducer] Envelope API is not available. Producing NoOpKeyboardShortcutsService"); <END> return new NoOpKeyboardShortcutsService(); }</code><technical_language>this warning/error info? thoughts channels in kogito envelope. some of envelope? is small subparts/panels/components of editor registered shortcuts common envelope is present</technical_language>

Target:
public KeyboardShortcutsApi produce() { if (WindowRef.isEnvelopeAvailable()) { return new KeyboardShortcutsService(); } DomGlobal.console.debug("[KeyboardShortcutsServiceProducer] Envelope API is not available. Producing NoOpKeyboardShortcutsService"); return new NoOpKeyboardShortcutsService(); }
Source:
<code>OnkyoConnection getConnection() { if (connection == null) { <START> if (serialPortName!=null) <END> connection = new OnkyoConnection(serialPortName); else connection = new OnkyoConnection(host, port); } return connection; }</code><technical_language>curly braces, for one-line statements</technical_language>

Target:
OnkyoConnection getConnection() { if (connection == null) { if (serialPortName != null) { connection = new OnkyoConnection(serialPortName); } else { connection = new OnkyoConnection(host, port); } } return connection; }
Source:
<code>public long length() throws IOException { <START> String response = executeCommand("SIZE\r\n"); <END> long currAvailSize = Long.parseLong(response.substring(0, response.indexOf(' '))); currTotalSize = Long.parseLong(response.substring(response.indexOf(' ') + 1)); maxRemoteSize = Math.max(maxRemoteSize, currAvailSize); if (currAvailSize != currTotalSize) { activeFile = true; } return maxRemoteSize; }</code><technical_language>optimize this if time send SIZE, get for both, need call remote command again. a file non-active...it active again</technical_language>

Target:
public long length() throws IOException { if (maxRemoteSize == 0 || activeFile) { return reallyGetLength(); } return maxRemoteSize; }
Source:
<code>public Map<Field, List<GraphQLDirective>> getImmediateDirectivesByField() { computeValuesLazily(); <START> return new LinkedHashMap<>(fieldDirectivesMap); <END> }</code><technical_language>lets return unmodifiableMap</technical_language>

Target:
public Map<Field, List<GraphQLDirective>> getImmediateDirectivesByField() { computeValuesLazily(); return fieldDirectivesByField; }
Source:
<code>public static InspectorModulesProvider defaultInspectorModulesProvider(final Context context) { return new InspectorModulesProvider() { @Override public Iterable<ChromeDevtoolsDomain> get() { ArrayList<ChromeDevtoolsDomain> modules = new ArrayList<ChromeDevtoolsDomain>(); modules.add(new Console()); modules.add(new CSS()); modules.add(new Debugger()); <START> modules.add(new DOM(new DOMProvider.Factory() { <END> @Override public DOMProvider create() { return new AndroidDOMProvider((Application)context.getApplicationContext()); } })); modules.add(new DOMStorage()); modules.add(new HeapProfiler()); modules.add(new Inspector()); modules.add(new Network(context)); modules.add(new Page(context)); modules.add(new Profiler()); modules.add(new Runtime()); modules.add(new Worker()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { modules.add(new Database(context)); } return modules; } }; }</code><technical_language>This code continue read one-liners. intended extensibility point terse. Prefer: java modules.add(new DOM(new AndroidDOMProviderFactory()));</technical_language>

Target:
public static InspectorModulesProvider defaultInspectorModulesProvider(final Context context) { return new InspectorModulesProvider() { @Override public Iterable<ChromeDevtoolsDomain> get() { ArrayList<ChromeDevtoolsDomain> modules = new ArrayList<ChromeDevtoolsDomain>(); modules.add(new Console()); modules.add(new CSS()); modules.add(new Debugger()); modules.add(new DOM(new AndroidDOMProviderFactory((Application)context.getApplicationContext()))); modules.add(new DOMStorage()); modules.add(new HeapProfiler()); modules.add(new Inspector()); modules.add(new Network(context)); modules.add(new Page(context)); modules.add(new Profiler()); modules.add(new Runtime()); modules.add(new Worker()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { modules.add(new Database(context)); } return modules; } }; }
Source:
<code>public void testDeleteIdempotency() throws Exception { org.junit.Assume.assumeTrue(DEFAULT_DELETE_CONSIDERED_IDEMPOTENT); AbfsConfiguration abfsConfig = getConfiguration(); abfsConfig.setMaxIoRetries(reducedRetryCount); abfsConfig.setMaxBackoffIntervalMilliseconds(reducedMaxBackoffIntervalMs); final AzureBlobFileSystem fs = getFileSystem(); AbfsClient abfsClient = fs.getAbfsStore().getClient(); AbfsPerfTracker tracker = new AbfsPerfTracker("test", this.getAccountName(), abfsConfig); AbfsClient testClient = new AbfsClient( abfsClient.getBaseUrl(), new SharedKeyCredentials(abfsConfig.getAccountName().substring(0, abfsConfig.getAccountName().indexOf(DOT)), abfsConfig.getStorageAccountKey()), abfsConfig, new ExponentialRetryPolicy(reducedRetryCount), abfsConfig.getTokenProvider(), tracker); AbfsRestOperation op = mock(AbfsRestOperation.class); when(op.getRetryCount()).thenReturn(reducedRetryCount); AbfsHttpOperation http404Op = mock(AbfsHttpOperation.class); when(http404Op.getStatusCode()).thenReturn(HTTP_NOT_FOUND); when(op.getResult()).thenReturn(http404Op); <START> assertTrue( <END> "Delete is considered idempotent by default and should return success.", (testClient.deleteIdempotencyCheckOp(op) .getResult() .getStatusCode() == HTTP_OK)); }</code><technical_language>Try alternative assertJ</technical_language>

Target:
public void testDeleteIdempotency() throws Exception { Assume.assumeTrue(DEFAULT_DELETE_CONSIDERED_IDEMPOTENT); AbfsConfiguration abfsConfig = TestAbfsConfigurationFieldsValidation.updateRetryConfigs( getConfiguration(), REDUCED_RETRY_COUNT, REDUCED_MAX_BACKOFF_INTERVALS_MS); final AzureBlobFileSystem fs = getFileSystem(); AbfsClient abfsClient = fs.getAbfsStore().getClient(); AbfsClient testClient = TestAbfsClient.createTestClientFromCurrentContext( abfsClient, abfsConfig); AbfsRestOperation op = mock(AbfsRestOperation.class); when(op.isARetriedRequest()).thenReturn(true); AbfsHttpOperation http404Op = mock(AbfsHttpOperation.class); when(http404Op.getStatusCode()).thenReturn(HTTP_NOT_FOUND); when(op.getResult()).thenReturn(http404Op); Assertions.assertThat(testClient.deleteIdempotencyCheckOp(op) .getResult() .getStatusCode()) .describedAs( "Delete is considered idempotent by default and should return success.") .isEqualTo(HTTP_OK); }
Source:
<code>public SnapshotStatus[] getSnapshotListing(Path snapshotRoot) throws IOException { <START> return dfs.getSnapshotListing(getPathName(snapshotRoot)); <END> }</code><technical_language>* relative path resolved well? Path absF = fixRelativePart(path); * Increment Read Statistics well. statistics.incrementReadOps(1);</technical_language>

Target:
public SnapshotStatus[] getSnapshotListing(Path snapshotRoot) throws IOException { Path absF = fixRelativePart(snapshotRoot); statistics.incrementReadOps(1); storageStatistics .incrementOpCounter(OpType.GET_SNAPSHOT_LIST); return dfs.getSnapshotListing(getPathName(absF)); }
Source:
<code>protected boolean shouldProcessSAELineToPDP(ConcurStandardAccountingExtractDetailLine line) { boolean isCashLine = StringUtils.equalsIgnoreCase(line.getPaymentCode(), ConcurConstants.PAYMENT_CODE_CASH); <START> boolean isPersonalExpeseChargedToCorporateCard = getConcurBatchUtilityService().lineRepresentsPersonalExpenseChargedToCorporateCard(line); <END> boolean isCreditLine = StringUtils.equalsIgnoreCase(line.getJounalDebitCredit(), ConcurConstants.CREDIT); return isCashLine || (isPersonalExpeseChargedToCorporateCard && isCreditLine); }</code><technical_language>Minor typo in variable name</technical_language>

Target:
protected boolean shouldProcessSAELineToPDP(ConcurStandardAccountingExtractDetailLine line) { boolean isCashLine = StringUtils.equalsIgnoreCase(line.getPaymentCode(), ConcurConstants.PAYMENT_CODE_CASH); boolean isPersonalExpenseChargedToCorporateCard = getConcurBatchUtilityService().lineRepresentsPersonalExpenseChargedToCorporateCard(line); boolean isCreditLine = StringUtils.equalsIgnoreCase(line.getJounalDebitCredit(), ConcurConstants.CREDIT); return isCashLine || (isPersonalExpenseChargedToCorporateCard && isCreditLine); }
Source:
<code>public void testDisabledOutputPaging() throws Exception { setupConsole(false); <START> consoleWriter.println("/:read-resource"); <END> Assert.assertFalse(consoleWriter.checkError()); String window = queue.poll(15, TimeUnit.SECONDS); Assert.assertNotNull(window); checkWithRegex(window, promptPattern); Assert.assertTrue(Pattern.compile("^\\{.*^\\}", Pattern.MULTILINE | Pattern.DOTALL) .matcher(window).find()); }</code><technical_language>elytron resource homogenous other testcase</technical_language>

Target:
private void testDisabledOutputPaging() throws Exception { consoleWriter.println("/subsystem=elytron:read-resource-description(recursive=true)"); Assert.assertFalse(consoleWriter.checkError()); String window = queue.poll(10, TimeUnit.SECONDS); Assert.assertNotNull(window); checkWithRegex(window, promptPattern); Assert.assertTrue(Pattern.compile("^\\{.*^\\}", Pattern.MULTILINE | Pattern.DOTALL) .matcher(window).find()); }
Source:
<code>public void move() { spriteBase.move(); Double newX = spriteBase.getX() + spriteBase.getDx(); Double newY = spriteBase.getY() + spriteBase.getDy(); if (!newX.equals(spriteBase.getX()) || !newY.equals(spriteBase.getY())) { Logger.log(String.format("Monster moved from (%f, %f) to (%f, %f)", spriteBase.getX(), spriteBase.getY(), newX, newY)); } <START> this.setChanged(); <END> this.notifyObservers(); }</code><technical_language>This in AnimationTimer removed. <organisation</technical_language>

Target:
public void move() { spriteBase.move(); Double newX = spriteBase.getX() + spriteBase.getDx(); Double newY = spriteBase.getY() + spriteBase.getDy(); if (!newX.equals(spriteBase.getX()) || !newY.equals(spriteBase.getY())) { Logger.log(String.format("Monster moved from (%f, %f) to (%f, %f)", spriteBase.getX(), spriteBase.getY(), newX, newY)); } }
Source:
<code>private TableMetadataPersistence.SweepStrategy getStrategyFromKvs(TableReference tableRef) { <START> return TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(kvs.getMetadataForTable(tableRef)).getSweepStrategy(); <END> }</code><technical_language>Note: Writes sweep queue done comitting a transaction, non-transactional table writes (including internal tables sweep-progress) enqueued. Agree fail gracefully if unable hydrate. This contentious, propose CONSERVATIVE - bad case of conservative is _usually_ unnecessary work</technical_language>

Target:
private TableMetadataPersistence.SweepStrategy getStrategyFromKvs(TableReference tableRef) { try { return TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(kvs.getMetadataForTable(tableRef)).getSweepStrategy(); } catch (Throwable th) { log.warn("Failed to obtain sweep strategy for table {}. Assuming sweep strategy is CONSERVATIVE.", UnsafeArg.of("tableRef", tableRef), th); return TableMetadataPersistence.SweepStrategy.CONSERVATIVE; } }
Source:
<code>public void test_cost() { TestPythonCheck check = new TestPythonCheck (){ @Override public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FUNCDEF, ctx -> { PyFunctionDefTree pyFunctionDefTree = (PyFunctionDefTree) ctx.syntaxNode(); PyNameTree name = pyFunctionDefTree.name(); ctx.addIssue(name.astNode().getToken(), MESSAGE).withCost(42); }); } }; <START> <END> List<PreciseIssue> issues = scanFileForIssues(FILE, check); PreciseIssue firstIssue = issues.get(0); assertThat(firstIssue.cost()).isEqualTo(42); }</code><technical_language>a dedicated test replacing this one</technical_language>

Target:
public void test_cost() { TestPythonCheck check = new TestPythonCheck (){ @Override public void visitFunctionDef(PyFunctionDefTree pyFunctionDefTree) { super.visitFunctionDef(pyFunctionDefTree); PyNameTree name = pyFunctionDefTree.name(); addIssue(name.astNode().getToken(), MESSAGE).withCost(42); } }; List<PreciseIssue> issues = scanFileForIssues(FILE, check); PreciseIssue firstIssue = issues.get(0); assertThat(firstIssue.cost()).isEqualTo(42); }
Source:
<code>private void reset() { <START> allHistograms.forEach(AbstractHistogram::reset); <END> }</code><technical_language>Histogram everywhere, replace AbstractHistogram::reset Histogram::reset</technical_language>

Target:
private void reset() { allHistograms.forEach(Histogram::reset); }
Source:
<code><START> public static Boolean checkIfUserOwns(final Tool tool,final HttpClient client, final ObjectMapper objectMapper, final TokenDAO tokenDAO, final long userId) { <END> List<Token> tokens = tokenDAO.findByUserId(userId); Token quayToken = extractToken(tokens, TokenType.QUAY_IO.toString()); if (tool.getRegistry() == Registry.QUAY_IO && quayToken == null) { LOG.info("WARNING: QUAY.IO token not found!"); throw new CustomWebApplicationException("A valid Quay.io token is required to add this tool.", HttpStatus.SC_BAD_REQUEST); } QuayImageRegistry factory = new QuayImageRegistry(client, objectMapper, quayToken); String quayUsername = quayToken.getUsername(); Map<String,Object> map = factory.getQuayInfo(tool); if (map != null){ String namespace = map.get("namespace").toString(); boolean isOrg = (Boolean)map.get("is_organization"); if (isOrg) { List<String> namespaces = factory.getNamespaces(); for(String nm : namespaces) { if (nm.equals(namespace)) { return true; } return false; } } else { return (namespace.equals(quayUsername) && !isOrg); } } return false; }</code><technical_language>strictly part of this pull request, if this changed boolean</technical_language>

Target:
public static boolean checkIfUserOwns(final Tool tool,final HttpClient client, final ObjectMapper objectMapper, final TokenDAO tokenDAO, final long userId) { List<Token> tokens = tokenDAO.findByUserId(userId); Token quayToken = extractToken(tokens, TokenType.QUAY_IO.toString()); if (tool.getRegistry() == Registry.QUAY_IO && quayToken == null) { LOG.info("WARNING: QUAY.IO token not found!"); throw new CustomWebApplicationException("A valid Quay.io token is required to add this tool.", HttpStatus.SC_BAD_REQUEST); } QuayImageRegistry factory = new QuayImageRegistry(client, objectMapper, quayToken); String quayUsername = quayToken.getUsername(); Map<String,Object> map = factory.getQuayInfo(tool); if (map != null){ String namespace = map.get("namespace").toString(); boolean isOrg = (Boolean)map.get("is_organization"); if (isOrg) { List<String> namespaces = factory.getNamespaces(); for(String nm : namespaces) { if (nm.equals(namespace)) { return true; } return false; } } else { return (namespace.equals(quayUsername)); } } return false; }
Source:
<code>public RoomModel voteSong(@PathParam("id") final int roomId, @PathParam("vote") final String vote) throws InvalidVoteException { final RoomInstance roomInstance = this.backend.getRoomInstance(roomId); <START> if ("like".equals(vote) || "dislike".equals(vote)) { <END> roomInstance.addVote(currentUserProvider.get(), Vote.valueOf(vote.toUpperCase())); } else { throw new InvalidVoteException(); } return transform(roomInstance); }</code><technical_language>I suggest enum for this. insert enum if text parsed static valueOf method. strings uppercase, special, this more conventional well. _Edit_ method becomes: java @POST @Path("{id}/vote/{vote}") @Transactional public RoomModel voteSong(@PathParam("id") final int roomId, @PathParam("vote") final Vote vote) { final RoomInstance roomInstance = this.backend.getRoomInstance(roomId);</technical_language>

Target:
public RoomModel voteSong(@PathParam("id") final int roomId, @PathParam("vote") final String vote) { final RoomInstance roomInstance = this.backend.getRoomInstance(roomId); Vote voteValue = Vote.valueOf(vote.toUpperCase()); roomInstance.addVote(currentUserProvider.get(), voteValue); return transform(roomInstance); }
Source:
<code>public void testCreateRegionWithMinMax() { List<Vector3i> mins = Arrays.asList(new Vector3i(), new Vector3i(1, 1, 1), new Vector3i(3, 4, 5)); List<Vector3i> expectedSize = Arrays.asList(new Vector3i(1, 1, 1), new Vector3i(3, 3, 3), new Vector3i(8, 5, 2)); List<Vector3i> max = Arrays.asList(new Vector3i(1, 1, 1), new Vector3i(4, 4, 4), new Vector3i(11, 9, 7)); for (int i = 0; i < mins.size(); ++i) { <START> BlockRegion region = new BlockRegion().union(mins.get(i)).union(max.get(i)); <END> assertEquals(mins.get(i), region.getMin(new Vector3i())); assertEquals(max.get(i), region.getMax(new Vector3i())); assertEquals(expectedSize.get(i), region.getSize(new Vector3i())); } }</code><technical_language>More weird union() usage for setting min-max values. min-max constructor. suggestion BlockRegion region = new BlockRegion(mins.get(i), max.get(i));</technical_language>

Target:
public void testCreateRegionWithMinMax() { List<Vector3i> mins = Arrays.asList(new Vector3i(), new Vector3i(1, 1, 1), new Vector3i(3, 4, 5)); List<Vector3i> expectedSize = Arrays.asList(new Vector3i(1, 1, 1), new Vector3i(3, 3, 3), new Vector3i(8, 5, 2)); List<Vector3i> max = Arrays.asList(new Vector3i(), new Vector3i(3, 3, 3), new Vector3i(10, 8, 6)); for (int i = 0; i < mins.size(); ++i) { BlockRegion region = new BlockRegion(mins.get(i), max.get(i)); assertEquals(mins.get(i), region.getMin(new Vector3i())); assertEquals(max.get(i), region.getMax(new Vector3i())); assertEquals(expectedSize.get(i), region.getSize(new Vector3i())); } }
Source:
<code>public AbstractListDataView<T> addItemAfter(T item, T after) { final Collection<T> items = getDataProvider().getItems(); if(!items.contains(after)) { throw new IllegalArgumentException("Item to insert after is not available in the data"); } if(items instanceof List) { ((List<T>)items).add(((List<T>) items).indexOf(after)+1, item); getDataProvider().refreshAll(); return this; } <START> throw new IllegalArgumentException("DataProvider collection is not a list."); <END> }</code><technical_language>give real type in exception ? for method</technical_language>

Target:
public AbstractListDataView<T> addItemAfter(T item, T after) { final Collection<T> items = getDataProvider().getItems(); if(!items.contains(after)) { throw new IllegalArgumentException("Item to insert after is not available in the data"); } if(items instanceof List) { final List<T> itemList = (List<T>) items; itemList.add(itemList.indexOf(after)+1, item); getDataProvider().refreshAll(); return this; } throw new IllegalArgumentException(String.format("DataProvider collection '%s' is not a list.", items.getClass().getSimpleName())); }
Source:
<code>private static FBNetwork getFBNetworkForSubApp(SubApp subApp) { if(null != subApp.getType()) { return subApp.getType().getFBNetwork(); } else <START> if(null != subApp.getOpposite()) { return ((SubApp)subApp.getOpposite()).getSubAppNetwork(); } else { <END> return subApp.getSubAppNetwork(); } }</code><technical_language>this break soon allow parts of subapps mapped. get wrong opposites here. reason I added orignal null check for subappnetwork</technical_language>

Target:
private static FBNetwork getFBNetworkForSubApp(SubApp subApp) { FBNetwork retVal = subApp.getSubAppNetwork(); if(null == retVal) { if(null != subApp.getType()) { retVal = subApp.getType().getFBNetwork(); } else if(null != subApp.getOpposite()) { retVal = ((SubApp)subApp.getOpposite()).getSubAppNetwork(); } } return retVal; }
Source:
<code>public Map<String, Serializable> jobResultMap(@HeaderParam("sessionid") String sessionId, @PathParam("jobid") String jobId) <START> throws NotConnectedRestException, PermissionRestException, UnknownJobRestException { <END> try { Scheduler s = checkAccess(sessionId, PATH_JOBS + jobId + "/resultmap"); JobResult jobResult = PAFuture.getFutureValue(s.getJobResult(jobId)); if (jobResult == null) { return null; } else { return jobResult.getResultMap(); } } catch (PermissionException e) { throw new PermissionRestException(e); } catch (UnknownJobException e) { throw new UnknownJobRestException(e); } catch (NotConnectedException e) { throw new NotConnectedRestException(e); } }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Remove redundant '!unknownSymbol!' thrown exception declaration(s). [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
public Map<String, String> jobResultMap(@HeaderParam("sessionid") String sessionId, @PathParam("jobid") String jobId) throws NotConnectedRestException, PermissionRestException, UnknownJobRestException { try { Scheduler s = checkAccess(sessionId, PATH_JOBS + jobId + "/resultmap"); JobResult jobResult = PAFuture.getFutureValue(s.getJobResult(jobId)); if (jobResult == null) { return null; } else { return getJobResultMapAsString(jobResult.getResultMap()); } } catch (PermissionException e) { throw new PermissionRestException(e); } catch (UnknownJobException e) { throw new UnknownJobRestException(e); } catch (NotConnectedException e) { throw new NotConnectedRestException(e); } }
Source:
<code><START> public Object updateStatusOnGH(Runnable closure) throws ANTLRException { <END> GitHubPRStatusStepDslContext context = new GitHubPRStatusStepDslContext(); executeInContext(closure, context); return new GitHubPRBuildStatusPublisher( context.message(), null, null, null, null ); }</code><technical_language>i is cron parse Trigger.class</technical_language>

Target:
public Object updateStatusOnGH(Runnable closure) { GitHubPRStatusStepDslContext context = new GitHubPRStatusStepDslContext(); executeInContext(closure, context); return new GitHubPRStatusBuilder(context.message()); }
Source:
<code>public ProxyInputStream( InputStream originalInput, final InterceptCallback callback) throws IOException { this.originalInput = originalInput; proxyInput = new PipedInputStream(); try { proxyOutput = new PipedOutputStream(proxyInput); } catch (IOException e) { callback.done(null, e); ParseIOUtils.closeQuietly(proxyOutput); ParseIOUtils.closeQuietly(proxyInput); throw e; } Task.call(new Callable<Void>() { @Override public Void call() throws Exception { callback.done(proxyInput, null); return null; } <START> }, ParseExecutors.io()); <END> }</code><technical_language>Is a more elegant do this? A Callback background thread super hacky</technical_language>

Target:
public ProxyInputStream( InputStream originalInput, final InterceptCallback callback) throws IOException { this.originalInput = originalInput; PipedInputStream tempProxyInput = new PipedInputStream(); PipedOutputStream tempProxyOutput = null; try { tempProxyOutput = new PipedOutputStream(tempProxyInput); } catch (IOException e) { callback.done(null, e); ParseIOUtils.closeQuietly(tempProxyOutput); ParseIOUtils.closeQuietly(tempProxyInput); throw e; } proxyInput = tempProxyInput; proxyOutput = tempProxyOutput; Task.call(new Callable<Void>() { @Override public Void call() throws Exception { callback.done(proxyInput, null); return null; } }, ParseExecutors.io()); }
Source:
<code>Board(Square[][] grid) { assert grid != null; <START> this.board = (Square[][]) grid.clone(); <END> assert invariant() : "Initial grid cannot contain null squares"; }</code><technical_language>clone a cast here</technical_language>

Target:
Board(Square[][] grid) { assert grid != null; this.board = grid; assert invariant() : "Initial grid cannot contain null squares"; }
Source:
<code>private static Hasher addValue(final Hasher hasher, final ReadableColumn column, final int row) { switch (column.getType()) { case BOOLEAN_TYPE: return hasher.putBoolean(column.getBoolean(row)); case DATETIME_TYPE: return hasher.putObject(column.getDateTime(row), TypeFunnel.INSTANCE); case DOUBLE_TYPE: return hasher.putDouble(column.getDouble(row)); case FLOAT_TYPE: return hasher.putFloat(column.getFloat(row)); case INT_TYPE: return hasher.putInt(column.getInt(row)); case LONG_TYPE: return hasher.putLong(column.getLong(row)); case STRING_TYPE: return hasher.putObject(column.getString(row), TypeFunnel.INSTANCE); default: <START> throw new UnsupportedOperationException("Hashing a column of type " + column.getType()); <END> } }</code><technical_language>message: "Hashing a column of type " + column.getType() + " is unsupported"</technical_language>

Target:
private static Hasher addValue(final Hasher hasher, final ReadableColumn column, final int row) { switch (column.getType()) { case BOOLEAN_TYPE: return hasher.putBoolean(column.getBoolean(row)); case DATETIME_TYPE: return hasher.putObject(column.getDateTime(row), TypeFunnel.INSTANCE); case DOUBLE_TYPE: return hasher.putDouble(column.getDouble(row)); case FLOAT_TYPE: return hasher.putFloat(column.getFloat(row)); case INT_TYPE: return hasher.putInt(column.getInt(row)); case LONG_TYPE: return hasher.putLong(column.getLong(row)); case STRING_TYPE: return hasher.putObject(column.getString(row), TypeFunnel.INSTANCE); default: throw new UnsupportedOperationException( "Hashing a column of type " + column.getType() + " is unsupported"); } }
Source:
<code>public void create_new_instances_with_current_time() { final Timestamp beforeCall = Timestamps2.secondsAgo(1); final Command command = commandFactory.create(StringValue.getDefaultInstance()); <START> final Timestamp afterCall = TimeTests.Future.secondsFromNow(1); <END> assertTrue(Timestamps2.isBetween(command.getContext().getTimestamp(), beforeCall, afterCall)); }</code><technical_language>equivalent generator for Past</technical_language>

Target:
public void create_new_instances_with_current_time() { final Timestamp beforeCall = TimeTests.Past.secondsAgo(1); final Command command = commandFactory.create(StringValue.getDefaultInstance()); final Timestamp afterCall = TimeTests.Future.secondsFromNow(1); assertTrue(Timestamps2.isBetween(command.getContext().getTimestamp(), beforeCall, afterCall)); }