auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public byte[] performRequest(String endpointUrl, List<NameValuePair> params) throws IOException, OutOfMemoryError { <END> if (MPConfig.DEBUG) Log.d(LOGTAG, "Attempting request to " + endpointUrl); byte[] response = null; int retries = 0; boolean succeeded = false; while (retries < 3 && !succeeded) { InputStream in = null; OutputStream out = null; BufferedOutputStream bout = null; HttpURLConnection connection = null; try { final URL url = new URL(endpointUrl); connection = (HttpURLConnection) url.openConnection(); connection.setConnectTimeout(2000); connection.setReadTimeout(10000); if (null != params) { connection.setDoOutput(true); final UrlEncodedFormEntity form = new UrlEncodedFormEntity(params, "UTF-8"); connection.setRequestMethod("POST"); connection.setFixedLengthStreamingMode((int)form.getContentLength()); out = connection.getOutputStream(); bout = new BufferedOutputStream(out); form.writeTo(bout); bout.close(); bout = null; out.close(); out = null; } in = connection.getInputStream(); response = slurp(in); in.close(); in = null; succeeded = true; } catch (final EOFException e) { if (MPConfig.DEBUG) Log.d(LOGTAG, "Failure to connect, likely caused by a known issue with Android lib. Retrying."); retries = retries + 1; } finally { if (null != bout) try { bout.close(); } catch (final IOException e) { ; } if (null != out) try { out.close(); } catch (final IOException e) { ; } if (null != in) try { in.close(); } catch (final IOException e) { ; } if (null != connection) connection.disconnect(); } } return response; }</code><technical_language>need declare OutOfMemoryError here, a runtime exception</technical_language>

Target:
public byte[] performRequest(String endpointUrl, List<NameValuePair> params) throws IOException { if (MPConfig.DEBUG) Log.d(LOGTAG, "Attempting request to " + endpointUrl); byte[] response = null; int retries = 0; boolean succeeded = false; while (retries < 3 && !succeeded) { InputStream in = null; OutputStream out = null; BufferedOutputStream bout = null; HttpURLConnection connection = null; try { final URL url = new URL(endpointUrl); connection = (HttpURLConnection) url.openConnection(); connection.setConnectTimeout(2000); connection.setReadTimeout(10000); if (null != params) { connection.setDoOutput(true); final UrlEncodedFormEntity form = new UrlEncodedFormEntity(params, "UTF-8"); connection.setRequestMethod("POST"); connection.setFixedLengthStreamingMode((int)form.getContentLength()); out = connection.getOutputStream(); bout = new BufferedOutputStream(out); form.writeTo(bout); bout.close(); bout = null; out.close(); out = null; } in = connection.getInputStream(); response = slurp(in); in.close(); in = null; succeeded = true; } catch (final EOFException e) { if (MPConfig.DEBUG) Log.d(LOGTAG, "Failure to connect, likely caused by a known issue with Android lib. Retrying."); retries = retries + 1; } finally { if (null != bout) try { bout.close(); } catch (final IOException e) { ; } if (null != out) try { out.close(); } catch (final IOException e) { ; } if (null != in) try { in.close(); } catch (final IOException e) { ; } if (null != connection) connection.disconnect(); } } return response; }
Source:
<code>private void setUpHttpLogging() throws IOException { if ( !getConfig().get( http_logging_enabled ) ) { return; } AsyncRequestLog requestLog = new AsyncRequestLog( dependencyResolver.resolveDependency( FileSystemAbstraction.class ), <START> config.get( GraphDatabaseSettings.log_timezone ).getZoneId(), <END> config.get( http_log_path ).toString(), config.get( http_logging_rotation_size ), config.get( http_logging_rotation_keep_number ) ); webServer.setRequestLog( requestLog ); }</code><technical_language>Static import, for consistency? :)</technical_language>

Target:
private void setUpHttpLogging() throws IOException { if ( !getConfig().get( http_logging_enabled ) ) { return; } AsyncRequestLog requestLog = new AsyncRequestLog( dependencyResolver.resolveDependency( FileSystemAbstraction.class ), config.get( log_timezone ).getZoneId(), config.get( http_log_path ).toString(), config.get( http_logging_rotation_size ), config.get( http_logging_rotation_keep_number ) ); webServer.setRequestLog( requestLog ); }
Source:
<code>public CandidateWidget(Candidate candidate, int nbOfVotes) { widget = binder.createAndBindUi(this); <START> company.setInnerHTML(candidate.getCompany()); <END> name.setInnerHTML(candidate.getName()); image.setResource(candidate.getPicture()); nbVotes.setInnerHTML(String.valueOf(nbOfVotes)); }</code><technical_language>setInnerText() prevent browser parsing it</technical_language>

Target:
public CandidateWidget(Candidate candidate, int nbOfVotes) { widget = binder.createAndBindUi(this); company.setInnerText(candidate.getCompany()); name.setInnerText(candidate.getName()); if (candidate.getPicture() != null) { image.setResource(candidate.getPicture()); } nbVotes.setInnerText(String.valueOf(nbOfVotes)); }
Source:
<code>public void onEntityPickup(EntityPickupItemEvent e) { if (SlimefunUtils.hasNoPickupFlag(e.getItem())) { e.setCancelled(true); } else if (e.getItem().getItemStack().hasItemMeta() && e.getItem().getItemStack().getItemMeta().hasDisplayName() && e.getItem().getItemStack().getItemMeta().getDisplayName().startsWith(ITEM_PREFIX)) { e.setCancelled(true); e.getItem().remove(); } else if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { <START> if (e.getEntityType().equals(EntityType.PIGLIN)) { <END> if (SlimefunItem.getByItem(e.getItem().getItemStack()) != null) { e.setCancelled(true); } } } }</code><technical_language>Enum comparisons done == instead of .equals() allows JVM do premature eliminations compiler-time runtime</technical_language>

