auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public DependenciesImpl(IAggregator aggregator, long stamp) { Hashtable<String, String> dict = new Hashtable<String, String>(); dict.put("name", aggregator.getName()); this.aggregator = aggregator; this.initStamp = stamp; servletName = aggregator.getName(); initialized = new CountDownLatch(1); shutdownListener = PlatformAggregatorProvider.getPlatformAggregator().registerService(IShutdownListener.class.getName(), this, dict); configUpdateListener= PlatformAggregatorProvider.getPlatformAggregator().registerService(IConfigListener.class.getName(), this, dict); <START> optionsUpdateListener= PlatformAggregatorProvider.getPlatformAggregator().registerService(IOptionsListener.class.getName(), this, dict); <END> if (aggregator.getConfig() != null) { configLoaded(aggregator.getConfig(), 1); } if (aggregator.getOptions() != null) { optionsUpdated(aggregator.getOptions(), 1); } }</code><technical_language>Please reuse dictionary instance register multiple services</technical_language>

Target:
public DependenciesImpl(IAggregator aggregator, long stamp) { Hashtable<String, String> dict; this.aggregator = aggregator; this.initStamp = stamp; servletName = aggregator.getName(); initialized = new CountDownLatch(1); dict = new Hashtable<String, String>(); dict.put("name", aggregator.getName()); shutdownListener = aggregator.getPlatformServices().registerService(IShutdownListener.class.getName(), this, dict); dict = new Hashtable<String, String>(); dict.put("name", aggregator.getName()); configUpdateListener= aggregator.getPlatformServices().registerService(IConfigListener.class.getName(), this, dict); dict = new Hashtable<String, String>(); dict.put("name", aggregator.getName()); optionsUpdateListener= aggregator.getPlatformServices().registerService(IOptionsListener.class.getName(), this, dict); if (aggregator.getConfig() != null) { configLoaded(aggregator.getConfig(), 1); } if (aggregator.getOptions() != null) { optionsUpdated(aggregator.getOptions(), 1); } }
Source:
<code>public ExampleEndpointsProvider() { try { JHttpEndpoint httpEndpoint = new JHttpEndpoint(new URI("<LINK_0>")); <START> endpoints.add(httpEndpoint); <END> } catch (URISyntaxException e) { throw new IllegalStateException(e); } }</code><technical_language>URI.create avoid try/catch</technical_language>

Target:
public ExampleEndpointsProvider() { JHttpEndpoint httpEndpoint = new JHttpEndpoint(URI.create("<LINK_0>")); endpoints.add(httpEndpoint); }
Source:
<code>public boolean equals(Object obj) { return (obj != null) && (obj instanceof GlusterGeoRepSessionDetails) && Objects.equals(getSessionId(), <START> ((GlusterGeoRepSessionDetails) <END> obj).getSessionId()) && Objects.equals(getMasterBrickId(), ((GlusterGeoRepSessionDetails) obj).getMasterBrickId()) && Objects.equals(getSlaveNodeUuid(), ((GlusterGeoRepSessionDetails) obj).getSlaveNodeUuid()) && Objects.equals(getSlaveHostName(), ((GlusterGeoRepSessionDetails) obj).getSlaveHostName()) && Objects.equals(getStatus(), ((GlusterGeoRepSessionDetails) obj).getStatus()) && Objects.equals(getCheckPointStatus(), ((GlusterGeoRepSessionDetails) obj).getCheckPointStatus()) && Objects.equals(getCrawlStatus(), ((GlusterGeoRepSessionDetails) obj).getCrawlStatus()) && Objects.equals(getDataOpsPending(), ((GlusterGeoRepSessionDetails) obj).getDataOpsPending()) && Objects.equals(getMetaOpsPending(), ((GlusterGeoRepSessionDetails) obj).getMetaOpsPending()) && Objects.equals(getEntryOpsPending(), ((GlusterGeoRepSessionDetails) obj).getEntryOpsPending()) && Objects.equals(getCheckPointCompletedAt(), ((GlusterGeoRepSessionDetails) obj).getCheckPointCompletedAt()) && Objects.equals(getCheckPointTime(), ((GlusterGeoRepSessionDetails) obj).getCheckPointTime()) && Objects.equals(getLastSyncedAt(), ((GlusterGeoRepSessionDetails) obj).getLastSyncedAt()) && Objects.equals(getUpdatedAt(), ((GlusterGeoRepSessionDetails) obj).getUpdatedAt()) && Objects.equals(getFailures(), ((GlusterGeoRepSessionDetails) obj).getFailures()) && isCheckpointCompleted() == ((GlusterGeoRepSessionDetails) obj).isCheckpointCompleted(); }</code><technical_language>u do conversion in top in a variable re-use in places</technical_language>

Target:
public boolean equals(Object obj) { if (obj == null || !(obj instanceof GlusterGeoRepSessionDetails)) { return false; } GlusterGeoRepSessionDetails geoRep = (GlusterGeoRepSessionDetails) obj; return Objects.equals(getSessionId(), geoRep.getSessionId()) && Objects.equals(getMasterBrickId(), geoRep.getMasterBrickId()) && Objects.equals(getSlaveNodeUuid(), geoRep.getSlaveNodeUuid()) && Objects.equals(getSlaveHostName(), geoRep.getSlaveHostName()) && Objects.equals(getStatus(), geoRep.getStatus()) && Objects.equals(getCheckPointStatus(), geoRep.getCheckPointStatus()) && Objects.equals(getCrawlStatus(), geoRep.getCrawlStatus()) && Objects.equals(getDataOpsPending(), geoRep.getDataOpsPending()) && Objects.equals(getMetaOpsPending(), geoRep.getMetaOpsPending()) && Objects.equals(getEntryOpsPending(), geoRep.getEntryOpsPending()) && Objects.equals(getCheckPointCompletedAt(), geoRep.getCheckPointCompletedAt()) && Objects.equals(getCheckPointTime(), geoRep.getCheckPointTime()) && Objects.equals(getLastSyncedAt(), geoRep.getLastSyncedAt()) && Objects.equals(getUpdatedAt(), geoRep.getUpdatedAt()) && Objects.equals(getFailures(), geoRep.getFailures()) && isCheckpointCompleted() == geoRep.isCheckpointCompleted(); }
Source:
<code>public void execute() throws MojoExecutionException { appendLogs(); try { String archiveDirectory = getArchiveFile("").getAbsolutePath(); boolean createdArchiveDirectory = org.wso2.developerstudio.eclipse.utils.file.FileUtils.createDirectory( archiveDirectory); if (createdArchiveDirectory) { CAppHandler cAppHandler = new CAppHandler(); List<ArtifactDependency> dependencies = new ArrayList<>(); cAppHandler.processConfigArtifactXmlFile(projectBaseDir, archiveDirectory, dependencies); cAppHandler.processRegistryResourceArtifactXmlFile(projectBaseDir, archiveDirectory, dependencies); cAppHandler.createDependencyArtifactsXmlFile(archiveDirectory, dependencies, project); File fileToZip = new File(archiveDirectory); zipFolder(fileToZip.getPath(), getArchiveFile(".car").getPath()); recursiveDelete(fileToZip); } else { getLog().error("Could not create corresponding archive directory."); } } catch (Exception e) { <START> getLog().error(e); <END> } }</code><technical_language>catch specific exception here, generic? propergate exception caller of execute()</technical_language>

