auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ITransformationFile getTransformationFile(String transformationId) { TransformFilesDTO transformDTO = (TransformFilesDTO) transformationDAO.getDTO(transformationId); String fileLocation = transformationFileService.getTransformFileLocation(); String absolutePatternFilePath = getAbsoluteFilePath(fileLocation, transformationId, transformDTO.getPatternFileName()); String absoluteMappingFilePath = getAbsoluteFilePath(fileLocation, transformationId, transformDTO.getMappingFileName()); TransformationFile transformFile = new TransformationFile(); transformFile.setAbsolutePatternFilePath(absolutePatternFilePath); transformFile.setAbsoluteMappingFilePath(absoluteMappingFilePath); transformFile.setTitle(transformDTO.getTitle()); transformFile.setDescription(transformDTO.getDescription()); transformFile.setPatternFileName(transformDTO.getPatternFileName()); transformFile.setPatternDescription(transformDTO.getMappingDescription()); transformFile.setPatternTitle(transformDTO.getPatternTitle()); transformFile.setMappingFileName(transformDTO.getMappingFileName()); transformFile.setMappingDescription(transformDTO.getMappingDescription()); transformFile.setMappingTitle(transformDTO.getMappingTitle()); <START> transformFile.setUserName(transformDTO.getUserName()); <END> return transformFile; }</code><technical_language>this done in a mapper class. a ProjectHandleResolverMapper</technical_language>

Target:
public ITransformationFile getTransformationFile(String transformationId) { TransformFilesDTO transformDTO = (TransformFilesDTO) transformationDAO.getDTO(transformationId); String fileLocation = transformationFileService.getTransformFileLocation(); String absolutePatternFilePath = transformationFileService.getAbsoluteFilePath(fileLocation, transformationId, transformDTO.getPatternFileName()); String absoluteMappingFilePath = transformationFileService.getAbsoluteFilePath(fileLocation, transformationId, transformDTO.getMappingFileName()); ITransformationFile transformFile = transformationMapper.getTransformFile(transformDTO); transformFile.setAbsolutePatternFilePath(absolutePatternFilePath); transformFile.setAbsoluteMappingFilePath(absoluteMappingFilePath); return transformFile; }
Source:
<code>public boolean tryDelete(OBonsaiCollectionPointer collectionPointer, long delay) { final CacheKey cacheKey = new CacheKey(storage, collectionPointer); final Object lock = treesSubsetLock(cacheKey); synchronized (lock) { SBTreeBonsaiContainer container = treeCache.getQuietly(cacheKey); assert container != null; if (container.usagesCounter != 0 || container.lastAccessTime > System.currentTimeMillis() - delay) { return false; } treeCache.remove(cacheKey); } <START> OSBTreeBonsai<OIdentifiable, Integer> treeBonsai = this.loadSBTree(collectionPointer); <END> try { treeBonsai.delete(); } catch (IOException e) { throw OException.wrapException(new ODatabaseException("Error during ridbag deletion"), e); } finally { this.releaseSBTree(collectionPointer); } return true; }</code><technical_language>I completely grasp it. first, remove tree rid bag cache. load cache remove instance, a pointer cache again. I miss something</technical_language>

Target:
public boolean tryDelete(OBonsaiCollectionPointer collectionPointer, long delay) { final CacheKey cacheKey = new CacheKey(storage, collectionPointer); final Object lock = treesSubsetLock(cacheKey); synchronized (lock) { SBTreeBonsaiContainer container = treeCache.getQuietly(cacheKey); if (container != null && (container.usagesCounter != 0 || container.lastAccessTime > System.currentTimeMillis() - delay)) { return false; } treeCache.remove(cacheKey); OSBTreeBonsai<OIdentifiable, Integer> treeBonsai = this.loadTree(collectionPointer); try { treeBonsai.delete(); } catch (IOException e) { throw OException.wrapException(new ODatabaseException("Error during ridbag deletion"), e); } } return true; }
Source:
<code>private static String valueToQuery(Type type, Object value) { if (type.equals(BIGINT)) { return String.valueOf(((long) value)); } <START> if (type.equals(DoubleType.DOUBLE)) { <END> return value.toString(); } if (type.equals(INTEGER)) { return String.valueOf(((Number) value).intValue()); } if (type.equals(SMALLINT)) { return String.valueOf(((Number) value).shortValue()); } if (type.equals(TINYINT)) { return String.valueOf(((Number) value).byteValue()); } if (type.equals(RealType.REAL)) { return String.valueOf(intBitsToFloat(((Number) value).intValue())); } if (type.equals(BOOLEAN)) { return String.valueOf(value); } if (type.equals(DATE)) { return "`" + FORMATTER.print(DAYS.toMillis((long) value)) + "`"; } if (type.equals(TimestampType.TIMESTAMP)) { return String.valueOf((long) value); } if (type.equals(VarcharType.VARCHAR)) { return "'" + ((Slice) value).toStringUtf8() + "'"; } if (type instanceof DecimalType) { if (Decimals.isLongDecimal(type)) { return Decimals.toString((Slice) value, ((DecimalType) type).getScale()); } return Decimals.toString((long) value, ((DecimalType) type).getScale()); } return "'" + ((Slice) value).toStringUtf8() + "'"; }</code><technical_language>Nit: put double real next other</technical_language>