Target:
public void onEntityPickup(EntityPickupItemEvent e) { if (SlimefunUtils.hasNoPickupFlag(e.getItem())) { e.setCancelled(true); } else if (e.getItem().getItemStack().hasItemMeta() && e.getItem().getItemStack().getItemMeta().hasDisplayName() && e.getItem().getItemStack().getItemMeta().getDisplayName().startsWith(ITEM_PREFIX)) { e.setCancelled(true); e.getItem().remove(); } }
Source:
<code>private boolean decodeLightingParameters(Cardio2eLightingTransaction receivedCardio2eTransaction, List<String> digestedTransaction) { boolean decodeComplete = false; switch (receivedCardio2eTransaction.getTransactionType()){ case ACK: case GET: if (digestedTransaction.size() == 3) { try { receivedCardio2eTransaction.setObjectNumber (Short.parseShort(digestedTransaction.get(2))); decodeComplete = true; } catch (IllegalArgumentException e1) { e1.printStackTrace(); } } break; case NACK: decodeComplete = decodeNACK(receivedCardio2eTransaction, digestedTransaction); break; case INFORMATION: case SET: if (digestedTransaction.size() == 4) { try { receivedCardio2eTransaction.setObjectNumber (Short.parseShort(digestedTransaction.get(2))); receivedCardio2eTransaction.setLightIntensity (Byte.parseByte(digestedTransaction.get(3))); decodeComplete = true; } catch (IllegalArgumentException e1) { <START> e1.printStackTrace(); <END> } } break; } return decodeComplete; }</code><technical_language>This needs a log statement</technical_language>

Target:
private boolean decodeLightingParameters( Cardio2eLightingTransaction receivedCardio2eTransaction, List<String> digestedTransaction) { boolean decodeComplete = false; switch (receivedCardio2eTransaction.getTransactionType()) { case ACK: case GET: if (digestedTransaction.size() == 3) { try { receivedCardio2eTransaction.setObjectNumber(Short .parseShort(digestedTransaction.get(2))); decodeComplete = true; } catch (IllegalArgumentException ex) { logger.warn( "Illegal argument in decoding LIGHTING transaction: '{}'", ex.toString()); } } break; case NACK: decodeComplete = decodeNACK(receivedCardio2eTransaction, digestedTransaction); break; case INFORMATION: case SET: if (digestedTransaction.size() == 4) { try { receivedCardio2eTransaction.setObjectNumber(Short .parseShort(digestedTransaction.get(2))); receivedCardio2eTransaction.setLightIntensity(Byte .parseByte(digestedTransaction.get(3))); decodeComplete = true; } catch (IllegalArgumentException ex) { logger.warn( "Illegal argument in decoding LIGHTING transaction: '{}'", ex.toString()); } } break; } return decodeComplete; }
Source:
<code>public boolean isDomainsReportedAsProblematic(List<VDSDomainsData> vdsDomainsData) { Set<Guid> domainsInPool = new HashSet<Guid>( DbFacade.getInstance().getStorageDomainStaticDAO().getAllIds( _storagePoolId, StorageDomainStatus.Active)); domainsInPool.addAll(DbFacade.getInstance().getStorageDomainStaticDAO().getAllIds( _storagePoolId, StorageDomainStatus.Unknown)); List<Guid> domainWhicWereSeen = new ArrayList<Guid>(); for (VDSDomainsData vdsDomainData : vdsDomainsData) { if (domainsInPool.contains(vdsDomainData.getDomainId())) { if (isDomainReportedAsProblematic(vdsDomainData, true)) { return true; } domainWhicWereSeen.add(vdsDomainData.getDomainId()); } } domainsInPool.removeAll(domainWhicWereSeen); if (domainsInPool.size() > 0) { for (Guid domainId : domainsInPool) { <START> log.errorFormat("Domain {0} was not seen by host", domainId); <END> } return true; } return false; }</code><technical_language>Storage Domain {0} is Host</technical_language>

Target:
public boolean isDomainsReportedAsProblematic(List<VDSDomainsData> vdsDomainsData) { Set<Guid> domainsInPool = new HashSet<Guid>( DbFacade.getInstance().getStorageDomainStaticDao().getAllIds( _storagePoolId, StorageDomainStatus.Active)); domainsInPool.addAll(DbFacade.getInstance().getStorageDomainStaticDao().getAllIds( _storagePoolId, StorageDomainStatus.Unknown)); List<Guid> domainWhicWereSeen = new ArrayList<Guid>(); for (VDSDomainsData vdsDomainData : vdsDomainsData) { if (domainsInPool.contains(vdsDomainData.getDomainId())) { if (isDomainReportedAsProblematic(vdsDomainData, true)) { return true; } domainWhicWereSeen.add(vdsDomainData.getDomainId()); } } domainsInPool.removeAll(domainWhicWereSeen); if (domainsInPool.size() > 0) { for (Guid domainId : domainsInPool) { log.errorFormat("Domain {0} is not seen by Host", domainId); } return true; } return false; }
Source:
<code>private void register() { if (getWindow() != null) { return; } ArrayList<VdcActionParametersBase> parametersList = new ArrayList<>(); for (Object item : getSelectedItems()) { DiskImage disk = (DiskImage) item; RegisterDiskParameters parameters = new RegisterDiskParameters(disk, getEntity().getId()); parametersList.add(parameters); } <START> Frontend.getInstance().runMultipleAction(VdcActionType.RegisterDisk, parametersList, <END> new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { } }, this); }</code><technical_language>want some confirmation window registering</technical_language>

Target:
private void register() { if (getWindow() != null) { return; } for (Object item : getSelectedItems()) { DiskImage disk = (DiskImage) item; GetUnregisteredDiskQueryParameters parameters = new GetUnregisteredDiskQueryParameters(disk.getId(), getEntity().getId(), getEntity().getStoragePoolId()); Frontend.getInstance().runQuery(VdcQueryType.GetUnregisteredDisk, parameters, new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { DiskImage diskImage = ((VdcQueryReturnValue) ReturnValue).getReturnValue(); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(diskImage, getEntity().getId()); Frontend.getInstance().runAction(VdcActionType.RegisterDisk, registerDiskParams); } })); } }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; <START> result = prime * result + ((compatibilityVersion == null) ? 0 : compatibilityVersion.hashCode()); <END> result = prime * result + ((network == null) ? 0 : network.hashCode()); result = prime * result + ((storagePoolName == null) ? 0 : storagePoolName.hashCode()); return result; }</code><technical_language>getters instead of fields</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getCompatibilityVersion() == null) ? 0 : getCompatibilityVersion().hashCode()); result = prime * result + ((getNetwork() == null) ? 0 : getNetwork().hashCode()); result = prime * result + ((getStoragePoolName() == null) ? 0 : getStoragePoolName().hashCode()); return result; }
Source:
<code>public String replaceCredentials(String code) { if (code == null) { return null; } String replaced = code; <START> Pattern userpattern = Pattern.compile("\\{user\\.([^\\}]+)\\}"); <END> Pattern passwordpattern = Pattern.compile("\\{password\\.([^\\}]+)\\}"); Matcher matcher = userpattern.matcher(replaced); while (matcher.find()) { String key = matcher.group(1); UsernamePassword usernamePassword = creds.getUsernamePassword(key); if (usernamePassword != null) { String value = usernamePassword.getUsername(); replaced = matcher.replaceFirst(value); matcher = userpattern.matcher(replaced); } } matcher = passwordpattern.matcher(replaced); while (matcher.find()) { String key = matcher.group(1); UsernamePassword usernamePassword = creds.getUsernamePassword(key); if (usernamePassword != null) { passwords.add(usernamePassword.getPassword()); String value = usernamePassword.getPassword(); replaced = matcher.replaceFirst(value); matcher = passwordpattern.matcher(replaced); } } return replaced; }</code><technical_language>Move this static field</technical_language>