Target:
public void execute() throws MojoExecutionException { appendLogs(); try { String archiveDirectory = getArchiveFile(Constants.EMPTY_STRING).getAbsolutePath(); boolean createdArchiveDirectory = org.wso2.developerstudio.eclipse.utils.file.FileUtils.createDirectory( archiveDirectory); if (createdArchiveDirectory) { CAppHandler cAppHandler = new CAppHandler(); List<ArtifactDependency> dependencies = new ArrayList<>(); cAppHandler.processConfigArtifactXmlFile(projectBaseDir, archiveDirectory, dependencies); cAppHandler.processRegistryResourceArtifactXmlFile(projectBaseDir, archiveDirectory, dependencies); cAppHandler.createDependencyArtifactsXmlFile(archiveDirectory, dependencies, project); File fileToZip = new File(archiveDirectory); zipFolder(fileToZip.getPath(), getArchiveFile(".car").getPath()); recursiveDelete(fileToZip); } else { getLog().error("Could not create corresponding archive directory."); } } catch (XMLStreamException | IOException | ArchiveException e) { getLog().error(e); } }
Source:
<code>protected boolean defineNoStrictVerifyBasedOnXcodeVersion() throws XCodeException { boolean strictVerify = false; <START> if (noStrictVerify == null || noStrictVerify.isEmpty()) { <END> ByteArrayOutputStream bos = new ByteArrayOutputStream(); PrintStream out; int exitCode; try { out = new PrintStream(bos, true, Charset.defaultCharset().name()); exitCode = Forker.forkProcess(out, new File("."), new String[] { "xcodebuild", "-version" }); if (exitCode == 0) { String output = bos.toString(Charset.defaultCharset().name()); DefaultArtifactVersion version = getVersion(output); String buildVersion = getBuildVersion(output); strictVerify = checkVersions(version, buildVersion); return strictVerify; } else { throw new XCodeException( "Could not get xcodebuild version (exit code = " + exitCode + ")"); } } catch (Exception e) { throw new XCodeException( "Could not get xcodebuild version"); } } return strictVerify; }</code><technical_language>else block missing returning correct (true false)</technical_language>

Target:
private boolean defineNoStrictVerifyBasedOnXcodeVersion() throws XCodeException { if (noStrictVerify != null && (noStrictVerify.equalsIgnoreCase("true") || noStrictVerify.equalsIgnoreCase("false"))) { return Boolean.parseBoolean(noStrictVerify); } else { String xCodeVersionString = getXCodeVersionString(); DefaultArtifactVersion version = getVersion(xCodeVersionString); if(checkVersions(version, MIN_XCODE_VERSION_NO_STRICT_VERIFY)) { return DEFAULT_NO_STRICT_VERIFY_FOR_NEW_XCODE; } else { return DEFAULT_NO_STRICT_VERIFY_FOR_OLD_XCODE; } } }
Source:
<code>public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 3) { throw new IAE("Function[%s] needs 3 arguments", name()); } final String arg = args.get(0).eval(bindings).asString(); final String pattern = args.get(1).eval(bindings).asString(); final String replacement = args.get(2).eval(bindings).asString(); if (arg == null) { return ExprEval.of(null); } return ExprEval.of( <START> arg.replace(Strings.nullToEmpty(pattern), Strings.nullToEmpty(replacement)) <END> ); }</code><technical_language>SQL spec nullability of pattern replacement</technical_language>

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 3) { throw new IAE("Function[%s] needs 3 arguments", name()); } final String arg = args.get(0).eval(bindings).asString(); final String pattern = args.get(1).eval(bindings).asString(); final String replacement = args.get(2).eval(bindings).asString(); if (arg == null) { return ExprEval.of(NullHandling.defaultStringValue()); } return ExprEval.of( arg.replace(NullHandling.nullToEmptyIfNeeded(pattern), NullHandling.nullToEmptyIfNeeded(replacement)) ); }
Source:
<code>public SoundType getBreakSound() { <START> return (SoundType) this.breakSound; <END> }</code><technical_language>delegating methods SoundType, fields</technical_language>

Target:
public SoundEvent getBreakSound() { return this.breakSound; }
Source:
<code>protected void sendDmxData() { if (this.thing.getStatus().equals(ThingStatus.ONLINE)) { boolean needsSending = false; long now = System.currentTimeMillis(); universe.calculateBuffer(now); if ((universe.getLastBufferChanged() > lastSend) || refreshAlways) { needsSending = true; repeatCounter = 0; } else if (now - lastSend > 800) { needsSending = true; } else if (repeatCounter < 3) { needsSending = true; repeatCounter++; } if (needsSending) { packetTemplate.setPayload(universe.getBuffer(), universe.getBufferSize()); packetTemplate.setSequence(sequenceNo); DatagramPacket sendPacket = new DatagramPacket(packetTemplate.getRawPacket(), packetTemplate.getPacketLength()); for (IpNode receiverNode : receiverNodes) { sendPacket.setAddress(receiverNode.getAddress()); sendPacket.setPort(receiverNode.getPort()); logger.trace("sending packet with length to {}", packetTemplate.getPacketLength(), receiverNode.toString()); try { socket.send(sendPacket); } catch (IOException e) { <START> logger.warn("Exception in packet sender"); <END> closeConnection(); } } lastSend = now; sequenceNo = (sequenceNo + 1) % 256; } } else { openConnection(); } }</code><technical_language>reduce debug pass message closeConnection update status accordingly</technical_language>