Target:
private static String valueToQuery(Type type, Object value) { if (type.equals(BIGINT)) { return String.valueOf(((Number) value).longValue()); } if (type.equals(INTEGER)) { return String.valueOf(((Number) value).intValue()); } if (type.equals(SMALLINT)) { return String.valueOf(((Number) value).shortValue()); } if (type.equals(TINYINT)) { return String.valueOf(((Number) value).byteValue()); } if (type.equals(BOOLEAN)) { return String.valueOf(value); } if (type.equals(DATE)) { return "`" + FORMATTER.print(DAYS.toMillis((long) value)) + "`"; } if (type.equals(VarcharType.VARCHAR)) { return "'" + ((Slice) value).toStringUtf8() + "'"; } if (type instanceof DecimalType) { if (Decimals.isLongDecimal(type)) { return Decimals.toString((Slice) value, ((DecimalType) type).getScale()); } return Decimals.toString((long) value, ((DecimalType) type).getScale()); } return "'" + ((Slice) value).toStringUtf8() + "'"; }
Source:
<code>private void initAboutPane() { aboutPanel = new VBox(); aboutPanel.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS); final Text title = new TextWithStyle(translate("About"), TITLE_CSS_CLASS); aboutPanel.getChildren().add(title); final GridPane gridPane = new GridPane(); gridPane.getStyleClass().add("grid"); gridPane.add(new TextWithStyle(translate("Name:"), CAPTION_TITLE_CSS_CLASS), 0, 0); gridPane.add(new Label(applicationName), 1, 0); gridPane.add(new TextWithStyle(translate("Version:"), CAPTION_TITLE_CSS_CLASS), 0, 1); gridPane.add(new Label(applicationVersion), 1, 1); <START> gridPane.add(new TextWithStyle(translate("Git Revision:"), CAPTION_TITLE_CSS_CLASS), 0, 2); <END> gridPane.add(new Label(applicationGitRevision), 1, 2); gridPane.add(new TextWithStyle(translate("Build Timestamp:"), CAPTION_TITLE_CSS_CLASS), 0, 3); gridPane.add(new Label(applicationBuildTimestamp), 1, 3); gridPane.setHgap(20); gridPane.setVgap(10); aboutPanel.getChildren().add(gridPane); }</code><technical_language>if running a dev version</technical_language>

Target:
private void initAboutPane() { aboutPanel = new VBox(); aboutPanel.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS); final Text title = new TextWithStyle(translate("About"), TITLE_CSS_CLASS); aboutPanel.getChildren().add(title); final GridPane gridPane = new GridPane(); gridPane.getStyleClass().add("grid"); gridPane.add(new TextWithStyle(translate("Name:"), CAPTION_TITLE_CSS_CLASS), 0, 0); gridPane.add(new Label(applicationName), 1, 0); gridPane.add(new TextWithStyle(translate("Version:"), CAPTION_TITLE_CSS_CLASS), 0, 1); gridPane.add(new Label(applicationVersion), 1, 1); gridPane.add(new TextWithStyle(translate("Git Revision:"), CAPTION_TITLE_CSS_CLASS), 0, 2); Hyperlink gitRevisionLink = new Hyperlink(applicationGitRevision); gitRevisionLink.setOnAction(event -> { try { URI uri = new URI("<LINK_0>" + applicationGitRevision); opener.open(uri); } catch (URISyntaxException e) { e.printStackTrace(); } } ); gridPane.add(gitRevisionLink, 1, 2); gridPane.add(new TextWithStyle(translate("Build Timestamp:"), CAPTION_TITLE_CSS_CLASS), 0, 3); gridPane.add(new Label(applicationBuildTimestamp), 1, 3); gridPane.setHgap(20); gridPane.setVgap(10); aboutPanel.getChildren().add(gridPane); }
Source:
<code><START> private static boolean isStringParameter( <END> @NonNull Expression expression, @NonNull JavaContext context) { if (expression instanceof StringLiteral) { return true; } else { JavaParser.ResolvedNode resolvedNode = context.resolve(expression); if (resolvedNode instanceof JavaParser.ResolvedField) { if (((JavaParser.ResolvedField) resolvedNode).getValue() instanceof String) { return true; } } } return false; }</code><technical_language>instead of this, (at callsite JavaContext) TypeDescriptor type = context.getType(expression); return type != null && type.matchesSignature(JavaContext.TYPE_STRING);</technical_language>

Target:
private static boolean isStringParameter( @NonNull Expression expression, @NonNull JavaContext context) { if (expression instanceof StringLiteral) { return true; } else { ResolvedNode resolvedNode = context.resolve(expression); if (resolvedNode instanceof ResolvedField) { if (((ResolvedField) resolvedNode).getValue() instanceof String) { return true; } } } return false; }
Source:
<code>private ConnectionFactory(DbProperties properties, String server, String user, String password) throws SQLException { this.server = server; this.user = user; this.password = password; this.properties = properties; ds = new BasicDataSource(); ds.setDriverClassName(this.properties.getDriverName()); ds.setUrl(this.server); ds.setUsername(this.user); ds.setPassword(this.password); ds.setDefaultAutoCommit(true); ds.setDefaultReadOnly(false); ds.setValidationQuery(this.properties.getValidationQuery()); ds.setMaxActive(1000); <START> ds.setMaxActive(10000); <END> }</code><technical_language>2 calls for setMaxActive() ? Plus, 10 000 ***very*** high ! postgresql, for example, a default of 100 concurrent connections... if database refuses a new connection ? Is adjust this number database limit (min(N, SERVER_LIMIT)) ? (postgres returns SHOW max_connections; f.e.)</technical_language>

Target:
private ConnectionFactory(DbProperties properties, String server, String user, String password) throws SQLException { this.server = server; this.user = user; this.password = password; this.properties = properties; ds = new BasicDataSource(); ds.setDriverClassName(this.properties.getDriverName()); ds.setUrl(this.server); ds.setUsername(this.user); ds.setPassword(this.password); ds.setDefaultAutoCommit(autocommit); ds.setDefaultReadOnly(readonly); ds.setValidationQuery(this.properties.getValidationQuery()); Connection con = null; try { con = getConnection(); maxconnections = properties.getMaximumConnections(con); } catch (SQLException e) { logger.warn( "Cannot fetch maximum connection allowed from database", e); } finally { con.close(); } ds.setMaxActive(maxconnections); ds.setMaxIdle(maxconnections); logger.info(this.toString()); }
Source:
<code>private boolean checkIncludes(String include, String field) { String includeString = (include == null ? "" : include); <START> ArrayList<String> includeSplit = new ArrayList(Arrays.asList(includeString.split(","))); <END> return includeSplit.contains(field); }</code><technical_language>1. able returned Arrays.asList directly, creating a new ArrayList top of that. 2. CSV string handle more complicated CSV formatting. I OK, I understand input, making sure. example is a CSV a comma in it, in case double quoted. I this I interview question I parse a CSV file. :) I said, issue here, mentioning in case</technical_language>