Target:
public String replaceCredentials(String code) { if (code == null) { return null; } String replaced = code; Matcher matcher = userpattern.matcher(replaced); while (matcher.find()) { String key = matcher.group(1); UsernamePassword usernamePassword = creds.getUsernamePassword(key); if (usernamePassword != null) { String value = usernamePassword.getUsername(); String quotedValue = Matcher.quoteReplacement(value); replaced = matcher.replaceFirst(quotedValue); matcher = userpattern.matcher(replaced); } } matcher = passwordpattern.matcher(replaced); while (matcher.find()) { String key = matcher.group(1); UsernamePassword usernamePassword = creds.getUsernamePassword(key); if (usernamePassword != null) { passwords.add(usernamePassword.getPassword()); String value = usernamePassword.getPassword(); String quotedValue = Matcher.quoteReplacement(value); replaced = matcher.replaceFirst(quotedValue); matcher = passwordpattern.matcher(replaced); } } return replaced; }
Source:
<code>private void cancelAllRequestsDueToError(Throwable t) { LOGGER.error(t, GraphI18n.executingRequest, sourceName); <START> for (Request request : this.composite.getRequests()) { <END> try { request.cancel(); } finally { request.freeze(); } } try { cancel(true); } finally { this.composite.freeze(); } }</code><technical_language>for-loop cancel(true) lines try block? IOW, move 'try' (line 234) for-loop. change change individual requests cancelled, guarantee this.composite.freeze() is called. discussed yesterday, this is attempting prevent a non-returning wait in pathological case of OOME catastrophic. all, current request.cancel() request.freeze() calls pretty low-risk, request references null. chance wrong this method, hurt sure</technical_language>

Target:
private void cancelAllRequestsDueToError(Throwable t) { LOGGER.error(t, GraphI18n.executingRequest, sourceName); try { for (Request request : this.composite.getRequests()) { try { request.cancel(); } finally { request.freeze(); } } cancel(true); } finally { this.composite.freeze(); } }
Source:
<code>public boolean isTrue(ZestResponse response) { <START> boolean toReturn = true; <END> for (ZestExpressionElement con : getChildrenCondition()) { toReturn = toReturn && con.evaluate(response); if(!toReturn) break; } return toReturn; }</code><technical_language>Again, default false - I 'nothing' more sense false..</technical_language>

Target:
public boolean isTrue(ZestResponse response) { if(getChildrenCondition().isEmpty()) return false; boolean toReturn = true; for (ZestExpressionElement con : getChildrenCondition()) { toReturn = toReturn && con.evaluate(response); if(!toReturn) break; } return toReturn; }
Source:
<code>public Note buildFromBase64EncodedData(String noteId, String base64FullNoteData){ Note note = null; if (base64FullNoteData == null) return null; byte[] b64DecodedPayload = Base64.decode(base64FullNoteData, Base64.DEFAULT); Inflater decompresser = new Inflater(); decompresser.setInput(b64DecodedPayload, 0, b64DecodedPayload.length); byte[] result = new byte[4096]; int resultLength = 0; try { resultLength = decompresser.inflate(result); decompresser.end(); } catch (DataFormatException e) { <START> e.printStackTrace(); <END> } String out = new String(result, 0, resultLength, StandardCharsets.UTF_8); if (out != null) { try { JSONObject jsonObject = new JSONObject(out); if (jsonObject.has("notes")) { JSONArray jsonArray = jsonObject.getJSONArray("notes"); if (jsonArray != null && jsonArray.length() == 1) { jsonObject = jsonArray.getJSONObject(0); } } note = build(noteId, jsonObject); } catch (JSONException e) { e.printStackTrace(); } } return note; }</code><technical_language>log Log.e method call</technical_language>

Target:
public Note buildFromBase64EncodedData(String noteId, String base64FullNoteData){ Note note = null; if (base64FullNoteData == null) return null; byte[] b64DecodedPayload = Base64.decode(base64FullNoteData, Base64.DEFAULT); Inflater decompresser = new Inflater(); decompresser.setInput(b64DecodedPayload, 0, b64DecodedPayload.length); byte[] result = new byte[4096]; int resultLength = 0; try { resultLength = decompresser.inflate(result); decompresser.end(); } catch (DataFormatException e) { AppLog.e(AppLog.T.NOTIFS, e.getMessage()); } String out = null; try { out = new String(result, 0, resultLength, "UTF-8"); } catch(UnsupportedEncodingException e) { AppLog.e(AppLog.T.NOTIFS, e.getMessage()); } if (out != null) { try { JSONObject jsonObject = new JSONObject(out); if (jsonObject.has("notes")) { JSONArray jsonArray = jsonObject.getJSONArray("notes"); if (jsonArray != null && jsonArray.length() == 1) { jsonObject = jsonArray.getJSONObject(0); } } note = build(noteId, jsonObject); } catch (JSONException e) { AppLog.e(AppLog.T.NOTIFS, e.getMessage()); } } return note; }
Source:
<code>public IndexAnalysisSettings3 getSettings(String projectName) throws IOException { if (mappedAnalysisSettings == null) { IndexAnalysisSettingsAccessor dao = new IndexAnalysisSettingsAccessor(); IndexAnalysisSettings3[] setts = dao.read(reader, Short.MAX_VALUE); map(setts); } String k = projectName != null ? projectName : ""; <START> return mappedAnalysisSettings.get(k); <END> }</code><technical_language>is descriptive</technical_language>