Target:
protected void sendDmxData() { if (this.thing.getStatus().equals(ThingStatus.ONLINE)) { boolean needsSending = false; long now = System.currentTimeMillis(); universe.calculateBuffer(now); if ((universe.getLastBufferChanged() > lastSend) || refreshAlways) { needsSending = true; repeatCounter = 0; } else if (now - lastSend > 800) { needsSending = true; } else if (repeatCounter < 3) { needsSending = true; repeatCounter++; } if (needsSending) { packetTemplate.setPayload(universe.getBuffer(), universe.getBufferSize()); packetTemplate.setSequence(sequenceNo); DatagramPacket sendPacket = new DatagramPacket(packetTemplate.getRawPacket(), packetTemplate.getPacketLength()); for (IpNode receiverNode : receiverNodes) { sendPacket.setAddress(receiverNode.getAddress()); sendPacket.setPort(receiverNode.getPort()); logger.trace("sending packet with length to {}", packetTemplate.getPacketLength(), receiverNode.toString()); try { socket.send(sendPacket); } catch (IOException e) { logger.debug("Could not send to in {}: {}", receiverNode, this.thing.getUID(), e); closeConnection(ThingStatusDetail.COMMUNICATION_ERROR, "could not send DMX data"); } } lastSend = now; sequenceNo = (sequenceNo + 1) % 256; } } else { openConnection(); } }
Source:
<code>public void injectInto(PhoenicisScriptEngine phoenicisScriptEngine) { <START> final Map<String, Object> includedScripts = new HashMap<>(); <END> phoenicisScriptEngine.put("include", (Function<String, Object>) argument -> { if (!includedScripts.containsKey(argument)) { final String script = scriptFetcher.getScript(argument); if (script == null) { throwException(new ScriptException(argument + " is not found")); } includedScripts.put(argument, phoenicisScriptEngine.evalAndReturn(" this::throwException)); } return includedScripts.get(argument); }, this::throwException); }</code><technical_language>add a check for circular dependencies (i.e. A -> B -> A)? This easy implement a Stack</technical_language>

Target:
public void injectInto(PhoenicisScriptEngine phoenicisScriptEngine) { final Map<String, Object> includedScripts = new HashMap<>(); phoenicisScriptEngine.put("include", (Function<String, Object>) argument -> { if (!includedScripts.containsKey(argument)) { final String script = scriptFetcher.getScript(argument); if (script == null) { throwException(new ScriptException("Script '" + argument + "' is not found")); } includedScripts.put(argument, phoenicisScriptEngine.evalAndReturn(" this::throwException)); } return includedScripts.get(argument); }, this::throwException); }
Source:
<code>public long getTimeBucket(long time) { <START> Preconditions.checkArgument(time < 0, "Time: %s is illegal", time); <END> return time - time % getBucketSpan().getMillis(); }</code><technical_language>= 0</technical_language>

Target:
public long getTimeBucket(long time) { Preconditions.checkArgument(time >= 0, "Time: %s is illegal", time); return time - time % getBucketSpan().getMillis(); }
Source:
<code>private boolean createProcessFolder(URI userHomeProcess, URI userHome, Project project, String processTitle) throws IOException { String normalizedTitle = Helper.getNormalizedTitle(processTitle); if (!fileService.delete(userHomeProcess)) { Helper.setErrorMessage(Helper.getTranslation(ERROR_EXPORT, Collections.singletonList(processTitle)), Helper.getTranslation(EXPORT_DIR_DELETE, Collections.singletonList("Import"))); return false; } URI successFolder = URI.create(project.getDmsImportRootPath() + "/" + normalizedTitle); <START> if (!fileService.delete(successFolder)) { <END> Helper.setErrorMessage(Helper.getTranslation(ERROR_EXPORT, Collections.singletonList(processTitle)), Helper.getTranslation(EXPORT_DIR_DELETE, Collections.singletonList("Success"))); return false; } if (!fileService.fileExist(userHomeProcess)) { fileService.createDirectory(userHome, normalizedTitle); } return true; }</code><technical_language>this part removed</technical_language>

Target:
private boolean createProcessFolder(URI userHomeProcess, URI userHome, Project project, String processTitle) throws IOException { String normalizedTitle = Helper.getNormalizedTitle(processTitle); if (!fileService.delete(userHomeProcess)) { Helper.setErrorMessage(Helper.getTranslation(ERROR_EXPORT, Collections.singletonList(processTitle)), Helper.getTranslation(EXPORT_DIR_DELETE, Collections.singletonList("Import"))); return false; } if (!fileService.fileExist(userHomeProcess)) { fileService.createDirectory(userHome, normalizedTitle); } return true; }
Source:
<code>public static void tearDownDomain() throws Exception { setOriginMasterManagementNativeInterface(); reloadMaster(); checkHostStatusOnMaster("master"); masterManagementRealmSetup.tearDown(domainMasterLifecycleUtil.getDomainClient()); testSupport.stop(); testSupport = null; <START> domainMasterLifecycleUtil = null; <END> }</code><technical_language>3 lines in a finally block. If a problem this test, shut processes rest of testsuite screwed up</technical_language>

Target:
public static void tearDownDomain() throws Exception { masterManagementRealmSetup.tearDown(domainMasterLifecycleUtil.getDomainClient()); testSupport.stop(); testSupport = null; domainMasterLifecycleUtil = null; FileUtils.deleteDirectory(WORK_DIR); }
Source:
<code>public void changeMessageCommitFormatMultipleParagraph() throws Exception { Change c = newChange(); ChangeUpdate update = newUpdate(c, changeOwner); update.setChangeMessage("Just a little code change.\nTesting new line" + "\n\nTesting multiple paragraphs."); update.commit(); assertEquals("refs/changes/01/1/meta", update.getRefName()); RevWalk walk = new RevWalk(repo); try { RevCommit commit = walk.parseCommit(update.getRevision()); walk.parseBody(commit); assertEquals("Update patch set 1\n" + "\n" + "Just a little code change.\nTesting new line" <START> + "\n\nTesting multiple paragraphs.\n" <END> + "\n" + "Patch-set: 1\n", commit.getFullMessage()); } finally { walk.release(); } }</code><technical_language>above, split this up</technical_language>

Target:
public void changeMessageCommitFormatMultipleParagraph() throws Exception { Change c = newChange(); ChangeUpdate update = newUpdate(c, changeOwner); update.setChangeMessage("Just a little code change.\n" + "Testing new line\n" + "\n" + "Testing multiple paragraphs."); update.commit(); assertEquals("refs/changes/01/1/meta", update.getRefName()); RevWalk walk = new RevWalk(repo); try { RevCommit commit = walk.parseCommit(update.getRevision()); walk.parseBody(commit); assertEquals("Update patch set 1\n" + "\n" + "Just a little code change.\nTesting new line\n" + "\n" + "Testing multiple paragraphs.\n" + "\n" + "Patch-set: 1\n", commit.getFullMessage()); } finally { walk.release(); } }
Source:
<code>protected Response instantiateStormAndHandleResponse(String templateId, String childJson, String alias, boolean active, AliasManager aliasMan, ItemManager itemMan){ Response response; if (StringUtils.isEmpty(templateId)) { response = Response.status(500).build(); } else { response = instantiateTemplate(templateId, childJson); if (response.getStatus() == HttpStatus.SC_OK) { if (active) { hoistNewTemplateToTopLevel(templateId, itemMan); } if (!StringUtils.isEmpty(alias)) { String originalTemplateId = updateStormAlias(alias, aliasMan, templateId); <START> orphanOriginalTemplate(originalTemplateId, itemMan); <END> } Map<String, Object> ok = new HashMap<String, Object>() { private static final long serialVersionUID = 2398472L; { put("id", templateId); } }; String responseText = GsonUtil.getDefault().toJson(ok, HashMap.class); response = Response.ok(responseText, MediaType.APPLICATION_JSON_TYPE).build(); } } return response; }</code><technical_language>if this is a use-case worry worth asking (@mhines-usgs ?): a check orphan original item attached alias if this storm previous item active storms? I.E: happen in situations: 1. "hurricane-sandy" is pointed active storm, a new active storm is uploaded takes "hurricane-sandy" 2. "hurricane-sandy" is pointed a non-active storm (perhaps archived forecast), a new active storm is uploaded takes "hurricane-sandy" 3. "hurricane-sandy" is pointed a non-storm Item, a new active storm is uploaded takes "hurricane-sandy" 4. "hurricane sandy" is pointed of above, a new non-active storm is uploaded takes "hurricane-sandy"</technical_language>

Target:
protected Response instantiateStormAndHandleResponse(String templateId, String childJson, String alias, boolean active, AliasManager aliasMan, ItemManager itemMan){ Response response; if (StringUtils.isEmpty(templateId)) { response = Response.status(500).build(); } else { response = instantiateTemplate(templateId, childJson); if (response.getStatus() == HttpStatus.SC_OK) { if (active) { hoistNewTemplateToTopLevel(templateId, itemMan); } if (!StringUtils.isEmpty(alias)) { String originalTemplateId = updateStormAlias(alias, aliasMan, templateId); if (active) { orphanOriginalStormTemplate(originalTemplateId, itemMan); } } Map<String, Object> ok = new HashMap<String, Object>() { private static final long serialVersionUID = 2398472L; { put("id", templateId); } }; String responseText = GsonUtil.getDefault().toJson(ok, HashMap.class); response = Response.ok(responseText, MediaType.APPLICATION_JSON_TYPE).build(); } } return response; }
Source:
<code>public static SimpleOptionData toOption(final CapFloorIbor caplet, final MulticurveProviderInterface curves) { ArgumentChecker.notNull(caplet, "caplet"); ArgumentChecker.notNull(curves, "null yield curves"); final double fwd = caplet.accept(PRC, curves); final double t = caplet.getFixingTime(); <START> final double df = curves.getDiscountFactor(caplet.getCurrency(), caplet.getPaymentTime()) * caplet.getPaymentYearFraction(); <END> SimpleOptionData options = new SimpleOptionData(fwd, caplet.getStrike(), t, df, caplet.isCap()); return options; }</code><technical_language>final necessary x3</technical_language>

Target:
public static SimpleOptionData toOption(final CapFloorIbor caplet, final MulticurveProviderInterface curves) { ArgumentChecker.notNull(caplet, "caplet"); ArgumentChecker.notNull(curves, "null yield curves"); double fwd = caplet.accept(PRC, curves); double t = caplet.getFixingTime(); double df = curves.getDiscountFactor(caplet.getCurrency(), caplet.getPaymentTime()) * caplet.getPaymentYearFraction(); SimpleOptionData options = new SimpleOptionData(fwd, caplet.getStrike(), t, df, caplet.isCap()); return options; }
Source:
<code><START> public int getURLStatus(String URL) { <END> try { purge(URL); HttpURLConnection.setFollowRedirects(false); HttpURLConnection connection = (HttpURLConnection) new URL(URL).openConnection(); connection.disconnect(); connection.setRequestMethod("GET"); connection.setRequestProperty( "User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) " + "Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)" ); int status = connection.getResponseCode(); connection.disconnect(); return status; } catch (IOException e) { e.printStackTrace(); return 1; } catch (Exception e) { e.printStackTrace(); return 2; } }</code><technical_language>add a short description, method is non-trivial</technical_language>

Target:
public int getURLStatus(String URL) { try { purge(URL); HttpURLConnection.setFollowRedirects(false); HttpURLConnection connection = (HttpURLConnection) new URL(URL).openConnection(); connection.disconnect(); connection.setRequestMethod("GET"); connection.setRequestProperty( "User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) " + "Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)" ); int status = connection.getResponseCode(); connection.disconnect(); return status; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>public BugzillaRestConfiguration getRepositoryConfiguration(TaskRepository repository) throws CoreException { if (clientCache.getIfPresent(repository.getId()) == null) { getClient(repository); } try { return configurationCache.get(repository.getId()); } catch (UncheckedExecutionException e) { <START> if (!e.getMessage().startsWith( <END> "com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key")) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, e.getMessage(), e)); } else { return null; } } catch (ExecutionException e) { if (!e.getMessage().startsWith("CacheLoader returned null for key")) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, e.getMessage(), e)); } } return null; }</code><technical_language>Also, return CoreException in some cases, null in others? handling this differently depending result</technical_language>

Target:
public BugzillaRestConfiguration getRepositoryConfiguration(TaskRepository repository) throws CoreException { if (clientCache.getIfPresent(new RepositoryKey(repository)) == null) { getClient(repository); } try { return configurationCache.get(new RepositoryKey(repository)); } catch (UncheckedExecutionException e) { if (!e.getMessage().startsWith( "com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key")) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, e.getMessage(), e)); } else { return null; } } catch (ExecutionException e) { if (!e.getMessage().startsWith("CacheLoader returned null for key")) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, e.getMessage(), e)); } } return null; }
Source:
<code>private static Object compileExpression(String code, Class<?> implClass, String[] params, String[] defaultImports) { List<String> imports = new LinkedList<>(); if (defaultImports != null && defaultImports.length != 0) { for (String defaultImport : defaultImports) { <START> if (!defaultImport.startsWith("static")) { <END> imports.add("static " + defaultImport); } else { imports.add(defaultImport); } } } IScriptEvaluator se; try { se = CompilerFactoryFactory.getDefaultCompilerFactory().newScriptEvaluator(); se.setDefaultImports(imports.toArray(new String[imports.size()])); } catch (Exception ex) { throw new RuntimeException(ex); } try { logger.debug("code: {}", code); return se.createFastEvaluator(code, implClass, params); } catch (CompileException ex) { throw new RuntimeException(ex); } }</code><technical_language>is intention making imports static here</technical_language>

Target:
private static Object compileExpression(String code, Class<?> implClass, String[] params, String[] defaultImports) { List<String> imports = new LinkedList<>(); if (defaultImports != null && defaultImports.length != 0) { for (String defaultImport : defaultImports) { if (defaultImport != null) { if (!defaultImport.startsWith("static")) { imports.add("static " + defaultImport); } else { imports.add(defaultImport); } } } } IScriptEvaluator se; try { se = CompilerFactoryFactory.getDefaultCompilerFactory().newScriptEvaluator(); se.setDefaultImports(imports.toArray(new String[imports.size()])); } catch (Exception ex) { throw new RuntimeException(ex); } try { logger.debug("code: {}", code); return se.createFastEvaluator(code, implClass, params); } catch (CompileException ex) { throw new RuntimeException(ex); } }
Source:
<code>void setEntryId(long entryId) { <START> this.entryId = entryId; <END> lh.distributionSchedule.getWriteSet(entryId, writeSet); }</code><technical_language>If move allocation constructor w a write set full of zeroes valid. In previous code NPE occur in case of missed call setentryid. I caught kind of error while playing ledger handleadv</technical_language>

Target:
void setEntryId(long entryId) { this.entryId = entryId; }
Source:
<code>public T read() { Resource resource; resource = getResource(); if (!resource.exists()) { return null; } try (InputStream inputStream = new BufferedInputStream(resource.getInputStream())) { JavaType type = yamlMapper.getTypeFactory().constructType(myClazz); <START> return yamlMapper.readValue(inputStream, type); <END> } catch (IOException e) { throw new UndeclaredThrowableException(e); } }</code><technical_language>myClazz here, JavaType conversion</technical_language>

Target:
public synchronized T read() { Resource resource = getResource(); if (!resource.exists()) { return null; } try (InputStream inputStream = new BufferedInputStream(resource.getInputStream())) { return yamlMapper.readValue(inputStream, myClazz); } catch (IOException e) { throw new UndeclaredThrowableException(e); } }
Source:
<code>private DirContext bindAsUser(String username, String password) { String bindPrincipal = createBindPrincipal(username); contextSource.setUrl(url); <START> contextSource.setUserDn(bindPrincipal); <END> contextSource.setPassword(password); if(contextEnvironmentProperties != null) { contextSource.setBaseEnvironmentProperties(contextEnvironmentProperties); } contextSource.afterPropertiesSet(); try { return contextSource.getContext(bindPrincipal, password); } catch (org.springframework.ldap.NamingException e) { if ((e.getCause() instanceof AuthenticationException) || (e.getCause() instanceof OperationNotSupportedException)) { handleBindException(bindPrincipal, (NamingException) e.getCause()); throw badCredentials(e); } else { throw e; } } }</code><technical_language>This is a race condition setting a stack variable a member variable</technical_language>

Target:
private DirContext bindAsUser(String username, String password) { final String bindUrl = url; Hashtable<String, Object> env = new Hashtable<>(); env.put(Context.SECURITY_AUTHENTICATION, "simple"); String bindPrincipal = createBindPrincipal(username); env.put(Context.SECURITY_PRINCIPAL, bindPrincipal); env.put(Context.PROVIDER_URL, bindUrl); env.put(Context.SECURITY_CREDENTIALS, password); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.OBJECT_FACTORIES, DefaultDirObjectFactory.class.getName()); if(contextEnvironmentProperties != null) { env.putAll(contextEnvironmentProperties); } try { return contextFactory.createContext(env); } catch (NamingException e) { if ((e instanceof AuthenticationException) || (e instanceof OperationNotSupportedException)) { handleBindException(bindPrincipal, e); throw badCredentials(e); } else { throw LdapUtils.convertLdapException(e); } } }
Source:
<code>public void createControl(Composite parent, final FormToolkit toolkit) { if (taskReviewStore != null) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); } if (reviews == null || reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); populateReviews(reviewContainers); selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, true); section.setText(section.getText()); createContents(toolkit, section); <START> section.addExpansionListener(new ExpansionAdapter()); <END> setSection(toolkit, section); }</code><technical_language>This is needed all</technical_language>