Target:
private boolean checkIncludes(String include, String field) { String includeString = (include == null ? "" : include); List<String> includeSplit = Arrays.asList(includeString.split(",")); return includeSplit.contains(field); }
Source:
<code>private void buildFullyQualifiedNameAsPrefix() { <START> if (fullyQualifiedName.equals("")) fullyQualifiedNameAsPrefix = ""; <END> else fullyQualifiedNameAsPrefix = fullyQualifiedName+"."; }</code><technical_language>I fullyQualifiedName.isEmpty() do is a bit cleaner. curly braces for single line ifs please? keen omitting braces for single line if statements adding a line in easy forget add braces in</technical_language>

Target:
protected void buildFullyQualifiedNameAsPrefix() { fullyQualifiedNameAsPrefix = buildNameAsPrefix(fullyQualifiedName); }
Source:
<code>public void switchToNewUser(String jwt, String url) { <START> final Bundle reply = new Bundle(); <END> final Intent i = new Intent(context, SalesforceSDKManager.getInstance().getLoginActivityClass()); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); final Bundle options = SalesforceSDKManager.getInstance().getLoginOptions(jwt, url).asBundle(); i.putExtras(options); reply.putParcelable(AccountManager.KEY_INTENT, i); context.startActivity(i); }</code><technical_language>@helenren A lot of code is previous method, for line builds options. create common private method common stuff takes in a Bundle - options</technical_language>

Target:
public void switchToNewUser(String jwt, String url) { Bundle options = SalesforceSDKManager.getInstance().getLoginOptions(jwt, url).asBundle(); switchToNewUserWithOptions(options); }
Source:
<code><START> public VaultPackage open(File pkg) throws IOException { <END> try { return new ZipVaultPackage(pkg, false, true); } catch (IOException e) { log.error("Cloud not open file as ZipVaultPackage.", pkg.getPath(), e); return null; } }</code><technical_language>I return NULL here, consumer (FSRegisteredPackage) expect this</technical_language>

Target:
public VaultPackage open(File pkg) throws IOException { try { return new ZipVaultPackage(pkg, false, true); } catch (IOException e) { log.error("Cloud not open file as ZipVaultPackage.", pkg.getPath(), e); throw e; } }
Source:
<code>public DenseLocalDateDoubleTimeSeries mapValues(DoubleUnaryOperator mapper) { return of( startDate, <START> Arrays.stream(points).map(d -> isValidPoint(d) ? mapper.applyAsDouble(d) : d), <END> dateCalculation); }</code><technical_language>Prefer DoubleStream.of() Arrays.stream(). Clearer</technical_language>

Target:
public LocalDateDoubleTimeSeries mapValues(DoubleUnaryOperator mapper) { DoubleStream values = DoubleStream.of(points).map(d -> isValidPoint(d) ? applyMapper(mapper, d) : d); return new DenseLocalDateDoubleTimeSeries(startDate, values.toArray(), dateCalculation, true); }
Source:
<code>public boolean hasNext() throws SQLException { if (_next) { return true; <START> } else if (_needToClose || _closed) { <END> return false; } if (_stmt == null) { return false; } _next = _rs.next(); if (!_next) { _rs.close(); _rs = _stmt.executeQuery(new SqlStringBuilder().append("HANDLER ") .appendIdent(_source.getTableName(), "Iterator") .append(" READ `PRIMARY` NEXT LIMIT ") .append(_bufSize) .toString()); _next = _rs.next(); if (!_next) { _needToClose = true; } } return _next; }</code><technical_language>check for if (_closed) check for if(_next)?</technical_language>

Target:
private boolean hasNext() throws SQLException { if (_isEof || _closed) { return false; } if (_next) { return true; } if (_stmt == null) { return false; } _next = _rs.next(); if (!_next) { _rs.close(); _rs = _stmt.executeQuery(new SqlStringBuilder().append("HANDLER ") .appendIdent(_source.getTableName(), "Iterator") .append(" READ `PRIMARY` NEXT LIMIT ") .append(_bufSize) .toString()); _next = _rs.next(); if (!_next) { _isEof = true; } } return _next; }
Source:
<code><START> public RuntimeException translateException(Throwable throwable) { <END> RuntimeException runtimeException = throwable instanceof RuntimeException ? (RuntimeException) throwable : new RuntimeException(throwable.getMessage(), throwable); RuntimeException potentiallyTranslatedException = exceptionTranslator .translateExceptionIfPossible(runtimeException); return potentiallyTranslatedException != null ? potentiallyTranslatedException : runtimeException; }</code><technical_language>Nit: this method private asks for it</technical_language>

Target:
private RuntimeException translateException(Throwable throwable) { RuntimeException runtimeException = throwable instanceof RuntimeException ? (RuntimeException) throwable : new RuntimeException(throwable.getMessage(), throwable); RuntimeException potentiallyTranslatedException = exceptionTranslator .translateExceptionIfPossible(runtimeException); return potentiallyTranslatedException != null ? potentiallyTranslatedException : runtimeException; }
Source:
<code>public void cleanup() { fModule.dispose(); <START> fTrace.dispose(); CtfTmfTestTraceUtils.dispose(getTestTrace()); <END> }</code><technical_language>disposing trace. call</technical_language>

Target:
public void cleanup() { fModule.dispose(); CtfTmfTestTraceUtils.dispose(getTestTrace()); }
Source:
<code>public void run() { if (!isStarted.compareAndSet(false, true)) { log.info("Attempting to start an already started job coordinator. "); return; } if (isJmxEnabled) { jmxServer = new JmxServer(); state.jmxUrl = jmxServer.getJmxUrl(); state.jmxTunnelingUrl = jmxServer.getTunnelingJmxUrl(); } else { jmxServer = null; } try { log.info("Starting Cluster Based Job Coordinator"); JobModel jobModel = jobModelManager.jobModel(); <START> CheckpointManager checkpointManager = new TaskConfigJava(config).getCheckpointManager(metrics); <END> if (checkpointManager != null) { checkpointManager.createStream(); } changelogStreamManager.createChangeLogStreams(jobModel.getConfig(), jobModel.maxChangeLogStreamPartitions); Map prevPartitionMappings = changelogStreamManager.readPartitionMapping(); changelogStreamManager.updatePartitionMapping(prevPartitionMappings, jobModel.getTaskPartitionMappings()); containerProcessManager.start(); systemAdmins.start(); partitionMonitor.start(); boolean isInterrupted = false; while (!containerProcessManager.shouldShutdown() && !checkAndThrowException() && !isInterrupted) { try { Thread.sleep(jobCoordinatorSleepInterval); } catch (InterruptedException e) { isInterrupted = true; log.error("Interrupted in job coordinator loop ", e); Thread.currentThread().interrupt(); } } } catch (Throwable e) { log.error("Exception thrown in the JobCoordinator loop ", e); throw new SamzaException(e); } finally { onShutDown(); } }</code><technical_language>a question for @nickpan47: sense new StreamManager for creating streams instead of leaving CoordinatorStream|Changelog|CheckpointManager</technical_language>