Target:
public IndexAnalysisSettings3 getSettings(String projectName) throws IOException { if (mappedAnalysisSettings == null) { IndexAnalysisSettingsAccessor dao = new IndexAnalysisSettingsAccessor(); IndexAnalysisSettings3[] setts = dao.read(reader, Short.MAX_VALUE); map(setts); } String projectKey = projectName != null ? projectName : ""; return mappedAnalysisSettings.get(projectKey); }
Source:
<code>public Image getImage(ImageSettingsRequest imageSettings, String region, String platform) { String imageId = imageSettings.getId(); String catalogUrl = Objects.nonNull(imageSettings.getCatalog()) ? imageSettings.getCatalog() : defaultCatalogUrl; String imageOs = Objects.nonNull(imageSettings.getOs()) ? imageSettings.getOs() : defaultOs; ImageCatalog cachedImageCatalog = imageCatalogProvider.getImageCatalog(catalogUrl); return findImageForAppVersion(region, platform, imageId, imageOs, cachedImageCatalog) <START> .or(() -> { LOGGER.debug("Image not found with the parameters: imageId: {}, imageOs: {}, region: {}, platform: {}", imageId, imageOs, region, platform); LOGGER.debug("Evicting image catalog cache to retry."); imageCatalogProvider.evictImageCatalogCache(catalogUrl); ImageCatalog renewedImageCatalog = imageCatalogProvider.getImageCatalog(catalogUrl); return findImageForAppVersion(region, platform, imageId, imageOs, renewedImageCatalog); <END> }) .orElseThrow(() -> { String message = String.format("Could not find any image with id: '%s' in region '%s' with OS '%s'.", imageId, region, imageOs); return new ImageNotFoundException(message); }); }</code><technical_language>extract method please</technical_language>

Target:
public Image getImage(ImageSettingsRequest imageSettings, String region, String platform) { String imageId = imageSettings.getId(); String catalogUrl = Objects.nonNull(imageSettings.getCatalog()) ? imageSettings.getCatalog() : defaultCatalogUrl; String imageOs = Objects.nonNull(imageSettings.getOs()) ? imageSettings.getOs() : defaultOs; ImageCatalog cachedImageCatalog = imageCatalogProvider.getImageCatalog(catalogUrl); return findImageForAppVersion(region, platform, imageId, imageOs, cachedImageCatalog) .or(() -> retryAfterEvictingCache(region, platform, imageId, catalogUrl, imageOs)) .orElseThrow(() -> throwImageNotFoundException(region, imageId, imageOs)); }
Source:
<code>private double getTotalSizeForNewDisks(Collection<DiskImage> diskImages) { double totalSizeForDisks = 0.0; <START> if (null != diskImages) { <END> for (DiskImage diskImage : diskImages) { double sizeForDisk = diskImage.getSize(); if (diskImage.getVolumeFormat() == VolumeFormat.COW) { if (storageDomain.getStorageType().isFileDomain()) { sizeForDisk = EMPTY_QCOW_HEADER_SIZE; } else { sizeForDisk = INITIAL_BLOCK_ALLOCATION_SIZE; } } else if (diskImage.getVolumeType() == VolumeType.Sparse) { sizeForDisk = EMPTY_QCOW_HEADER_SIZE; } totalSizeForDisks += sizeForDisk; } } return totalSizeForDisks; }</code><technical_language>please put null right hand side of expression, project conventions</technical_language>

Target:
private double getTotalSizeForNewDisks(Collection<DiskImage> diskImages) { double totalSizeForDisks = 0.0; if (diskImages != null) { for (DiskImage diskImage : diskImages) { double sizeForDisk = diskImage.getSize(); if (diskImage.getVolumeFormat() == VolumeFormat.COW) { if (storageDomain.getStorageType().isFileDomain()) { sizeForDisk = EMPTY_QCOW_HEADER_SIZE; } else { sizeForDisk = INITIAL_BLOCK_ALLOCATION_SIZE; } } else if (diskImage.getVolumeType() == VolumeType.Sparse) { sizeForDisk = EMPTY_QCOW_HEADER_SIZE; } totalSizeForDisks += sizeForDisk; } } return totalSizeForDisks; }
Source:
<code>public void launchDaemon() { LOG.info("Starting supervisor for storm version '{}'.", VersionInfo.getVersion()); try { Map<String, Object> conf = getConf(); if (ConfigUtils.isLocalMode(conf)) { throw new IllegalArgumentException("Cannot start server in local mode!"); } launch(); metricsRegistry.registerGauge("supervisor:num-slots-used-gauge", () -> SupervisorUtils.supervisorWorkerIds(conf).size()); metricsRegistry.registerMeter("supervisor:num-launched").mark(); metricsRegistry.registerMeter("supervisor:num-shell-exceptions", ShellUtils.numShellExceptions); <START> killErrorMeter = metricsRegistry.registerMeter("supervisor:num-kill-errors"); <END> metricsRegistry.startMetricsReporters(conf); Utils.addShutdownHookWithForceKillIn1Sec(() -> { metricsRegistry.stopMetricsReporters(); this.close(); }); launchSupervisorThriftServer(conf); } catch (Exception e) { LOG.error("Failed to start supervisor\n", e); System.exit(1); } }</code><technical_language>Nit: rename num-kill-worker-errors</technical_language>

Target:
public void launchDaemon() { LOG.info("Starting supervisor for storm version '{}'.", VersionInfo.getVersion()); try { Map<String, Object> conf = getConf(); if (ConfigUtils.isLocalMode(conf)) { throw new IllegalArgumentException("Cannot start server in local mode!"); } launch(); metricsRegistry.registerGauge("supervisor:num-slots-used-gauge", () -> SupervisorUtils.supervisorWorkerIds(conf).size()); metricsRegistry.registerMeter("supervisor:num-launched").mark(); metricsRegistry.registerMeter("supervisor:num-shell-exceptions", ShellUtils.numShellExceptions); killErrorMeter = metricsRegistry.registerMeter("supervisor:num-kill-worker-errors"); metricsRegistry.startMetricsReporters(conf); Utils.addShutdownHookWithForceKillIn1Sec(() -> { metricsRegistry.stopMetricsReporters(); this.close(); }); launchSupervisorThriftServer(conf); } catch (Exception e) { LOG.error("Failed to start supervisor\n", e); System.exit(1); } }
Source:
<code>public LocalTime fromInt(Integer millisFromMidnight, Schema schema, LogicalType type) { <START> return LocalTime.ofNanoOfDay(1_000_000L * millisFromMidnight); <END> }</code><technical_language>minor: TimeUnit.MILLISECONDS.toNanos(millisFromMidnight) here</technical_language>