Target:
public void createControl(Composite parent, final FormToolkit toolkit) { if (taskReviewStore != null) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); } if (reviews == null || reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); populateReviews(reviewContainers); selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, true); section.setText(section.getText()); createContents(toolkit, section); setSection(toolkit, section); }
Source:
<code>public String generateModelElementId(EObject eObject, ESObjectContainer<ModelElementId> collection) { if (EGenericType.class.isInstance(eObject)) { final EGenericType eGeneric = EGenericType.class.cast(eObject); if (eGeneric.eContainer() != null && <START> eGeneric.eContainer() != this <END> && collection.contains(eGeneric.eContainer())) { final ModelElementId containerId = collection.getModelElementId(eGeneric.eContainer()); return containerId.getId() + ID_SUFFIX; } } return null; }</code><technical_language>This is wrong, CP error :),this check collection this</technical_language>

Target:
public String generateModelElementId(EObject eObject, ESObjectContainer<ModelElementId> collection) { if (EGenericType.class.isInstance(eObject)) { final EGenericType eGeneric = EGenericType.class.cast(eObject); if (eGeneric.eContainer() != null && eGeneric.eContainer() != collection && collection.contains(eGeneric.eContainer())) { final ModelElementId containerId = collection.getModelElementId(eGeneric.eContainer()); return containerId.getId() + ID_SUFFIX; } } return null; }
Source:
<code>public static void setupSystemProperties() { <START> int freePort = TestUtilGit.findFreePort(); <END> System.setProperty("org.uberfire.nio.git.daemon.port", String.valueOf(freePort)); logger.info("Git port used:{}", freePort); System.setProperty("org.uberfire.nio.git.daemon.enabled", "false"); System.setProperty("org.uberfire.nio.git.ssh.enabled", "false"); System.setProperty("org.uberfire.sys.repo.monitor.disabled", "true"); }</code><technical_language>a note consistency: sense find free port set system property if setting org.uberfire.nio.git.daemon.enabled=false lines that</technical_language>