Target:
public void run() { if (!isStarted.compareAndSet(false, true)) { log.info("Attempting to start an already started job coordinator. "); return; } if (isJmxEnabled) { jmxServer = new JmxServer(); state.jmxUrl = jmxServer.getJmxUrl(); state.jmxTunnelingUrl = jmxServer.getTunnelingJmxUrl(); } else { jmxServer = null; } try { log.info("Starting Cluster Based Job Coordinator"); JobModel jobModel = jobModelManager.jobModel(); CheckpointManager checkpointManager = new TaskConfigJava(config).getCheckpointManager(metrics); if (checkpointManager != null) { checkpointManager.createResources(); } ChangelogStreamManager.createChangelogStreams(jobModel.getConfig(), jobModel.maxChangeLogStreamPartitions); Map prevPartitionMappings = changelogStreamManager.readPartitionMapping(); changelogStreamManager.updatePartitionMapping(prevPartitionMappings, jobModel.getTaskPartitionMappings()); containerProcessManager.start(); systemAdmins.start(); partitionMonitor.start(); boolean isInterrupted = false; while (!containerProcessManager.shouldShutdown() && !checkAndThrowException() && !isInterrupted) { try { Thread.sleep(jobCoordinatorSleepInterval); } catch (InterruptedException e) { isInterrupted = true; log.error("Interrupted in job coordinator loop ", e); Thread.currentThread().interrupt(); } } } catch (Throwable e) { log.error("Exception thrown in the JobCoordinator loop ", e); throw new SamzaException(e); } finally { onShutDown(); } }
Source:
<code>public void testToNpyFormat() throws Exception { <START> File dir = new File("C:\\DL4J\\Git\\dl4j-test-resources\\src\\main\\resources\\numpy_arrays"); <END> File[] files = dir.listFiles(); for(File f : files){ if(!f.getPath().endsWith(".npy")){ log.warn("Skipping: {}", f); continue; } String path = f.getAbsolutePath(); int lastDot = path.lastIndexOf('.'); int lastUnderscore = path.lastIndexOf('_'); String dtype = path.substring(lastUnderscore+1, lastDot); System.out.println(path + " : " + dtype); DataType dt = DataType.fromNumpy(dtype); System.out.println(dt); INDArray arr = Nd4j.arange(12).castTo(dt).reshape(3,4); byte[] bytes = Nd4j.toNpyByteArray(arr); byte[] expected = FileUtils.readFileToByteArray(f); System.out.println(Arrays.toString(expected)); System.out.println(Arrays.toString(bytes)); for( int i=0; i<bytes.length; i++ ){ System.out.print((char)bytes[i]); } System.out.println(); for( int i=0; i<expected.length; i++ ){ System.out.print((char)expected[i]); } System.out.println("\n---------"); } }</code><technical_language>Classpath resource some point? :)</technical_language>

Target:
public void testToNpyFormat() throws Exception { val dir = testDir.newFolder(); new ClassPathResource("numpy_arrays/").copyDirectory(dir); File[] files = dir.listFiles(); int cnt = 0; for(File f : files){ if(!f.getPath().endsWith(".npy")){ log.warn("Skipping: {}", f); continue; } String path = f.getAbsolutePath(); int lastDot = path.lastIndexOf('.'); int lastUnderscore = path.lastIndexOf('_'); String dtype = path.substring(lastUnderscore+1, lastDot); System.out.println(path + " : " + dtype); DataType dt = DataType.fromNumpy(dtype); INDArray arr = Nd4j.arange(12).castTo(dt).reshape(3,4); byte[] bytes = Nd4j.toNpyByteArray(arr); byte[] expected = FileUtils.readFileToByteArray(f); assertArrayEquals("Failed with file [" + f.getName() + "]", expected, bytes); cnt++; } assertTrue(cnt > 0); }
Source:
<code>public void testRegexSequence() { String test1 = "123Test"; assertTrue(test1.matches(StringUtils.ALPHA_NUM_REGEXP)); String test2 = " Test"; assertFalse(test2.matches(StringUtils.ALPHA_NUM_REGEXP)); String test3 = "Test#"; assertFalse(test3.matches(StringUtils.ALPHA_NUM_REGEXP)); <START> String test4 = "123Test"; <END> assertTrue(test4.matches(StringUtils.ALPHA_NUM_SPACE_REGEXP)); String test5 = " 123Test"; assertTrue(test5.matches(StringUtils.ALPHA_NUM_SPACE_REGEXP)); String test6 = " 123Test#"; assertFalse(test6.matches(StringUtils.ALPHA_NUM_SPACE_REGEXP)); }</code><technical_language>miss space in this input</technical_language>