Target:
public LocalTime fromInt(Integer millisFromMidnight, Schema schema, LogicalType type) { return LocalTime.ofNanoOfDay(TimeUnit.MILLISECONDS.toNanos(millisFromMidnight)); }
Source:
<code>private void processSingleClusterChanges(ManageNetworkClustersParameters param) { final List<ActionParametersBase> setupNetworksParams = new ArrayList<>( createNetworkClustersToSetupNetworksParametersTransformer().transform( param.getAttachments(), param.getDetachments(), param.getUpdates()) ); HostSetupNetworksParametersBuilder.updateParametersSequencing(setupNetworksParams); setupNetworksParams.forEach(this::withRootCommandInfo); <START> runInternalMultipleActions(ActionType.PersistentHostSetupNetworks, setupNetworksParams, getContext().getExecutionContext()); <END> }</code><technical_language>nit: Formatting</technical_language>

Target:
private void processSingleClusterChanges(ManageNetworkClustersParameters param) { final List<ActionParametersBase> setupNetworksParams = new ArrayList<>( createNetworkClustersToSetupNetworksParametersTransformer().transform( param.getAttachments(), param.getDetachments(), param.getUpdates()) ); HostSetupNetworksParametersBuilder.updateParametersSequencing(setupNetworksParams); setupNetworksParams.forEach(this::withRootCommandInfo); runInternalMultipleActions(ActionType.PersistentHostSetupNetworks, setupNetworksParams); }
Source:
<code>public void testDefaultValue() { StringProperty prop1 = newString("prop1", "value1"); assertNull(prop1.getDefaultValue()); assertNull(prop1.getStringDefaultValue()); StringProperty prop2 = newString("prop2", "value2", "defaultValue2"); assertEquals("defaultValue2", prop2.getDefaultValue()); assertEquals("defaultValue2", prop2.getStringDefaultValue()); StringProperty prop3 = newString("prop3", "value3"); prop3.setValueEvaluator(new PropertyValueEvaluator() { @Override public <T> T evaluate(Property<T> property, Object storedValue) { return (T) storedValue; } }); assertNull(prop3.getDefaultValue()); assertNull(prop3.getStringDefaultValue()); StringProperty prop4 = newString("prop4", "value4", "defaultValue4"); <START> prop3.setValueEvaluator(new PropertyValueEvaluator() { <END> @Override public <T> T evaluate(Property<T> property, Object storedValue) { return (T) storedValue; } }); assertEquals("defaultValue4", prop4.getDefaultValue()); assertEquals("defaultValue4", prop4.getStringDefaultValue()); }</code><technical_language>bad cut paste, I suppose this prop4 here. This show evaluator is of in test. If want evaluator, please change check for it</technical_language>

Target:
public void testDefaultValue() { StringProperty prop1 = newString("prop1", "value1"); assertNull(prop1.getDefaultValue()); assertNull(prop1.getStringDefaultValue()); StringProperty prop2 = newString("prop2", "value2", "defaultValue2"); assertEquals("defaultValue2", prop2.getDefaultValue()); assertEquals("defaultValue2", prop2.getStringDefaultValue()); StringProperty prop3 = newString("prop3", "value3"); prop3.setValueEvaluator(new PropertyValueEvaluator() { @Override public <T> T evaluate(Property<T> property, Object storedValue) { return storedValue == null ? null : (T) "prop3".concat((String) storedValue); } }); assertNull(prop3.getDefaultValue()); assertNull(prop3.getStringDefaultValue()); StringProperty prop4 = newString("prop4", "value4", "defaultValue4"); prop4.setValueEvaluator(new PropertyValueEvaluator() { @Override public <T> T evaluate(Property<T> property, Object storedValue) { return storedValue == null ? null : (T) "prop4".concat((String) storedValue); } }); assertEquals("prop4defaultValue4", prop4.getDefaultValue()); assertEquals("prop4defaultValue4", prop4.getStringDefaultValue()); }
Source:
<code>private String getData(String path, Map<String, String> params) throws APIException { HttpURLConnection con = null; try { final String url = getUrl(path, params); con = IOHelper.getConnection(url); <START> con.setReadTimeout(30000); <END> return IOHelper.readString(con.getInputStream()); } catch (Exception e) { throw new APIException("Couldn't request data from the UNSD server", e); } finally { try { con.disconnect(); } catch (Exception ignored) { } } }</code><technical_language>If a lot of data add a Accept-Encoding: gzip header call IOHelper.readString(HttpURLConnection) instead</technical_language>

Target:
private String getData(String path, Map<String, String> params) throws APIException { HttpURLConnection con = null; try { final String url = getUrl(path, params); con = IOHelper.getConnection(url); con.setReadTimeout(PropertyUtil.getOptional(PROP_READ_TIMEOUT, 30000)); return IOHelper.readString(con); } catch (Exception e) { throw new APIException("Couldn't request data from the UNSD server", e); } finally { try { con.disconnect(); } catch (Exception ignored) { } } }
Source:
<code><START> public static Alert fromInternal( <END> final models.internal.alerts.Alert internal, final Optional<JobExecution.Success<AlertEvaluationResult>> mostRecentEvaluation ) { final Alert alert = new Alert(); alert._id = internal.getId(); alert._name = internal.getName(); alert._description = internal.getDescription(); alert._enabled = internal.isEnabled(); alert._additionalMetadata = internal.getAdditionalMetadata(); final AlertFiringState firingState = new AlertFiringState(); mostRecentEvaluation.ifPresent(evaluation -> { firingState.setLastEvaluatedAt(evaluation.getCompletedAt()); firingState.setFiringTags(evaluation.getResult().getFiringTags()); }); alert._firingState = firingState; return alert; }</code><technical_language>Historically, methods view model classes avoid server-side rendering code (view code) dependencies types in internal model</technical_language>