Target:
public static void setupSystemProperties() { System.setProperty("org.uberfire.nio.git.daemon.enabled", "false"); System.setProperty("org.uberfire.nio.git.ssh.enabled", "false"); System.setProperty("org.uberfire.sys.repo.monitor.disabled", "true"); }
Source:
<code><V extends Value<E>, E> Collection<DataProvider<V, E>> getProvidersFor(Key<V> key) throws UnregisteredKeyException; Optional<DataStore> getDataStore(TypeToken<? extends DataHolder> token); Iterable<Key<?>> getKeys(); PluginContainer getPluginContainer(); <START> static <T> DataRegistration of(Key<Value<T>> key, Class<? extends DataHolder>... dataHolders) { <END> final DataStore dataStore = DataStore.of(key, DataQuery.of(key.getKey().getNamespace(), key.getKey().getValue()), dataHolders); return DataRegistration.builder().dataKey(key).store(dataStore).key(key.getKey()).build(); }</code><technical_language>intending able call DataRegistration.of(Keys.FOO)? varargs a length of 0 omitting argument altogether in this case (this is historically Object, Object... method signature, ensure argument passed in</technical_language>

Target:
<V extends Value<E>, E> Collection<DataProvider<V, E>> getProvidersFor(Key<V> key) throws UnregisteredKeyException; Optional<DataStore> getDataStore(TypeToken<? extends DataHolder> token); Iterable<Key<?>> getKeys(); PluginContainer getPluginContainer(); static <T> DataRegistration of(Key<Value<T>> key, Class<? extends DataHolder> dataHolder, Class<? extends DataHolder>... dataHolders) { final DataStore dataStore = DataStore.of(key, DataQuery.of(key.getKey().getNamespace(), key.getKey().getValue()), dataHolder, dataHolders); return DataRegistration.builder().dataKey(key).store(dataStore).key(key.getKey()).build(); }
Source:
<code>public boolean remove(String lookupName) { <START> LookupExtractor lookupExtractor = lookupMap.remove(lookupName); <END> if (lookupExtractor != null) { try { LOGGER.debug("Removing lookup [%s]", lookupName); lookupExtractor.close(); } catch (IOException e) { LOGGER.error(e, "Got exception while closing lookup [%s]", lookupName); } return true; } return false; }</code><technical_language>suggest final</technical_language>

Target:
public boolean remove(String lookupName) { final LookupExtractorFactory lookupExtractorFactory = lookupMap.remove(lookupName); if (lookupExtractorFactory != null) { LOGGER.debug("Removing lookup [%s]", lookupName); return lookupExtractorFactory.close(); } return false; }
Source:
<code>private String iso3Code(Country country) { <START> return new Locale("en", country.code()).getISO3Country().toLowerCase(); <END> }</code><technical_language>Locale.ENGLISH</technical_language>

Target:
private String iso3Code(Country country) { return new Locale(Locale.ENGLISH.getLanguage(), country.code()).getISO3Country().toLowerCase(); }
Source:
<code>public int getHostAvailableMemoryLimit(VDS curVds) { if (curVds.getMemCommited() != null && curVds.getPhysicalMemMb() != null && curVds.getReservedMem() != null <START> && curVds.getSwapTotal() != null) { <END> double vdsCurrentMem = getVdsCurrentReservedMemory(curVds); double vdsMemLimit = getVdsMemLimit(curVds); return (int) (vdsMemLimit - vdsCurrentMem); } return 0; }</code><technical_language>swap removed</technical_language>

Target:
public int getHostAvailableMemoryLimit(VDS curVds) { if (curVds.getMemCommited() != null && curVds.getPhysicalMemMb() != null && curVds.getReservedMem() != null) { double vdsCurrentMem = getVdsCurrentMemoryInUse(curVds); double vdsMemLimit = getVdsMemLimit(curVds); return (int) (vdsMemLimit - vdsCurrentMem); } return 0; }
Source:
<code>public SearchResults filterResults(SearchResults searchResults) { List<PageTitle> filteredResults = new ArrayList<>(); List<PageTitle> results = searchResults.getPageTitles(); for (int i = 0, count = 0; i < results.size() && count < maxItems; i++) { final PageTitle res = results.get(i); if (!title.equalsIgnoreCase(res.getPrefixedText()) && (!requireThumbnail || res.getThumbUrl() != null) <START> && !(res.hasProperties() && (res.isMainPage() || res.isDisambiguationPage()))) { <END> filteredResults.add(res); count++; } } return new SearchResults(filteredResults, null, null); }</code><technical_language>isMainPage() isDisambiguationPage return false properties present, need check hasProperties()</technical_language>

Target:
public SearchResults filterResults(SearchResults searchResults) { List<PageTitle> filteredResults = new ArrayList<>(); List<PageTitle> results = searchResults.getPageTitles(); for (int i = 0, count = 0; i < results.size() && count < maxItems; i++) { final PageTitle res = results.get(i); if (!title.equalsIgnoreCase(res.getPrefixedText()) && (!requireThumbnail || res.getThumbUrl() != null) && !(res.isMainPage() || res.isDisambiguationPage())) { filteredResults.add(res); count++; } } return new SearchResults(filteredResults, null, null); }
Source:
<code>protected void onFinishInflate() { super.onFinishInflate(); View.inflate(getContext(), R.layout.merge_download_batch_status, this); downloadBatchStatusView = findViewById(R.id.download_batch_status); <START> View pauseDownloadView = findViewById(R.id.button_pause_downloading); <END> View resumeDownloadView = findViewById(R.id.button_resume_downloading); pauseDownloadView.setOnClickListener(view -> { if (downloadBatchStatusListener == null) { return; } downloadBatchStatusListener.onBatchPaused(); }); resumeDownloadView.setOnClickListener(view -> { if (downloadBatchStatusListener == null) { return; } downloadBatchStatusListener.onBatchResumed(); }); }</code><technical_language>avoid local variables if create a NO_OP implementation for DownloadBatchStatusListener collapse this code in lines</technical_language>

Target:
protected void onFinishInflate() { super.onFinishInflate(); View.inflate(getContext(), R.layout.merge_download_batch_status, this); statusTextView = findViewById(R.id.download_batch_status); findViewById(R.id.button_pause_downloading).setOnClickListener(view -> downloadBatchStatusListener.onBatchPaused()); findViewById(R.id.button_resume_downloading).setOnClickListener(view -> downloadBatchStatusListener.onBatchResumed()); }
Source:
<code>public MemoryDrain(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); <START> this.getSpellAbility().addEffect(new CounterSourceEffect()); <END> this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addEffect(new ScryEffect(2)); }</code><technical_language>this CounterTargetEffect</technical_language>