Target:
public void testRegexSequence() { String test1 = "123Test"; assertTrue(test1.matches(StringUtils.ALPHA_NUM_REGEXP)); String test2 = "123Test "; assertFalse(test2.matches(StringUtils.ALPHA_NUM_REGEXP)); String test3 = "123Test #"; assertFalse(test3.matches(StringUtils.ALPHA_NUM_REGEXP)); String test4 = "123Test"; assertTrue(test4.matches(StringUtils.ALPHA_NUM_SPACE_REGEXP)); String test5 = "123Test "; assertTrue(test5.matches(StringUtils.ALPHA_NUM_SPACE_REGEXP)); String test6 = "123Test #"; assertFalse(test6.matches(StringUtils.ALPHA_NUM_SPACE_REGEXP)); }
Source:
<code>public void shouldCallDeploymentTransformersWithEmptyCauseException() throws Exception { TestExceptionDeployThrower.shouldThrow = new DeploymentException("Could not handle ba", null); Mockito.when(serviceLoader.all(DeploymentExceptionTransformer.class)) .thenReturn(Collections.singletonList(transformer)); fire(new DeployDeployment( container, new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class)) .setExpectedException(DeploymentException.class)))); <START> Mockito.verify(transformer, Mockito.times(1)).transform(Mockito.isA(Exception.class)); <END> }</code><technical_language>I want verify null is passed transform method, I this check more strict. check exception passed method is thrown deployment: Mockito.verify(transformer, Mockito.times(1)).transform(TestExceptionDeployThrower.shouldThrow); type of exception is DeploymentException: Mockito.verify(transformer, Mockito.times(1)).transform(Mockito.isA(DeploymentException.class));</technical_language>

Target:
public void shouldCallDeploymentTransformersWithEmptyCauseException() throws Exception { TestExceptionDeployThrower.shouldThrow = new DeploymentException("Could not handle ba", null); Mockito.when(serviceLoader.all(DeploymentExceptionTransformer.class)) .thenReturn(Collections.singletonList(transformer)); fire(new DeployDeployment( container, new Deployment(new DeploymentDescription("test", ShrinkWrap.create(JavaArchive.class)) .setExpectedException(DeploymentException.class)))); Mockito.verify(transformer, Mockito.times(1)).transform(TestExceptionDeployThrower.shouldThrow); }
Source:
<code>void createHandle (int index) { if ((style & SWT.BALLOON) != 0) { state |= HANDLE; handle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP); Color background = display.getSystemColor (SWT.COLOR_INFO_BACKGROUND); if (OS.GTK3) { long context = OS.gtk_widget_get_style_context (handle); String css = "GtkWindow {background-color: rgb(" + background.getRed() +", " + background.getGreen() +", " + background.getBlue() <START> +");}"; <END> gtk_css_provider_load_from_css (context, css); OS.gtk_style_context_invalidate (context); } else { OS.gtk_widget_modify_bg (handle, OS.GTK_STATE_NORMAL, background.handle); } OS.gtk_window_set_type_hint (handle, OS.GDK_WINDOW_TYPE_HINT_TOOLTIP); } }</code><technical_language>a good habbit preserve alpha is Color.getAlpha() rgba(r, g, b, a) work here</technical_language>

Target:
void createHandle (int index) { if ((style & SWT.BALLOON) != 0) { state |= HANDLE; handle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP); Color background = display.getSystemColor (SWT.COLOR_INFO_BACKGROUND); if (OS.GTK3) { long context = OS.gtk_widget_get_style_context (handle); double alpha = (background.getAlpha() & 0xFFFF) / (float)0xFFFF; String css = "GtkWindow {background-color: rgba(" + background.getRed() +", " + background.getGreen() +", " + background.getBlue() +", " + alpha + ");}"; gtk_css_provider_load_from_css (context, css); OS.gtk_style_context_invalidate (context); } else { OS.gtk_widget_modify_bg (handle, OS.GTK_STATE_NORMAL, background.handle); } OS.gtk_window_set_type_hint (handle, OS.GDK_WINDOW_TYPE_HINT_TOOLTIP); } }
Source:
<code>public Map<String, String> getConfigMap(String configKey) { String configMap = config.get(configKey); try { <START> List<StringPair> map = OBJECT_MAPPER.readValue(configMap, MAP_TYPE_REPRESENTATION); <END> return map.stream().collect(Collectors.toMap(StringPair::getKey, StringPair::getValue)); } catch (IOException e) { throw new RuntimeException("Could not deserialize json: " + configMap, e); } }</code><technical_language>"JsonSerialization.readValue"</technical_language>

Target:
public Map<String, String> getConfigMap(String configKey) { String configMap = config.get(configKey); try { List<StringPair> map = JsonSerialization.readValue(configMap, MAP_TYPE_REPRESENTATION); return map.stream().collect(Collectors.toMap(StringPair::getKey, StringPair::getValue)); } catch (IOException e) { throw new RuntimeException("Could not deserialize json: " + configMap, e); } }
Source:
<code>protected void prepareOnAffectedNodes(TxInvocationContext ctx, PrepareCommand command, Collection<Address> recipients, boolean sync) { if (log.isTraceEnabled()) { log.tracef("Total Order Anycast transaction %s with Total Order", command.getGlobalTransaction().prettyPrint()); } if (!ctx.hasModifications()) { return; } if (!ctx.isOriginLocal()) { throw new IllegalStateException("Expected a local context while TO-Anycast prepare command"); } if (!(command instanceof VersionedPrepareCommand)) { throw new IllegalStateException("Expected a Versioned Prepare Command in version aware component"); } try { <START> Set<Object> affectedKeys = getAffectedKeys(command); <END> KeysValidateFilter responseFilter = affectedKeys == null || isSyncCommitPhase() ? null : new KeysValidateFilter(rpcManager.getAddress(), affectedKeys); setVersionsSeenOnPrepareCommand((VersionedPrepareCommand) command, ctx); totalOrderAnycastPrepare(recipients, command, responseFilter); if (responseFilter != null && !responseFilter.isAllKeysValidated()) { throw new CacheException("Not all keys were validated. Possible member has left the cluster"); } } finally { totalOrderTxPrepare(ctx); } }</code><technical_language>ctx.getAffectedKeys() here</technical_language>