Target:
public static Alert fromInternal( final models.internal.alerts.Alert internal, final Optional<JobExecution.Success<AlertEvaluationResult>> mostRecentEvaluation ) { final Alert alert = new Alert(); alert._id = internal.getId(); alert._name = internal.getName(); alert._description = internal.getDescription(); alert._enabled = internal.isEnabled(); alert._additionalMetadata = internal.getAdditionalMetadata(); alert._firingState = mostRecentEvaluation.map(evaluation -> { final AlertFiringState firingState = new AlertFiringState(); firingState.setLastEvaluatedAt(evaluation.getCompletedAt()); firingState.setFiringTags(evaluation.getResult().getFiringTags()); return firingState; }); return alert; }
Source:
<code>public Command toDevfileCommand(CommandImpl command) throws WorkspaceExportException { <START> Command devCommand = new Command().withName(command.getName()); <END> Action action = new Action().withCommand(command.getCommandLine()).withType(command.getType()); String workingDir = command.getAttributes().remove(WORKING_DIRECTORY_ATTRIBUTE); if (!isNullOrEmpty(workingDir)) { action.setWorkdir(workingDir); } String toolName = command.getAttributes().remove(Constants.TOOL_NAME_COMMAND_ATTRIBUTE); if (toolName == null) { throw new WorkspaceExportException( format("Command `%s` has no specified tool where it should be run", command.getName())); } action.setTool(toolName); action.setType(Constants.EXEC_ACTION_TYPE); devCommand.getActions().add(action); devCommand.setAttributes(command.getAttributes()); return devCommand; }</code><technical_language>move top of method</technical_language>

Target:
public Command toDevfileCommand(CommandImpl command) throws WorkspaceExportException { String toolName = command.getAttributes().remove(Constants.TOOL_NAME_COMMAND_ATTRIBUTE); if (toolName == null) { throw new WorkspaceExportException( format("Command `%s` has no specified tool where it should be run", command.getName())); } Command devCommand = new Command().withName(command.getName()); Action action = new Action().withCommand(command.getCommandLine()).withType(command.getType()); action.setWorkdir(command.getAttributes().remove(WORKING_DIRECTORY_ATTRIBUTE)); action.setTool(toolName); action.setType(Constants.EXEC_ACTION_TYPE); devCommand.getActions().add(action); devCommand.setAttributes(command.getAttributes()); return devCommand; }
Source:
<code>public boolean canFlipToNextPage() { final boolean hasAtLeastOneFileToScan = !((BatchImportTraceWizard) getWizard()).getFilesToScan().isEmpty(); if( hasAtLeastOneFileToScan ){ setErrorMessage(null); } else { <START> setErrorMessage("Select at least one directory to scan"); <END> } return hasAtLeastOneFileToScan; }</code><technical_language>externalize string</technical_language>

Target:
public boolean canFlipToNextPage() { final Table selectedFiles = (Table) ((Composite) getControl()).getChildren()[0]; boolean canLoad = selectedFiles.getItemCount() >= 0; if (canLoad) { setErrorMessage(null); } else { setErrorMessage(Messages.ImportTraceWizardPageSelectDirectories_4); } return canLoad; }
Source:
<code>public int getNumEntries(boolean crcCheck) throws IOException { boolean wasClosed = false; if (m_closed) { wasClosed = true; open(false, false); } m_numOfEntries = 0; m_size = 0; if (m_fc.size() >= SEGMENT_HEADER_BYTES) { m_segmentHeaderBuf.b().clear(); PBDUtils.readBufferFully(m_fc, m_segmentHeaderBuf.b(), 0); if (crcCheck) { long crc = m_segmentHeaderBuf.b().getLong(); int numOfEntries = m_segmentHeaderBuf.b().getInt(); int size = m_segmentHeaderBuf.b().getInt(); m_segmentHeaderCRC.reset(); m_segmentHeaderCRC.update(numOfEntries); m_segmentHeaderCRC.update(size); if (crc != m_segmentHeaderCRC.getValue()) { <START> LOG.warn("File corruption detected in" + m_file.getName() + ": invalid file header. " <END> + "Discard the file."); return m_numOfEntries; } m_numOfEntries = numOfEntries; m_size = size; } else { m_numOfEntries = m_segmentHeaderBuf.b().getInt(HEADER_NUM_OF_ENTRY_OFFSET); m_size = m_segmentHeaderBuf.b().getInt(HEADER_TOTAL_BYTES_OFFSET); } } if (wasClosed) closeReadersAndFile(); return m_numOfEntries; }</code><technical_language>throw exception caller handle it</technical_language>

Target:
public int getNumEntries(boolean crcCheck) throws IOException { boolean wasClosed = false; if (m_closed) { wasClosed = true; open(false, false); } m_numOfEntries = 0; m_size = 0; if (m_fc.size() >= SEGMENT_HEADER_BYTES) { m_segmentHeaderBuf.b().clear(); PBDUtils.readBufferFully(m_fc, m_segmentHeaderBuf.b(), 0); if (crcCheck) { int crc = m_segmentHeaderBuf.b().getInt(); int numOfEntries = m_segmentHeaderBuf.b().getInt(); int size = m_segmentHeaderBuf.b().getInt(); m_segmentHeaderCRC.reset(); m_segmentHeaderCRC.update(numOfEntries); m_segmentHeaderCRC.update(size); if (crc != (int)m_segmentHeaderCRC.getValue()) { LOG.warn("File corruption detected in" + m_file.getName() + ": invalid file header. "); throw new IOException("File corruption detected in" + m_file.getName() + ": invalid file header."); } m_numOfEntries = numOfEntries; m_size = size; } else { m_numOfEntries = m_segmentHeaderBuf.b().getInt(HEADER_NUM_OF_ENTRY_OFFSET); m_size = m_segmentHeaderBuf.b().getInt(HEADER_TOTAL_BYTES_OFFSET); } } if (wasClosed) closeReadersAndFile(); return m_numOfEntries; }
Source:
<code>public static void writeIntBE(int val, byte[] buffer, int offset) { <START> buffer[offset++] = (byte) (val >>> 24); <END> buffer[offset++] = (byte) (val >>> 16); buffer[offset++] = (byte) (val >>> 8); buffer[offset] = (byte) val; }</code><technical_language>This faster: buffer[offset] = (byte) (val >>> 24); buffer[offset + 1] = (byte) (val >>> 16); buffer[offset + 2] = (byte) (val >>> 8); buffer[offset + 3] = (byte) val; :)</technical_language>