Target:
public MemoryDrain(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addEffect(new ScryEffect(2)); }
Source:
<code>private Object getOutputChannelFromRoutingSlip(Object reply, Message<?> requestMessage, List<?> routingSlip, AtomicInteger routingSlipIndex) { <START> if (routingSlip.size() == routingSlipIndex.get()) { <END> return null; } Object path = routingSlip.get(routingSlipIndex.get()); Object routingSlipPathValue = null; if (path instanceof String) { routingSlipPathValue = getBeanFactory().getBean((String) path); } else if (path instanceof RoutingSlipRouteStrategy) { routingSlipPathValue = path; } else { throw new IllegalArgumentException("The RoutingSlip 'path' can be of " + "String or RoutingSlipRouteStrategy type, but gotten: " + path); } if (routingSlipPathValue instanceof MessageChannel) { routingSlipIndex.incrementAndGet(); return routingSlipPathValue; } else { String nextPath = ((RoutingSlipRouteStrategy) routingSlipPathValue).getNextPath(requestMessage, reply); if (StringUtils.hasText(nextPath)) { return nextPath; } else { routingSlipIndex.incrementAndGet(); return getOutputChannelFromRoutingSlip(reply, requestMessage, routingSlip, routingSlipIndex); } } }</code><technical_language>I guess <= safe</technical_language>