Target:
protected void prepareOnAffectedNodes(TxInvocationContext ctx, PrepareCommand command, Collection<Address> recipients, boolean sync) { if (log.isTraceEnabled()) { log.tracef("Total Order Anycast transaction %s with Total Order", command.getGlobalTransaction().globalId()); } if (!ctx.hasModifications()) { return; } if (!ctx.isOriginLocal()) { throw new IllegalStateException("Expected a local context while TO-Anycast prepare command"); } if (!(command instanceof VersionedPrepareCommand)) { throw new IllegalStateException("Expected a Versioned Prepare Command in version aware component"); } try { KeysValidateFilter responseFilter = ctx.getCacheTransaction().hasModification(ClearCommand.class) || isSyncCommitPhase() ? null : new KeysValidateFilter(rpcManager.getAddress(), ctx.getAffectedKeys()); setVersionsSeenOnPrepareCommand((VersionedPrepareCommand) command, ctx); totalOrderAnycastPrepare(recipients, command, responseFilter); if (responseFilter != null && !responseFilter.isAllKeysValidated()) { throw new CacheException("Not all keys were validated. Possible member has left the cluster"); } } finally { totalOrderTxPrepare(ctx); } }
Source:
<code>public void aggregate(ByteBuffer buf, int position) { ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); Object value = valueSelector.getObject(); long time = Long.MAX_VALUE; String firstString = null; if (value instanceof SerializablePairLongString) { SerializablePairLongString serializablePair = (SerializablePairLongString) value; time = serializablePair.lhs; firstString = serializablePair.rhs; } else if (value instanceof String) { time = timeSelector.getLong(); firstString = (String) value; } else if (value != null) { throw new IllegalStateException( "Try to aggregate unsuported class type [" <START> + value.getClass().getName() + <END> "]. Supported class types: String or SerializablePairLongString" ); } long lastTime = mutationBuffer.getLong(position); if (firstString != null && time < lastTime) { if (firstString.length() > maxStringBytes) { firstString = firstString.substring(0, maxStringBytes); } byte[] valueBytes = StringUtils.toUtf8(firstString); mutationBuffer.putLong(position, time); mutationBuffer.putInt(position + Long.BYTES, valueBytes.length); mutationBuffer.position(position + Long.BYTES + Integer.BYTES); mutationBuffer.put(valueBytes); } }</code><technical_language>getCanonicalName() instead</technical_language>

Target:
public void aggregate(ByteBuffer buf, int position) { ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); Object value = valueSelector.getObject(); long time = timeSelector.getLong(); String firstString = null; if (value != null) { if (value instanceof SerializablePairLongString) { SerializablePairLongString serializablePair = (SerializablePairLongString) value; time = serializablePair.lhs; firstString = serializablePair.rhs; } else if (value instanceof String) { firstString = (String) value; } else { throw new ISE( "Try to aggregate unsuported class type [%s].Supported class types: String or SerializablePairLongString", value.getClass().getCanonicalName() ); } } long lastTime = mutationBuffer.getLong(position); if (time < lastTime) { if (firstString != null) { if (firstString.length() > maxStringBytes) { firstString = firstString.substring(0, maxStringBytes); } byte[] valueBytes = StringUtils.toUtf8(firstString); mutationBuffer.putLong(position, time); mutationBuffer.putInt(position + Long.BYTES, valueBytes.length); mutationBuffer.position(position + Long.BYTES + Integer.BYTES); mutationBuffer.put(valueBytes); } else { mutationBuffer.putLong(position, time); mutationBuffer.putInt(position + Long.BYTES, 0); } } }
Source:
<code>public boolean isEnableForComponent(Component invoker) { contextId = -1; if (invoker instanceof JTree && SiteMapPanel.CONTEXT_TREE_COMPONENT_NAME.equals(invoker.getName())) { JTree contextTree = (JTree) invoker; if (!isEnabledForMultipleContexts()) { <START> this.setEnabled(contextTree.getSelectionCount() < 2); <END> } SiteNode node = (SiteNode) contextTree.getLastSelectedPathComponent(); if (node == null || node.isRoot()) { return false; } contextId = ((Target) node.getUserObject()).getContext().getId(); TreePath[] paths = contextTree.getSelectionPaths(); if (paths == null || paths.length == 0) return false; SiteNode[] nodes = Arrays.stream(paths) .map(p -> (SiteNode) p.getLastPathComponent()) .toArray(SiteNode[]::new); if (nodes.length == 1 && nodes[0].isRoot()) return false; Stream<Target> targets = Arrays.stream(nodes).map(n -> (Target) n.getUserObject()); contextIds.clear(); contextIds.addAll( Arrays.asList( targets.map(t -> t.getContext().getId()).toArray(Integer[]::new))); return isEnabledForContext(contextId); } return false; }</code><technical_language>This tweaked return immediately, menu is enabled worth continue</technical_language>

Target:
public boolean isEnableForComponent(Component invoker) { if (invoker instanceof JTree && SiteMapPanel.CONTEXT_TREE_COMPONENT_NAME.equals(invoker.getName())) { JTree contextTree = (JTree) invoker; if (!isEnabledForMultipleContexts()) { if (contextTree.getSelectionCount() < 2) { this.setEnabled(true); } else { this.setEnabled(false); return isEnabledForContext(getContextId()); } } SiteNode node = (SiteNode) contextTree.getLastSelectedPathComponent(); if (node == null || node.isRoot()) { return false; } contextIds.clear(); TreePath[] paths = contextTree.getSelectionPaths(); if (paths == null || paths.length == 0) return false; SiteNode[] nodes = Arrays.stream(paths) .map(p -> (SiteNode) p.getLastPathComponent()) .toArray(SiteNode[]::new); if (nodes.length == 1 && nodes[0].isRoot()) return false; Stream<Target> targets = Arrays.stream(nodes).map(n -> (Target) n.getUserObject()); contextIds.addAll( Arrays.asList( targets.map(t -> t.getContext().getId()).toArray(Integer[]::new))); return isEnabledForContext(getContextId()); } return false; }
Source:
<code>public Map<AttributeSensor, Object> getAttributes() { if (attributesByKey == null) postDeserialize(); <START> return fromPersistedMap(attributesByKey); <END> }</code><technical_language>*ByKey fields transient, need call fromPersistedMap. postDeserialize dealt that</technical_language>

Target:
public Map<AttributeSensor, Object> getAttributes() { if (attributesByKey == null) postDeserialize(); return Collections.unmodifiableMap(attributesByKey); }
Source:
<code>public void update(float delta) { super.update(delta); int numSlots = getNumSlots(); if (numSlots < cells.size()) { <START> for(int i = cells.size()-1; i >= 0; --i) { <END> cells.remove(i); } } else if(numSlots > cells.size()) { for (int i = cells.size(); i < numSlots && i < getMaxCellCount(); ++i) { InventoryCell cell = new InventoryCell(); cell.bindTargetInventory(new ReadOnlyBinding<EntityRef>() { @Override public EntityRef get() { return getTargetEntity(); } }); cell.bindTargetSlot(new SlotBinding(i)); cells.add(cell); } } }</code><technical_language>run Checkstyle address issues reports please? I a couple of minor style issues (mostly missing spaces)</technical_language>