Target:
public static void writeIntBE(int val, byte[] buffer, int offset) { buffer[offset] = (byte) (val >>> 24); buffer[offset + 1] = (byte) (val >>> 16); buffer[offset + 2] = (byte) (val >>> 8); buffer[offset + 3] = (byte) val; }
Source:
<code>public Map<String, Object> parse(String input) { Map<String, Object> map = new LinkedHashMap<>(); <START> Map<String, Object> document = (Map<String, Object>) Configuration.defaultConfiguration().jsonProvider().parse(input); <END> for (Map.Entry<String, Pair<FieldType, JsonPath>> entry : fieldPathMap.entrySet()) { String fieldName = entry.getKey(); Pair<FieldType, JsonPath> pair = entry.getValue(); JsonPath path = pair.rhs; Object parsedVal; if (pair.lhs == FieldType.ROOT) { parsedVal = document.get(fieldName); } else { parsedVal = path.read(document); } map.put(fieldName, parsedVal); } if(useFieldDiscovery) { discoverFields(map, document); } return map; }</code><technical_language>Instead of changing defaultConfiguration of jsonpath, cleaner create a JsonProvider construction time want be, that. good user pass in ObjectMapper (maybe want parse Smile JSON)</technical_language>

Target:
public Map<String, Object> parse(String input) { try { Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> document = mapper.readValue(input, new TypeReference<Map<String, Object>>() {}); for (Map.Entry<String, Pair<FieldType, JsonPath>> entry : fieldPathMap.entrySet()) { String fieldName = entry.getKey(); Pair<FieldType, JsonPath> pair = entry.getValue(); JsonPath path = pair.rhs; Object parsedVal; if (pair.lhs == FieldType.ROOT) { parsedVal = document.get(fieldName); } else { parsedVal = path.read(document, jsonPathConfig); } if (parsedVal == null) { continue; } parsedVal = valueConversionFunction(parsedVal); map.put(fieldName, parsedVal); } if (useFieldDiscovery) { discoverFields(map, document); } return map; } catch (Exception e) { throw new ParseException(e, "Unable to parse row [%s]", input); } }
Source:
<code>void generateKeyCorrectKeyLengthWithTruncateModifierAndUnicode() { BibEntry bibEntry = new BibEntry(); bibEntry.setField(StandardField.AUTHOR, "Gödel, Kurt"); <START> assertEquals(2, generateKey(bibEntry, "[auth:truncate2").length()); <END> }</code><technical_language>Is a missing bracket end? suggestion assertEquals(2, generateKey(bibEntry, "[auth:truncate2]").length());</technical_language>

Target:
void generateKeyCorrectKeyLengthWithTruncateModifierAndUnicode() { BibEntry bibEntry = new BibEntry().withField(StandardField.AUTHOR, "Gödel, Kurt"); assertEquals(2, generateKey(bibEntry, "[auth:truncate2]").length()); }
Source:
<code>public TableRendererV2(String packageName, Namespace namespace) { Preconditions.checkNotNull(packageName); Preconditions.checkNotNull(namespace); <START> this.packageName = packageName; <END> this.namespace = namespace; }</code><technical_language>inline null checks assignment, e.g. this.packageName = checkNotNull(packageName)</technical_language>

Target:
public TableRendererV2(String packageName, Namespace namespace) { this.packageName = checkNotNull(packageName); this.namespace = checkNotNull(namespace); }
Source:
<code>public int runCmd(CommandLine cmdLine) throws Exception { ZooKeeper zk = null; <START> LedgerUnderreplicationManager underreplicationManager = null; <END> try { zk = ZooKeeperClient.newBuilder() .connectString(bkConf.getZkServers()) .sessionTimeoutMs(bkConf.getZkTimeout()) .build(); LedgerManagerFactory ledgerManagerFactory = LedgerManagerFactory.newLedgerManagerFactory(bkConf, zk); underreplicationManager = ledgerManagerFactory.newLedgerUnderreplicationManager(); if (!underreplicationManager.isLedgerReplicationEnabled()) { LOG.error("Autorecovery is disabled. So giving up!"); return -1; } BookieSocketAddress auditorId = AuditorElector.getCurrentAuditor(bkConf, zk); if (auditorId == null) { LOG.error("No auditor elected, though Autorecovery is enabled. So giving up."); return -1; } int previousLostBookieRecoveryDelayValue = underreplicationManager.getLostBookieRecoveryDelay(); LOG.info("Resetting LostBookieRecoveryDelay value: {}, to kickstart audit task", previousLostBookieRecoveryDelayValue); underreplicationManager.setLostBookieRecoveryDelay(previousLostBookieRecoveryDelayValue); } finally { if (zk != null) { zk.close(); } } return 0; }</code><technical_language>concerns good put this trigger logic in BookKeeperAdmin, for seasons: shell tool simpler is easier test verify logic</technical_language>

Target:
public int runCmd(CommandLine cmdLine) throws Exception { ClientConfiguration adminConf = new ClientConfiguration(bkConf); BookKeeperAdmin admin = new BookKeeperAdmin(adminConf); try { admin.triggerAudit(); } finally { if (admin != null) { admin.close(); } } return 0; }
Source:
<code><START> private Image getStatusIcon(IRepositoryElement element) { <END> if (element instanceof IRepositoryQuery) { RepositoryQuery query = (RepositoryQuery) element; boolean showError = false; Throwable exception = query.getStatus().getException(); showError = (query.getLastSynchronizedTimeStamp().equals("<never>") && ((RepositoryStatus.ERROR_IO == query.getStatus().getCode() && exception != null && exception instanceof SocketTimeoutException) || (RepositoryStatus.ERROR_NETWORK) == query.getStatus().getCode() && query.getStatus().getMessage().equals("Http error: Internal Server Error"))); if (showError) { return CommonImages.getImage(CommonImages.ERROR); } } return CommonImages.getImage(CommonImages.WARNING); }</code><technical_language>method in CustomTaskListDecorationDrawer</technical_language>

Target:
private Image getStatusIcon(IRepositoryElement element) { if (element instanceof RepositoryQuery) { return CommonImages.getImage(TasksUiInternal.getIconFromStatusOfQuery((RepositoryQuery) element)); } return CommonImages.getImage(CommonImages.WARNING); }
Source:
<code>public void shouldFindUpdatedNodeInInLabelScan() throws Exception { Node node = createNode( "label" ); try ( org.neo4j.internal.kernel.api.Transaction tx = session.beginTransaction(); NodeLabelIndexCursor cursor = cursors.allocateNodeLabelIndexCursor() ) { <START> tx.dataWrite().nodeAddLabel( node.node, node.labels[0] ); <END> tx.dataRead().nodeLabelScan( node.labels[0], cursor ); assertTrue( cursor.next() ); assertEquals( node.node, cursor.nodeReference() ); } }</code><technical_language>re-assign label node, created label</technical_language>