Target:
private Object getOutputChannelFromRoutingSlip(Object reply, Message<?> requestMessage, List<?> routingSlip, AtomicInteger routingSlipIndex) { if (routingSlipIndex.get() >= routingSlip.size()) { return null; } Object path = routingSlip.get(routingSlipIndex.get()); Object routingSlipPathValue = null; if (path instanceof String) { routingSlipPathValue = getBeanFactory().getBean((String) path); } else if (path instanceof RoutingSlipRouteStrategy) { routingSlipPathValue = path; } else { throw new IllegalArgumentException("The RoutingSlip 'path' can be of " + "String or RoutingSlipRouteStrategy type, but gotten: " + path); } if (routingSlipPathValue instanceof MessageChannel) { routingSlipIndex.incrementAndGet(); return routingSlipPathValue; } else { String nextPath = ((RoutingSlipRouteStrategy) routingSlipPathValue).getNextPath(requestMessage, reply); if (StringUtils.hasText(nextPath)) { return nextPath; } else { routingSlipIndex.incrementAndGet(); return getOutputChannelFromRoutingSlip(reply, requestMessage, routingSlip, routingSlipIndex); } } }
Source:
<code>public int hashCode() { int result = id; result = 31 * result + (name != null ? name.hashCode() : 0); <START> return result; <END> }</code><technical_language>Ditto for java.util.Objects.hash(Object...)</technical_language>

Target:
public int hashCode() { return Objects.hash(id, name); }
Source:
<code>public boolean oldValueRequired() { CacheContinuousQueryHandler hnd0 = cacheHandler(); <START> if (hnd0 == null) return false; return hnd0.oldValueRequired(); <END> }</code><technical_language>simplified: return hnd0 != null && hnd0.oldValueRequired();</technical_language>