Target:
public void update(float delta) { super.update(delta); int numSlots = getNumSlots(); if (numSlots < cells.size()) { for (int i = cells.size(); i > numSlots && i > 0; --i) { cells.remove(i); } } else if (numSlots > cells.size()) { for (int i = cells.size(); i < numSlots && i < getMaxCellCount(); ++i) { InventoryCell cell = new InventoryCell(); cell.bindTargetInventory(new ReadOnlyBinding<EntityRef>() { @Override public EntityRef get() { return getTargetEntity(); } }); cell.bindTargetSlot(new SlotBinding(i)); cells.add(cell); } } }
Source:
<code>public ITmfTrace getTrace() { ITmfProjectModelElement parent = getParent(); if (parent instanceof TmfExperimentElement) { ITmfTrace parentTrace = ((TmfExperimentElement) parent).getTrace(); if (parentTrace == null) { return null; } <START> for (ITmfEventProvider sibling : parentTrace.getChildren()) { <END> if (sibling instanceof ITmfTrace) { ITmfTrace siblingTrace = (ITmfTrace) sibling; if (getElementUnderTraceFolder().getResource().equals(siblingTrace.getResource())) { return siblingTrace; } } } return null; } return super.getTrace(); }</code><technical_language>This level deep. TmfTraceManager.getTraceSet()</technical_language>

Target:
public ITmfTrace getTrace() { ITmfProjectModelElement parent = getParent(); if (parent instanceof TmfExperimentElement) { IResource resource = getElementUnderTraceFolder().getResource(); ITmfTrace experiment = ((TmfExperimentElement) parent).getTrace(); for (ITmfTrace trace : TmfTraceManager.getTraceSet(experiment)) { if (resource.equals(trace.getResource())) { return trace; } } return null; } return super.getTrace(); }
Source:
<code>public synchronized void init() throws IOException { logger.debug("ConfigurationRepository.init()"); oEntityManager.registerEntityClass(BinaryConfiguration.class, true); <START> transactionTemplate.execute(new TransactionCallback<Object>() <END> { @Override public Object doInTransaction(TransactionStatus status) { if (!schemaExists() || getConfiguration() == null) { try { createSettings(); } catch (IOException e) { throw new RuntimeException(e); } } return null; } }); }</code><technical_language>lambda function Java 8</technical_language>

Target:
public synchronized void init() throws IOException { logger.debug("ConfigurationRepository.init()"); oEntityManager.registerEntityClass(BinaryConfiguration.class, true); transactionTemplate.execute((s) -> { if (!schemaExists() || getConfiguration() == null) { try { createSettings(); } catch (IOException e) { throw new BeanInitializationException(String.format("Failed to init: msg-[%s]", e.getMessage()), e); } } return null; }); }
Source:
<code>public Optional<Long> gettimeofday() { <START> return Optional.of(Math.round(System.nanoTime() / 1_000d)); <END> }</code><technical_language>gettimeofday() microsecond resolution. If nanoTime() it, returns a multiple of 1000. integer division sufficient</technical_language>

Target:
public Optional<Long> gettimeofday() { return this.available ? Optional.of(gettimeofdayRaw()) : Optional.empty(); }
Source:
<code>public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_contributions_list, container, false); ButterKnife.bind(this, view); linearLayoutManager=new LinearLayoutManager(getContext()); gridLayoutManager=new GridLayoutManager(getContext(),3); <START> initAdapter(); <END> return view; }</code><technical_language>Do need initialize layout managers one? below</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_contributions_list, container, false); ButterKnife.bind(this, view); initAdapter(); return view; }
Source:
<code>private void logBrickStatusChange(GlusterVolumeEntity volume, final GlusterBrickEntity brick, final GlusterStatus fetchedStatus) { log.debug("Detected that status of brick '{}' in volume '{}' changed from '{}' to '{}'", brick.getQualifiedName(), volume.getName(), brick.getStatus(), fetchedStatus); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_CHANGED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); put(GlusterConstants.OPTION_OLD_VALUE, brick.getStatus().toString()); put(GlusterConstants.OPTION_NEW_VALUE, fetchedStatus.toString()); } }); <START> if(fetchedStatus.toString().equals("DOWN")){ <END> logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_DOWN, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); } }, brick.getQualifiedName()); }else if(fetchedStatus.toString().equals("UP")){ AlertDirector.RemoveAlertsByBrickVolumeId(volume.getId(), brick.getQualifiedName(), "GLUSTER_BRICK_STATUS_DOWN"); } }</code><technical_language>correct formatting. compare if (fetchedStatus == GlusterStatus.DOWN)</technical_language>

Target:
private void logBrickStatusChange(GlusterVolumeEntity volume, final GlusterBrickEntity brick, final GlusterStatus fetchedStatus) { log.debug("Detected that status of brick '{}' in volume '{}' changed from '{}' to '{}'", brick.getQualifiedName(), volume.getName(), brick.getStatus(), fetchedStatus); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_CHANGED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); put(GlusterConstants.OPTION_OLD_VALUE, brick.getStatus().toString()); put(GlusterConstants.OPTION_NEW_VALUE, fetchedStatus.toString()); } }); if(fetchedStatus == GlusterStatus.DOWN){ logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_DOWN, brick.getId(), brick.getQualifiedName(), new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); } }); }else if(fetchedStatus == GlusterStatus.UP){ AlertDirector.RemoveAlertsByBrickIdLogType(brick.getId(), AuditLogType.GLUSTER_BRICK_STATUS_DOWN); } }
Source:
<code><START> private void populateRangeDefaultsFromJobData(final JobExecutionContext context) { <END> ObjectMapper mapper = new ObjectMapper(); String parametersJson = context.getMergedJobDataMap().getString("parameters"); JsonNode rootNode = null; try { rootNode = mapper.readTree(parametersJson); } catch (Exception e) { LOGGER.error( "Could not determine min and max range values. " + "Using default: " + minRangeInDays + " - " + maxRangeInDays); return; } if (rootNode != null) { JsonNode minNode = rootNode.findValue("min"); if (minNode != null) { minRangeInDays = minNode.asInt(); } JsonNode maxNode = rootNode.findValue("max"); if (maxNode != null) { maxRangeInDays = maxNode.asInt(); } } }</code><technical_language>if this function returned a org.apache.commons.lang3.Range object, similar? current "minRangeInDays maxRangeInDays actual final static constants, Range object returned this function in calling function do a ".contains(range)" for actual</technical_language>