Target:
public void shouldFindUpdatedNodeInInLabelScan() throws Exception { Node node = createNode( ); try ( org.neo4j.internal.kernel.api.Transaction tx = session.beginTransaction(); NodeLabelIndexCursor cursor = cursors.allocateNodeLabelIndexCursor() ) { int label = tx.tokenWrite().labelGetOrCreateForName( "label" ); tx.dataWrite().nodeAddLabel( node.node, label ); tx.dataRead().nodeLabelScan( label, cursor ); assertTrue( cursor.next() ); assertEquals( node.node, cursor.nodeReference() ); } }
Source:
<code>public Map<String, Fingerprint> loadFingerprints(final File fingerprintFile, final String specificSample) { final VCFFileReader reader = new VCFFileReader(fingerprintFile, false); SequenceUtil.assertSequenceDictionariesEqual(this.haplotypes.getHeader().getSequenceDictionary(), VCFFileReader.getSequenceDictionary(fingerprintFile)); if (isQueryable(fingerprintFile)) { <START> reader.close(); <END> return loadFingerprintsFromIndexedVcf(fingerprintFile, specificSample); } else { reader.close(); log.warn("Couldn't find index for file " + fingerprintFile + " going to read through it all."); return loadFingerprintsFromNonIndexedVcf(fingerprintFile, specificSample); } }</code><technical_language>remove reader longer</technical_language>

Target:
public Map<String, Fingerprint> loadFingerprints(final File fingerprintFile, final String specificSample) { SequenceUtil.assertSequenceDictionariesEqual(this.haplotypes.getHeader().getSequenceDictionary(), VCFFileReader.getSequenceDictionary(fingerprintFile)); if (isQueryable(fingerprintFile)) { return loadFingerprintsFromIndexedVcf(fingerprintFile, specificSample); } else { log.warn("Couldn't find index for file " + fingerprintFile + " going to read through it all."); return loadFingerprintsFromNonIndexedVcf(fingerprintFile, specificSample); } }
Source:
<code>private void initOriginalFromBuffer(ByteBuffer buf) throws IOException { <START> assert(false); <END> setProcName(SerializationHelper.getVarbinary(buf)); clientHandle = buf.getLong(); serializedParams = buf.slice(); final ByteBuffer duplicate = serializedParams.duplicate(); params = new FutureTask<ParameterSet>(new Callable<ParameterSet>() { @Override public ParameterSet call() throws Exception { return ParameterSet.fromByteBuffer(duplicate); } }); }</code><technical_language>Remove dumb check</technical_language>

Target:
private void initOriginalFromBuffer(ByteBuffer buf) throws IOException { byte[] procNameBytes = SerializationHelper.getVarbinary(buf); if (procNameBytes == null) { throw new IOException("Procedure name cannot be null in invocation deserialization."); } if (procNameBytes.length == 0) { throw new IOException("Procedure name cannot be length zero in invocation deserialization."); } setProcName(procNameBytes); clientHandle = buf.getLong(); serializedParams = buf.slice(); final ByteBuffer duplicate = serializedParams.duplicate(); params = new FutureTask<ParameterSet>(new Callable<ParameterSet>() { @Override public ParameterSet call() throws Exception { return ParameterSet.fromByteBuffer(duplicate); } }); }
Source:
<code>public void testBackoffTimeCapped() { <START> VerificationContext verificationContext = new VerificationContext(); <END> RetryDriver retryDriver = new RetryDriver<>( new RetryConfig() .setMaxAttempts(5) .setMinBackoffDelay(new Duration(10, MILLISECONDS)) .setMaxBackoffDelay(new Duration(100, MILLISECONDS)) .setScaleFactor(1000), QueryException::isRetryable, QueryException.class, verificationContext::addException); retryDriver.run("test", new MockOperation(5, RETRYABLE_EXCEPTION)); }</code><technical_language>@caithagoras I understand @Test(singleThreaded = true) change, is this change</technical_language>

Target:
public void testBackoffTimeCapped() { RetryDriver retryDriver = new RetryDriver<>( new RetryConfig() .setMaxAttempts(5) .setMinBackoffDelay(new Duration(10, MILLISECONDS)) .setMaxBackoffDelay(new Duration(100, MILLISECONDS)) .setScaleFactor(1000), QueryException::isRetryable, QueryException.class, verificationContext::addException); retryDriver.run("test", new MockOperation(5, RETRYABLE_EXCEPTION)); }
Source:
<code>protected abstract void internalUpdate(TransactionRecord transactionId) throws OseeCoreException; protected abstract void internalClearDirtyState(); protected abstract void internalOnRollBack() throws OseeCoreException; protected abstract int createGammaId() throws OseeCoreException; <START> protected abstract ApplicabilityId getApplicabilityId() throws OseeCoreException; <END> protected abstract void internalAddToEvents(ArtifactEvent artifactEvent) throws OseeCoreException; protected int getNextGammaIdFromSequence() { return (int) ConnectionHandler.getNextSequence(GAMMA_ID_SEQ, true); }</code><technical_language>remove throws OseeCoreException</technical_language>

Target:
protected abstract void internalUpdate(TransactionRecord transactionId) throws OseeCoreException; protected abstract void internalClearDirtyState(); protected abstract void internalOnRollBack() throws OseeCoreException; protected abstract int createGammaId() throws OseeCoreException; protected abstract ApplicabilityId getApplicabilityId(); protected abstract void internalAddToEvents(ArtifactEvent artifactEvent) throws OseeCoreException; protected int getNextGammaIdFromSequence() { return (int) ConnectionHandler.getNextSequence(GAMMA_ID_SEQ, true); }
Source:
<code>public AlertQuery createQuery(final Organization organization) { assertIsOpen(); <START> LOGGER.debug().setMessage("Preparing query").log(); <END> return new DefaultAlertQuery(this, organization); }</code><technical_language>include organization too</technical_language>

Target:
public AlertQuery createQuery(final Organization organization) { assertIsOpen(); LOGGER.debug() .setMessage("Preparing query") .addData("organization", organization) .log(); return new DefaultAlertQuery(this, organization); }