Target:
public boolean oldValueRequired() { CacheContinuousQueryHandler hnd0 = cacheHandler(); return hnd0 != null && hnd0.oldValueRequired(); }
Source:
<code>public BaseResourceSelectionComposite(Composite parent, int style) { super(parent, style | SWT.CHECK); SarosPluginContext.initComponent(this); super.setLayout(LayoutUtils.createGridLayout()); this.checkboxTreeViewer = getViewer(); this.checkboxTreeViewer.getControl().setLayoutData(LayoutUtils.createFillGridData()); this.checkboxTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot()); this.checkboxTreeViewer.addCheckStateListener(checkStateListener); addDisposeListener(e -> checkboxTreeViewer.removeCheckStateListener(checkStateListener)); this.checkboxTreeViewer.addFilter(sharedResourcesFilter); this.resourceSelectionListeners = new ArrayList<>(); this.selectedBaseResources = new ArrayList<>(); <START> this.lastSelected = new Stack<>(); <END> this.prevSelected = new Stack<>(); }</code><technical_language>I is copy paste, stack is synchronized here</technical_language>

Target:
public BaseResourceSelectionComposite(Composite parent, int style) { super(parent, style | SWT.CHECK); SarosPluginContext.initComponent(this); super.setLayout(LayoutUtils.createGridLayout()); this.checkboxTreeViewer = getViewer(); this.checkboxTreeViewer.getControl().setLayoutData(LayoutUtils.createFillGridData()); this.checkboxTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot()); this.checkboxTreeViewer.addCheckStateListener(checkStateListener); addDisposeListener(e -> checkboxTreeViewer.removeCheckStateListener(checkStateListener)); this.checkboxTreeViewer.addFilter(sharedResourcesFilter); this.resourceSelectionListeners = new ArrayList<>(); this.selectedBaseContainers = new ArrayList<>(); this.lastSelected = new LinkedList<>(); this.prevSelected = new LinkedList<>(); }
Source:
<code>public void testRead() throws Exception { seekAndVerify(50); byte[] b = new byte[200]; blockStream.read(b, 0, 200); <START> matchWithInputData(b, 50, 250); <END> Assert.assertEquals(250, blockStream.getPos()); Assert.assertEquals(2, blockStream.getChunkIndex()); }</code><technical_language>too, seek, read continue read, verify in read, reading continuing data not</technical_language>

Target:
public void testRead() throws Exception { seekAndVerify(50); byte[] b = new byte[200]; blockStream.read(b, 0, 200); matchWithInputData(b, 50, 200); Assert.assertEquals(250, blockStream.getPos()); Assert.assertEquals(2, blockStream.getChunkIndex()); }
Source:
<code><START> public CosemObisCode(final int[] code) { <END> if (code.length != 6) { throw new IllegalArgumentException("ObisCode must have 6 values: " + code.length); } this.a = code[0]; this.b = code[1]; this.c = code[2]; this.d = code[3]; this.e = code[4]; this.f = code[5]; this.checkValues(); }</code><technical_language>I if in this occasion suppress warning, remove this constructor</technical_language>

Target:
public CosemObisCode(final int[] code) { if (code.length != 6) { throw new IllegalArgumentException("ObisCode must have 6 values: " + code.length); } this.a = code[0]; this.b = code[1]; this.c = code[2]; this.d = code[3]; this.e = code[4]; this.f = code[5]; this.checkValues(this.a, this.b, this.c, this.d, this.e, this.f); }
Source:
<code>protected static List<ImageDescriptor> getImages(String value, Bundle definingBundle) { <START> List<URL> urls = getURLs(value, definingBundle); <END> if (urls == null || urls.isEmpty()) { return Collections.emptyList(); } List<ImageDescriptor> images = new ArrayList<>(urls.size()); urls.forEach(u -> images.add(ImageDescriptor.createFromURL(u))); return images; }</code><technical_language>shorter Stream#map Stream#collect</technical_language>

Target:
protected static List<ImageDescriptor> getImages(String value, Bundle definingBundle) { List<URL> urls = getURLs(value, definingBundle); if (urls.isEmpty()) { return Collections.emptyList(); } return urls.stream().map(u -> ImageDescriptor.createFromURL(u)) .collect(Collectors.toList()); }
Source:
<code>protected VirtualGuestBlockDeviceTemplateGroup(int id, @Nullable String name, @Nullable String globalIdentifier, int statusId, int accountId, int parentId, @Nullable String summary, @Nullable Set<VirtualGuestBlockDeviceTemplateGroup> children, @Nullable Set<VirtualGuestBlockDeviceTemplate> blockDevices) { this.id = checkNotNull(id, "id"); this.name = name; this.globalIdentifier = globalIdentifier; this.statusId = checkNotNull(statusId, "statusId"); this.accountId = checkNotNull(accountId, "accountId"); <START> this.parentId = checkNotNull(parentId, "parentId"); <END> this.summary = summary; this.children = children == null ? ImmutableSet.<VirtualGuestBlockDeviceTemplateGroup>of() : ImmutableSet.copyOf(children); this.blockDevices = blockDevices == null ? ImmutableSet.<VirtualGuestBlockDeviceTemplate>of() : ImmutableSet.copyOf(blockDevices); }</code><technical_language>here, primitives null</technical_language>

Target:
protected VirtualGuestBlockDeviceTemplateGroup(int id, @Nullable String name, @Nullable String globalIdentifier, int statusId, int accountId, int parentId, @Nullable String summary, @Nullable Set<VirtualGuestBlockDeviceTemplateGroup> children, @Nullable Set<VirtualGuestBlockDeviceTemplate> blockDevices) { this.id = id; this.name = name; this.globalIdentifier = globalIdentifier; this.statusId = statusId; this.accountId = accountId; this.parentId = parentId; this.summary = summary; this.children = children == null ? ImmutableSet.<VirtualGuestBlockDeviceTemplateGroup>of() : ImmutableSet.copyOf(children); this.blockDevices = blockDevices == null ? ImmutableSet.<VirtualGuestBlockDeviceTemplate>of() : ImmutableSet.copyOf(blockDevices); }
Source:
<code>public int hashCode() { <START> final int prime = 31; <END> int result = 1; result = prime * result + desiredCaretPosition; result = prime * result + ((message == null) ? 0 : message.hashCode()); return result; }</code><technical_language>return Objects.hashCode(message, Integer.valueOf(desiredCaretPosition));</technical_language>

Target:
public int hashCode() { return Objects.hash(message, Integer.valueOf(desiredCaretPosition)); }