Target:
private void populateRangeDefaultsFromJobData(final JobExecutionContext context) { ObjectMapper mapper = new ObjectMapper(); String parametersJson = context.getMergedJobDataMap().getString("parameters"); JsonNode rootNode = null; try { rootNode = mapper.readTree(parametersJson); } catch (Exception e) { LOGGER.error( String.format("Could not determine min and max range values. Using default: %d - %d.", rangeInDays.getMinimum(), rangeInDays.getMaximum())); return; } if (rootNode != null) { Integer min = rangeInDays.getMinimum(); Integer max = rangeInDays.getMaximum(); JsonNode minNode = rootNode.findValue("min"); if (minNode != null) { min = minNode.asInt(); } JsonNode maxNode = rootNode.findValue("max"); if (maxNode != null) { max = maxNode.asInt(); } rangeInDays = Range.between(min, max); } }
Source:
<code>public void nonVmLanWithDifferentMTUAddedToNic() { Network net = createNetwork("VLanVmMtu9000"); net.setvlan_id(100); net.setMtu(9000); <START> Network newNet = createNetwork("nonVmVLanVmMtu9000"); <END> newNet.setvlan_id(200); newNet.setMtu(5000); newNet.setVmNetwork(false); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", null); VdsNetworkInterface nicWithVlan = createVlan(nic.getName(), net.getvlan_id(), net.getName()); nicWithVlan.setMtu(net.getMtu()); mockExistingIfaces(nic, nicWithVlan); VdsNetworkInterface nicWithNonVmVlan = createVlan(nic.getName(), newNet.getvlan_id(), newNet.getName()); nicWithNonVmVlan.setMtu(newNet.getMtu()); SetupNetworksHelper helper = createHelper(createParametersForNics(nic, nicWithVlan, nicWithNonVmVlan)); validateAndExpectNoViolations(helper); }</code><technical_language>nonVmVLanVmMtu9000 ==> vlanNonVmMtu9000</technical_language>

Target:
public void nonVmLanWithDifferentMTUAddedToNic() { Network net = createNetwork("vlanVmMtu9000"); net.setvlan_id(100); net.setMtu(9000); Network newNet = createNetwork("vlanNonVmMtu9000"); newNet.setvlan_id(200); newNet.setMtu(5000); newNet.setVmNetwork(false); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", null); VdsNetworkInterface nicWithVlan = createVlan(nic.getName(), net.getvlan_id(), net.getName()); nicWithVlan.setMtu(net.getMtu()); mockExistingIfaces(nic, nicWithVlan); VdsNetworkInterface nicWithNonVmVlan = createVlan(nic.getName(), newNet.getvlan_id(), newNet.getName()); nicWithNonVmVlan.setMtu(newNet.getMtu()); SetupNetworksHelper helper = createHelper(createParametersForNics(nic, nicWithVlan, nicWithNonVmVlan)); validateAndExpectNoViolations(helper); }
Source:
<code>public AbstractCounterAspect(String fieldName, String label) { <START> Objects.requireNonNull(fieldName); fFieldName = fieldName; <END> fLabel = label; }</code><technical_language>put this line add exception message</technical_language>

Target:
public AbstractCounterAspect(String fieldName, String label) { fFieldName = fieldName; fLabel = label; }
Source:
<code>private static Document getXmlDocumentFromFile(File file) { try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory <START> .newInstance(); <END> DocumentBuilder dBuilder; dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(file); doc.getDocumentElement().normalize(); return doc; } catch (ParserConfigurationException e) { fail("Xml document parse exception"); } catch (SAXException e) { fail("Exception parsing xml file"); } catch (IOException e) { fail("File io exception"); } return null; }</code><technical_language>wrap</technical_language>

Target:
private static Document getXmlDocumentFromFile(File file) { try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(file); doc.getDocumentElement().normalize(); return doc; } catch (ParserConfigurationException e) { fail("Xml document parse exception"); } catch (SAXException e) { fail("Exception parsing xml file"); } catch (IOException e) { fail("File io exception"); } return null; }
Source:
<code>public void onDateInputBlur(final BlurEvent blurEvent) { final Object target = getEventTarget(blurEvent); <START> if (this.onValueInputBlur != null && !Objects.isNull(target)) { <END> onValueInputBlur.accept(blurEvent); } }</code><technical_language>For consistency, !Objects.isNull(this.onValueInputBlur) && !Objects.isNull(target) please</technical_language>

Target:
public void onDateInputBlur(final BlurEvent blurEvent) { final Object target = getEventTarget(blurEvent); if (!Objects.isNull(onValueInputBlur) && !Objects.isNull(target)) { onValueInputBlur.accept(blurEvent); } }
Source:
<code>private void checkAndUpdatePreviousRequestTimes(Map<String, RequestTime> newRequests) { newRequests.forEach((remoteHost, newRequest) -> { RequestTime previousRequest = previousRequestsByServer.get(remoteHost); if (previousRequest != null) { try { new ClockSkewComparer(remoteHost, events, previousRequest, newRequest).compare(); <START> } catch (IllegalArgumentException exception) { <END> } } previousRequestsByServer.put(remoteHost, newRequest); }); }</code><technical_language>cool, this fixes bug update previousRequestByServer if get exception</technical_language>

Target:
private void checkAndUpdatePreviousRequestTimes(Map<String, RequestTime> newRequests) { newRequests.forEach((remoteHost, newRequest) -> { RequestTime previousRequest = previousRequestsByServer.get(remoteHost); if (previousRequest != null) { new ClockSkewComparer(remoteHost, events, previousRequest, newRequest).compare(); } previousRequestsByServer.put(remoteHost, newRequest); }); }