auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SqlStatementParameterCustomizer createForParameter(Annotation annotation, Class<?> sqlObjectType, Method method, Parameter param, int index, Type type) { Bind b = (Bind) annotation; String nameFromAnnotation = b == null ? Bind.NO_VALUE : b.value(); Optional<String> name = ParameterUtil.findParameterName(nameFromAnnotation, param); <START> QualifiedType<?> qualifiedType = QualifiedType.of(type).withAnnotations(new Qualifiers().qualifiers(param)); <END> return (stmt, arg) -> { stmt.bindByType(index, arg, qualifiedType); name.ifPresent(n -> stmt.bindByType(n, arg, qualifiedType)); }; }</code><technical_language>move lambda down, access cache stmt</technical_language>

Target:
public SqlStatementParameterCustomizer createForParameter(Annotation annotation, Class<?> sqlObjectType, Method method, Parameter param, int index, Type type) { Bind b = (Bind) annotation; String nameFromAnnotation = b == null ? Bind.NO_VALUE : b.value(); Optional<String> name = ParameterUtil.findParameterName(nameFromAnnotation, param); return (stmt, arg) -> { QualifiedType<?> qualifiedType = QualifiedType.of(type).withAnnotations( stmt.getConfig(Qualifiers.class).findFor(param)); stmt.bindByType(index, arg, qualifiedType); name.ifPresent(n -> stmt.bindByType(n, arg, qualifiedType)); }; }
Source:
<code>public void should_failed_when_event_isNot_ON_ENTER_Or_ON_FINISH(){ <START> ConnectorEventFilter failFilter = new ConnectorEventFilter("a"); <END> }</code><technical_language>left operand is useless</technical_language>

Target:
public void should_failed_when_event_isNot_ON_ENTER_Or_ON_FINISH() { new ConnectorEventFilter("a"); }
Source:
<code>synchronized void updateOwner(final int blockId, final int oldOwnerId, final int newOwnerId) { LOG.log(Level.FINER, "Update owner of block {0} from store {1} to store {2}", new Object[]{blockId, oldOwnerId, newOwnerId}); if (!movingBlocks.contains(blockId)) { throw new RuntimeException("The block " + blockId + " + is not locked for move"); } if (!storeIdToBlockIds.containsKey(oldOwnerId)) { throw new RuntimeException("MemoryStore " + oldOwnerId + " has been lost."); } if (!storeIdToBlockIds.containsKey(newOwnerId)) { throw new RuntimeException("MemoryStore " + newOwnerId + " has been lost."); } if (!storeIdToBlockIds.get(oldOwnerId).remove(blockId)) { throw new RuntimeException("Store " + oldOwnerId + " does not own block " + blockId); } if (!storeIdToBlockIds.get(newOwnerId).add(blockId)) { throw new RuntimeException("Store " + newOwnerId + " already owns block " + blockId); } <START> final Set<Integer> blocksInOldStore = storeIdToBlockIds.get(oldOwnerId); <END> final Set<Integer> blocksInNewStore = storeIdToBlockIds.get(newOwnerId); blocksInOldStore.remove(blockId); blocksInNewStore.add(blockId); blockIdToStoreId.put(blockId, newOwnerId); }</code><technical_language>logic in L201-L204 done in L194-199, it? If so, sense remove of them</technical_language>

Target:
synchronized void updateOwner(final int blockId, final int oldOwnerId, final int newOwnerId) { LOG.log(Level.FINER, "Update owner of block {0} from store {1} to store {2}", new Object[]{blockId, oldOwnerId, newOwnerId}); if (!movingBlocks.contains(blockId)) { throw new RuntimeException("The block " + blockId + " has not been chosen for migration or has already been released"); } if (!storeIdToBlockIds.containsKey(oldOwnerId)) { throw new RuntimeException("MemoryStore " + oldOwnerId + " has been lost."); } if (!storeIdToBlockIds.containsKey(newOwnerId)) { throw new RuntimeException("MemoryStore " + newOwnerId + " has been lost."); } if (!storeIdToBlockIds.get(oldOwnerId).contains(blockId)) { throw new RuntimeException("Store " + oldOwnerId + " does not own block " + blockId); } if (storeIdToBlockIds.get(newOwnerId).contains(blockId)) { throw new RuntimeException("Store " + newOwnerId + " already owns block " + blockId); } final Set<Integer> blocksInOldStore = storeIdToBlockIds.get(oldOwnerId); final Set<Integer> blocksInNewStore = storeIdToBlockIds.get(newOwnerId); blocksInOldStore.remove(blockId); blocksInNewStore.add(blockId); blockIdToStoreId.put(blockId, newOwnerId); }
Source:
<code>public Node description() { mergePanel = new MergeEntries(firstEntry, secondEntry, database.getMode()); VBox container = new VBox(10); Label header = new Label(name); header.getStyleClass().add("sectionHeader"); container.getChildren().add(header); container.getChildren().add(mergePanel); <START> container.setMargin(mergePanel, new Insets(5, 5, 5, 5)); <END> return container; }</code><technical_language>This work, appears space left side (or 5 is small)</technical_language>

Target:
public Node description() { mergePanel = new MergeEntries(oldEntry, newEntry, Localization.lang("In JabRef"), Localization.lang("On disk"), DefaultRadioButtonSelectionMode.LEFT); VBox container = new VBox(10); Label header = new Label(name); header.getStyleClass().add("sectionHeader"); container.getChildren().add(header); container.getChildren().add(mergePanel); container.setMargin(mergePanel, new Insets(5, 5, 5, 5)); return container; }
Source:
<code>public Callable<File> updateSynch(final String id, final InputStream content) { if (id.endsWith("/")) { throw new IllegalArgumentException( "Identifiers for use with this indexer may not end in '/'!"); } final String fileName = id.substring(id.lastIndexOf("/") + 1) + "-jcr.xml"; final File file = new File(path, fileName); LOGGER.debug("Updating to file: {}", id, file); return new Callable<File>() { @Override public File call() { FileOutputStream out = null; final byte[] buf = new byte[4096]; int len = 0; try { <START> out = new FileOutputStream(file); <END> while ((len = content.read(buf)) > 0 ) { out.write(buf, 0, len); } } catch (final IOException e) { LOGGER.error("Failed to write to file: {}", file); propagate(e); } finally { if (out != null) { try { out.close(); } catch (final IOException e) { } } } return file; } }; }</code><technical_language>IOUtils.write() from: <LINK_0></technical_language>

Target:
public Callable<File> updateSynch(final String id, final InputStream content) { if (id.endsWith("/")) { throw new IllegalArgumentException( "Identifiers for use with this indexer may not end in '/'!"); } return new Callable<File>() { @Override public File call() throws IOException { final String fileName = URLEncoder.encode(id, "UTF-8") + "-jcr.xml"; LOGGER.debug("Updating to file: {}", id, getPath() + File.pathSeparatorChar + fileName); final Path p = Paths.get(getPath(), fileName); Files.copy(content, p, new CopyOption[]{}); return p.toFile(); } }; }
Source:
<code>default Map<String, Object> getStats() { <START> throw new UnsupportedOperationException("This Jobby does not implement getJobStats()."); <END> }</code><technical_language>Please add class name exception message</technical_language>

Target:
default Map<String, Object> getStats() { throw new UnsupportedOperationException( StringUtils.format("This Jobby does not implement getJobStats(), Jobby class: [%s]", getClass()) ); }
Source:
<code><START> public static void closeChannel(Channel channel) { <END> Map<Long, Request> unfinishedRequests = UNFINISHED_REQUESTS.remove(channel); if (unfinishedRequests != null && unfinishedRequests.size() > 0) { for (Request r : unfinishedRequests.values()) { Response disconnectResponse = new Response(r.getId()); disconnectResponse.setStatus(Response.CHANNEL_INACTIVE); disconnectResponse.setErrorMessage("Channel " + channel + " is inactive. Directly return the unFinished request."); DefaultFuture.received(channel, disconnectResponse); } unfinishedRequests.clear(); } }</code><technical_language>I guess possibly avoid introducing UNFINISHED_REQUESTS this: java for (long id : CHANNELS.keySet()) { if (channel.equals(CHANNELS.get(id))) { DefaultFuture future = getFuture(id); if (!future.isDone()) { Response disconnectResponse = new Response(r.getId()); disconnectResponse.setStatus(Response.CHANNEL_INACTIVE); disconnectResponse.setErrorMessage("Channel " + channel + " is inactive. return unFinished request."); DefaultFuture.received(channel, disconnectResponse); } } }</technical_language>

Target:
public static void closeChannel(Channel channel) { for (long id : CHANNELS.keySet()) { if (channel.equals(CHANNELS.get(id))) { DefaultFuture future = getFuture(id); if (future != null && !future.isDone()) { Response disconnectResponse = new Response(future.getId()); disconnectResponse.setStatus(Response.CHANNEL_INACTIVE); disconnectResponse.setErrorMessage("Channel " + channel + " is inactive. Directly return the unFinished request : " + future.getRequest()); DefaultFuture.received(channel, disconnectResponse); } } } }
Source:
<code>public ImmutableRatesProviderBuilder iborIndexCurve(IborIndex index, Curve forwardCurve) { <START> ArgChecker.notNull(index, "currency"); <END> ArgChecker.notNull(forwardCurve, "forwardCurve"); this.indexCurves.put(index, forwardCurve); return this; }</code><technical_language>Argument name is wrong in call arg checker</technical_language>

Target:
public ImmutableRatesProviderBuilder iborIndexCurve(IborIndex index, Curve forwardCurve) { ArgChecker.notNull(index, "index"); ArgChecker.notNull(forwardCurve, "forwardCurve"); this.indexCurves.put(index, forwardCurve); return this; }
Source:
<code>public void ReturnViewWithSizeFormatted_WhenAsked() throws Exception { View view = adapter.getView(0, null, viewGroup); TextView sizeView = (TextView) view.findViewById(R.id.item_history_type); String sizeViewText = sizeView.getText().toString(); assertTrue(sizeViewText.matches( <START> "([0-9]*\\.[0-9]+[0-9]+[K]+[B])|([0-9],[0-9]+[0-9]+[K]+[B])" <END> )); }</code><technical_language>I get this line - testing here. set exact input, output</technical_language>

Target:
public void ReturnViewWithSizeFormatted_WhenAsked() throws Exception { Locale english = new Locale("en", "EN"); Locale.setDefault(english); View view = adapter.getView(0, null, viewGroup); TextView sizeView = (TextView) view.findViewById(R.id.item_history_type); assertThat(sizeView).hasText("1.00KB"); }
Source:
<code>public void onBookPlacedInInventory(OnChangedComponent event, EntityRef inventoryEntity, InventoryComponent inventoryComponent) { if (inventoryEntity.getParentPrefab().getName().equals(Constants.PEDESTAL_PREFAB)) { for (EntityRef item : inventoryComponent.itemSlots) { DisplayNameComponent nameComponent = item.getComponent(DisplayNameComponent.class); if (nameComponent != null && nameComponent.name.equals(Constants.RESEARCH_BOOK_NAME)) { BookComponent bookComponent = item.getComponent(BookComponent.class); List<String> textList = bookComponent.pages; <START> String recipePrefabName = ""; <END> for (String text : textList) { int i = text.indexOf("<recipe"); if (i != -1) { text = text.substring(i); i = text.indexOf(">"); recipePrefabName = text.substring("<recipe".length(), i).replaceAll("\\s", ""); logger.info(recipePrefabName); break; } } Prefab recipe = prefabManager.getPrefab(recipePrefabName); BookRecipeComponent recipeComponent = recipe.getComponent(BookRecipeComponent.class); LaboratoryComponent laboratoryComponent = inventoryEntity.getComponent(LaboratoryComponent.class); logger.info("owner" + laboratoryComponent.laboratoryEntity.getOwner()); addResearchTask(recipeComponent.blockIngredientsList, recipeComponent.blockResult, laboratoryComponent.laboratoryEntity.getOwner(), laboratoryComponent.laboratoryEntity); EntityRef exclamationPoint = entityManager.create(Constants.EXCLAMATION_PREFAB); LocationComponent locationComponent = exclamationPoint.getComponent(LocationComponent.class); LocationComponent pedestalLocationComponent = inventoryEntity.getComponent(LocationComponent.class); locationComponent.setWorldPosition(pedestalLocationComponent.getWorldPosition().addY(1f)); inventoryManager.giveItem(inventoryEntity, inventoryEntity, exclamationPoint); break; } } } }</code><technical_language>move this section a well-named method code easier read</technical_language>

Target:
public void onBookPlacedInInventory(OnChangedComponent event, EntityRef inventoryEntity, InventoryComponent inventoryComponent) { if (inventoryEntity.getParentPrefab().getName().equals(Constants.PEDESTAL_PREFAB)) { for (EntityRef item : inventoryComponent.itemSlots) { DisplayNameComponent nameComponent = item.getComponent(DisplayNameComponent.class); if (nameComponent != null && nameComponent.name.equals(Constants.RESEARCH_BOOK_NAME)) { getResearchRecipe(item, inventoryEntity); break; } } } }
Source:
<code>protected String generateVmConfiguration(VM vm, List<DiskImage> disks, Map<Guid, VmDevice> vmDevices) { if (vm.getInterfaces() == null || vm.getInterfaces().isEmpty()) { vm.setInterfaces(getVmNetworkInterfaceDao().getAllForVm(vm.getId())); } if (StringUtils.isEmpty(vm.getVmtName())) { VmTemplate t = getVmTemplateDao().get(vm.getVmtGuid()); vm.setVmtName(t.getName()); } if (vmDevices == null) { VmDeviceUtils.setVmDevices(vm.getStaticData()); } else { vm.getStaticData().setManagedDeviceMap(vmDevices); } if (disks == null) { disks = ImagesHandler.filterImageDisks(getDiskDao().getAllForVm(vm.getId()), false, true, true); disks.addAll(ImagesHandler.getCinderLeafImages(getDiskDao().getAllForVm(vm.getId()), false)); } for (DiskImage image : disks) { image.setStorageIds(null); } vm.setClusterCompatibilityVersionOrigin(vm.getClusterCompatibilityVersion()); <START> return new OvfManager().exportVm(vm, new ArrayList<>(disks), ClusterUtils.getCompatibilityVersion(vm)); <END> }</code><technical_language>suggest a way: lets call ClusterCompatibilityVersion in ovf VM#getClusterCompatibilityVersion export operation. In import operation do: vm.setClusterCompatibilityVersionOrigin(<parse cluster compatibility ovf>); I is more intuitive way, do think</technical_language>

Target:
protected String generateVmConfiguration(VM vm, List<DiskImage> disks, Map<Guid, VmDevice> vmDevices) { if (vm.getInterfaces() == null || vm.getInterfaces().isEmpty()) { vm.setInterfaces(getVmNetworkInterfaceDao().getAllForVm(vm.getId())); } if (StringUtils.isEmpty(vm.getVmtName())) { VmTemplate t = getVmTemplateDao().get(vm.getVmtGuid()); vm.setVmtName(t.getName()); } if (vmDevices == null) { VmDeviceUtils.setVmDevices(vm.getStaticData()); } else { vm.getStaticData().setManagedDeviceMap(vmDevices); } if (disks == null) { disks = ImagesHandler.filterImageDisks(getDiskDao().getAllForVm(vm.getId()), false, true, true); disks.addAll(ImagesHandler.getCinderLeafImages(getDiskDao().getAllForVm(vm.getId()), false)); } for (DiskImage image : disks) { image.setStorageIds(null); } return new OvfManager().exportVm(vm, new ArrayList<>(disks), ClusterUtils.getCompatibilityVersion(vm)); }
Source:
<code>public AzkabanWebServer(final Server server, final Props props) throws Exception { this.props = requireNonNull(props); this.server = server; this.velocityEngine = configureVelocityEngine(props.getBoolean(VELOCITY_DEV_MODE_PARAM, false)); this.sessionCache = new SessionCache(props); this.userManager = loadUserManager(props); this.executorManager = SERVICE_PROVIDER.getInstance(ExecutorManager.class); this.projectManager = SERVICE_PROVIDER.getInstance(ProjectManager.class); this.triggerManager = SERVICE_PROVIDER.getInstance(TriggerManager.class); this.metricsManager = SERVICE_PROVIDER.getInstance(MetricsManager.class); <START> this.registry = new MetricRegistry(); <END> loadBuiltinCheckersAndActions(); this.scheduleManager = loadScheduleManager(this.triggerManager); final String triggerPluginDir = props.getString("trigger.plugin.dir", "plugins/triggers"); loadPluginCheckersAndActions(triggerPluginDir); this.baseClassLoader = this.getClassLoader(); if (props.containsKey(DEFAULT_TIMEZONE_ID)) { final String timezone = props.getString(DEFAULT_TIMEZONE_ID); System.setProperty("user.timezone", timezone); TimeZone.setDefault(TimeZone.getTimeZone(timezone)); DateTimeZone.setDefault(DateTimeZone.forID(timezone)); logger.info("Setting timezone to " + timezone); } configureMBeanServer(); }</code><technical_language>get Serivce_provider too</technical_language>

Target:
public AzkabanWebServer(final Server server, final Props props) throws Exception { this.props = requireNonNull(props); this.server = server; this.velocityEngine = configureVelocityEngine(props.getBoolean(VELOCITY_DEV_MODE_PARAM, false)); this.sessionCache = new SessionCache(props); this.userManager = loadUserManager(props); this.executorManager = SERVICE_PROVIDER.getInstance(ExecutorManager.class); this.projectManager = SERVICE_PROVIDER.getInstance(ProjectManager.class); this.triggerManager = SERVICE_PROVIDER.getInstance(TriggerManager.class); this.metricsManager = SERVICE_PROVIDER.getInstance(MetricsManager.class); this.registry = SERVICE_PROVIDER.getInstance(MetricRegistry.class); loadBuiltinCheckersAndActions(); this.scheduleManager = loadScheduleManager(this.triggerManager); final String triggerPluginDir = props.getString("trigger.plugin.dir", "plugins/triggers"); loadPluginCheckersAndActions(triggerPluginDir); this.baseClassLoader = this.getClassLoader(); if (props.containsKey(DEFAULT_TIMEZONE_ID)) { final String timezone = props.getString(DEFAULT_TIMEZONE_ID); System.setProperty("user.timezone", timezone); TimeZone.setDefault(TimeZone.getTimeZone(timezone)); DateTimeZone.setDefault(DateTimeZone.forID(timezone)); logger.info("Setting timezone to " + timezone); } configureMBeanServer(); }
Source:
<code>public Object convert(Class destClass, Object srcObject) { Class<?> srcObjectClass = srcObject.getClass(); OffsetDateTime result; if (Date.class.isAssignableFrom(srcObjectClass)) { Instant instant = ((Date) srcObject).toInstant(); result = OffsetDateTime.ofInstant(instant, ZoneId.systemDefault()); } else if (Instant.class.isAssignableFrom(srcObjectClass)) { result = OffsetDateTime.ofInstant(((Instant) srcObject), ZoneId.systemDefault()); } else if (Long.class.isAssignableFrom(srcObjectClass)) { Instant instant = Instant.ofEpochMilli((Long) srcObject); result= OffsetDateTime.ofInstant(instant, ZoneId.systemDefault()); } else { return super.convert(destClass, srcObject); } if (OffsetTime.class.isAssignableFrom(destClass)) { return result.toOffsetTime(); } <START> return result; <END> }</code><technical_language>other, return instantly</technical_language>

Target:
public Object convert(Class destClass, Object srcObject) { OffsetDateTime offsetDateTime = convertToOffsetDateTime(srcObject); if (offsetDateTime != null) { if (OffsetTime.class.isAssignableFrom(destClass)) { return offsetDateTime.toOffsetTime(); } return offsetDateTime; } return super.convert(destClass, srcObject); }
Source:
<code>public Adapter getContentAdapter() { if <START> (adapter == null) { <END> adapter = new AdapterImpl() { @Override public void notifyChanged(final Notification notification) { int type = notification.getEventType(); switch (type) { case Notification.ADD: case Notification.ADD_MANY: case Notification.REMOVE: case Notification.REMOVE_MANY: Display.getDefault().asyncExec(new Runnable() { @Override public void run() { refreshChildren(); } }); break; case Notification.SET: break; } } }; } return adapter; }</code><technical_language>null == adapter</technical_language>

Target:
public Adapter getContentAdapter() { if (null == adapter) { adapter = new AdapterImpl() { @Override public void notifyChanged(final Notification notification) { int type = notification.getEventType(); switch (type) { case Notification.ADD: case Notification.ADD_MANY: case Notification.REMOVE: case Notification.REMOVE_MANY: Display.getDefault().asyncExec(new Runnable() { @Override public void run() { refreshChildren(); } }); break; case Notification.SET: break; } } }; } return adapter; }
Source:
<code>protected void parseDataType(XMLExtendedStreamReader reader, ConfigurationBuilder builder, ConfigurationBuilderHolder holder) throws XMLStreamException { EncodingConfigurationBuilder encodingBuilder = builder.encoding(); for (int i = 0; i < reader.getAttributeCount(); i++) { ParseUtils.requireNoNamespaceAttribute(reader, i); String value = reader.getAttributeValue(i); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); if (attribute == Attribute.MEDIA_TYPE) { if (reader.getSchema().since(11, 0)) { <START> encodingBuilder.mediaType(value); <END> } else { throw ParseUtils.unexpectedAttribute(reader, i); } } else { throw ParseUtils.unexpectedAttribute(reader, i); } } while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { Element element = Element.forName(reader.getLocalName()); switch (element) { case KEY_DATA_TYPE: ContentTypeConfigurationBuilder keyBuilder = encodingBuilder.key(); parseContentType(reader, holder, keyBuilder); ParseUtils.requireNoContent(reader); break; case VALUE_DATA_TYPE: ContentTypeConfigurationBuilder valueBuilder = encodingBuilder.value(); parseContentType(reader, holder, valueBuilder); ParseUtils.requireNoContent(reader); break; default: throw ParseUtils.unexpectedElement(reader); } } }</code><technical_language>do some sort of validation media type? is in standard format (ie. type "/" [tree "."] subtype ["+" suffix] *[";" parameter])</technical_language>

Target:
protected void parseDataType(XMLExtendedStreamReader reader, ConfigurationBuilder builder, ConfigurationBuilderHolder holder) throws XMLStreamException { EncodingConfigurationBuilder encodingBuilder = builder.encoding(); for (int i = 0; i < reader.getAttributeCount(); i++) { ParseUtils.requireNoNamespaceAttribute(reader, i); String value = reader.getAttributeValue(i); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); if (attribute == Attribute.MEDIA_TYPE && reader.getSchema().since(11, 0)) { encodingBuilder.mediaType(value); } else { throw ParseUtils.unexpectedAttribute(reader, i); } } while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { Element element = Element.forName(reader.getLocalName()); switch (element) { case KEY_DATA_TYPE: ContentTypeConfigurationBuilder keyBuilder = encodingBuilder.key(); parseContentType(reader, holder, keyBuilder); ParseUtils.requireNoContent(reader); break; case VALUE_DATA_TYPE: ContentTypeConfigurationBuilder valueBuilder = encodingBuilder.value(); parseContentType(reader, holder, valueBuilder); ParseUtils.requireNoContent(reader); break; default: throw ParseUtils.unexpectedElement(reader); } } }
Source:
<code>public <C extends ServiceConfiguration<?, ?>> Collection<C> getServices(Class<C> configurationType) throws IllegalArgumentException { <START> return serviceConfigurations.stream().filter(service -> configurationType.isAssignableFrom(service.getClass())).map(configurationType::cast).collect(toList()); <END> }</code><technical_language>Multi-line statements _are_ allowed</technical_language>

Target:
public <C extends ServiceConfiguration<?, ?>> Collection<C> getServices(Class<C> configurationType) throws IllegalArgumentException { return serviceConfigurations.stream().filter(configurationType::isInstance).map(configurationType::cast).collect(toList()); }
Source:
<code>public SalesforceDroidGapActivity() { super(); delegate = new SalesforceActivityDelegate(this); <START> authConfig = AuthConfigUtil.getMyDomainAuthConfig(SalesforceHybridSDKManager.getInstance().getLoginServerManager().getSelectedLoginServer().url); <END> }</code><technical_language>if login is deferred, code run soon</technical_language>

Target:
public SalesforceDroidGapActivity() { super(); delegate = new SalesforceActivityDelegate(this); }
Source:
<code>private static ZoneId getZoneId() { if (ZONE_ID == null) { <START> ZONE_ID = ZoneId.of(Calendar.getInstance().getTimeZone().getID()); <END> } return ZONE_ID; }</code><technical_language>ZoneId.systemDefault() here</technical_language>

Target:
private static ZoneId getZoneId() { if (ZONE_ID == null) { ZONE_ID = ZoneId.systemDefault(); } return ZONE_ID; }
Source:
<code>private void setOrgStyle() <START> {MAcctSchema acctSchema = MAcctSchema.getClientAcctSchema(Env.getCtx(), Env.getAD_Client_ID(Env.getCtx()))[0]; <END> if (acctSchema == null) { StringBuffer errorMessage = new StringBuffer(); errorMessage.append("@No Acctschema@"); FDialog.error(form.getWindowNo(), errorMessage.toString()); } MAcctSchemaElement acctElementOrg = acctSchema.getAcctSchemaElement(MAcctSchemaElement.ELEMENTTYPE_Organization); Boolean orgMandatory = acctElementOrg.isBalanced()?true:false; if (orgMandatory) lOrg.setStyle("color : red"); else lOrg.setStyle("color : black"); lPeriodTo.setStyle("color:red"); lCube.setStyle("color:red"); }</code><technical_language>Add a new line please</technical_language>

Target:
private void setOrgStyle() {MAcctSchema acctSchema = MAcctSchema.getClientAcctSchema(Env.getCtx(), Env.getAD_Client_ID(Env.getCtx()))[0]; if (acctSchema == null) { StringBuffer errorMessage = new StringBuffer(); errorMessage.append("@No Acctschema@"); FDialog.error(form.getWindowNo(), "FillMandatory", Msg.parseTranslation(Env.getCtx(), errorMessage.toString())); } MAcctSchemaElement acctElementOrg = acctSchema.getAcctSchemaElement(MAcctSchemaElement.ELEMENTTYPE_Organization); Boolean orgMandatory = acctElementOrg.isBalanced()?true:false; if (orgMandatory) lOrg.setStyle("color : red"); else lOrg.setStyle("color : black"); lPeriodTo.setStyle("color:red"); lCube.setStyle("color:red"); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append(frequency.name()); switch(frequency) { case WEEKLY: sb.append(" on ").append(getDaysCron()); case DAILY: <START> sb.append(" at ").append(hour).append(":").append(mins); <END> break; case NONE: } return sb.toString(); }</code><technical_language>Hours Mins is relevant for Weekly schedule</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(frequency.name()); switch(frequency) { case WEEKLY: sb.append(" on ").append(getDaysCron()); sb.append(" at ").append(hour).append(":").append(mins); break; case DAILY: sb.append(" at ").append(hour).append(":").append(mins); break; case NONE: } return sb.toString(); }
Source:
<code>private boolean validateSameArchitecture(List<VM> vmsToImport) { for (VM vm : vmsToImport) { if <START> (!Objects.equals(vmsToImport.get(0).getClusterArch(), vm.getClusterArch())) <END> { showErrorPopup(constants.sameArchitectureRequired()); return false; } } return true; }</code><technical_language>need call this iteration, remember loop</technical_language>

Target:
private boolean validateSameArchitecture(List<VM> vmsToImport) { final ArchitectureType architectureOfFirst = vmsToImport.get(0).getClusterArch(); for (VM vm : vmsToImport) { if (!Objects.equals(architectureOfFirst, vm.getClusterArch())) { showErrorPopup(constants.sameArchitectureRequired()); return false; } } return true; }
Source:
<code>protected ModelNode createAddSizeRotatingFileHandlerOperation(String handlerName, String formatterName, String fileName, String rotateSize, int maxBackupIndex) { ModelNode op = Util.createAddOperation(createSizeRotatingFileHandlerAddress(handlerName)); op.get(ModelDescriptionConstants.RELATIVE_TO).set("log.dir"); op.get(ModelDescriptionConstants.PATH).set(fileName); op.get(ModelDescriptionConstants.FORMATTER).set(formatterName); <START> if (rotateSize != null) <END> op.get(ModelDescriptionConstants.ROTATE_SIZE).set(rotateSize); op.get(ModelDescriptionConstants.MAX_BACKUP_INDEX).set(maxBackupIndex); return op; }</code><technical_language>Nitpick braces</technical_language>

Target:
protected ModelNode createAddSizeRotatingFileHandlerOperation(String handlerName, String formatterName, String fileName, String rotateSize, int maxBackupIndex) { ModelNode op = Util.createAddOperation(createSizeRotatingFileHandlerAddress(handlerName)); op.get(ModelDescriptionConstants.RELATIVE_TO).set("log.dir"); op.get(ModelDescriptionConstants.PATH).set(fileName); op.get(ModelDescriptionConstants.FORMATTER).set(formatterName); if (rotateSize != null) { op.get(ModelDescriptionConstants.ROTATE_SIZE).set(rotateSize); } op.get(ModelDescriptionConstants.MAX_BACKUP_INDEX).set(maxBackupIndex); return op; }
Source:
<code>public int normalizeStopTimesForPattern (int id, int beginWithSequence) throws SQLException { try { <START> JDBCTableReader<PatternStop> patternStops = new JDBCTableReader(Table.PATTERN_STOP, dataSource, tablePrefix + ".", EntityPopulator.PATTERN_STOP); <END> String patternId = getValueForId(id, "pattern_id", tablePrefix, Table.PATTERNS, connection); List<PatternStop> patternStopsToNormalize = new ArrayList<>(); for (PatternStop patternStop : patternStops.getOrdered(patternId)) { if (patternStop.stop_sequence >= beginWithSequence) { patternStopsToNormalize.add(patternStop); } } int stopTimesUpdated = updateStopTimesForPatternStops(patternStopsToNormalize, null); connection.commit(); return stopTimesUpdated; } catch (Exception e) { e.printStackTrace(); throw e; } finally { DbUtils.closeQuietly(connection); } }</code><technical_language>Please format this line long</technical_language>

Target:
public int normalizeStopTimesForPattern (int id, int beginWithSequence) throws SQLException { try { JDBCTableReader<PatternStop> patternStops = new JDBCTableReader( Table.PATTERN_STOP, dataSource, tablePrefix + ".", EntityPopulator.PATTERN_STOP ); String patternId = getValueForId(id, "pattern_id", tablePrefix, Table.PATTERNS, connection); List<PatternStop> patternStopsToNormalize = new ArrayList<>(); for (PatternStop patternStop : patternStops.getOrdered(patternId)) { if (patternStop.stop_sequence >= beginWithSequence) { patternStopsToNormalize.add(patternStop); } } int stopTimesUpdated = updateStopTimesForPatternStops(patternStopsToNormalize); connection.commit(); return stopTimesUpdated; } catch (Exception e) { e.printStackTrace(); throw e; } finally { DbUtils.closeQuietly(connection); } }
Source:
<code>public void lock(final String reason) { final JsonStructure json = Json.createObjectBuilder() .add("lock_reason", reason) .build(); try{ this.request.method(Request.PUT).uri().path("/lock").back() .body().set(json).back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); <START> } catch (IOException error){} <END> }</code><technical_language>@paulodamaso swallow exception</technical_language>

Target:
public void lock(final String reason) { final JsonStructure json = Json.createObjectBuilder() .add("lock_reason", reason) .build(); try { this.request.method(Request.PUT).uri().path("/lock").back() .body().set(json).back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); } catch (final IOException error) { throw new IllegalStateException(error); } }
Source:
<code>public void run() { boolean startupSuccessful = attemptStartup(); this.started = true; try { Thread.sleep(2000); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } if (startupSuccessful) { waitForStopSignal(); } else { stopAwait(); } }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') a logger log this exception. [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
public void run() { boolean startupSuccessful = attemptStartup(); this.operational = startupSuccessful; this.started = true; try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } if (startupSuccessful) { waitForStopSignal(); } else { stopAwait(); } }
Source:
<code>public static boolean save(ResourceSet resourceSet) { try { for (final Resource resource : resourceSet.getResources()) { resource.save(null); } return true; } catch (final IOException e) { <START> <END> } return false; }</code><technical_language>reportservice</technical_language>

Target:
public static boolean save(ResourceSet resourceSet) { try { for (final Resource resource : resourceSet.getResources()) { resource.save(null); } return true; } catch (final IOException ex) { Activator.getDefault().getReportService().report( new StatusReport(new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage(), ex))); } return false; }
Source:
<code>public void testWriteBehindQueueSize() throws Exception { class TestWriteBehindProvider extends WriteBehindProviderFactory.Provider { private WriteBehind writeBehind = null; @Override public <K, V> WriteBehind<K, V> createWriteBehindLoaderWriter(final CacheLoaderWriter<K, V> cacheLoaderWriter, final WriteBehindConfiguration configuration) { this.writeBehind = super.createWriteBehindLoaderWriter(cacheLoaderWriter, configuration); return writeBehind; } public WriteBehind getWriteBehind() { return writeBehind; } } TestWriteBehindProvider writeBehindProvider = new TestWriteBehindProvider(); WriteBehindTestLoaderWriter<String, String> loaderWriter = new WriteBehindTestLoaderWriter<String, String>(); CacheManager cacheManager = managerBuilder().using(writeBehindProvider).build(true); try { Cache<String, String> testCache = cacheManager.createCache("testAgedBatchedIsWritten", configurationBuilder() .add(new DefaultCacheLoaderWriterConfiguration(loaderWriter)) <START> .add(newBatchedWriteBehindConfiguration(5, SECONDS, 2).build()) <END> .buildConfig(String.class, String.class)); testCache.put("key1", "value"); assertThat(writeBehindProvider.getWriteBehind().getQueueSize(), is(1L)); } finally { cacheManager.close(); } }</code><technical_language>This test run for 5 seconds+ if left that, do complete batch assertion finish faster</technical_language>

Target:
public void testWriteBehindQueueSize() throws Exception { class TestWriteBehindProvider extends WriteBehindProviderFactory.Provider { private WriteBehind writeBehind = null; @Override public <K, V> WriteBehind<K, V> createWriteBehindLoaderWriter(final CacheLoaderWriter<K, V> cacheLoaderWriter, final WriteBehindConfiguration configuration) { this.writeBehind = super.createWriteBehindLoaderWriter(cacheLoaderWriter, configuration); return writeBehind; } public WriteBehind getWriteBehind() { return writeBehind; } } TestWriteBehindProvider writeBehindProvider = new TestWriteBehindProvider(); WriteBehindTestLoaderWriter<String, String> loaderWriter = new WriteBehindTestLoaderWriter<String, String>(); CacheManager cacheManager = managerBuilder().using(writeBehindProvider).build(true); try { Cache<String, String> testCache = cacheManager.createCache("testAgedBatchedIsWritten", configurationBuilder() .add(new DefaultCacheLoaderWriterConfiguration(loaderWriter)) .add(newBatchedWriteBehindConfiguration(5, SECONDS, 2).build()) .buildConfig(String.class, String.class)); testCache.put("key1", "value1"); assertThat(writeBehindProvider.getWriteBehind().getQueueSize(), is(1L)); testCache.put("key2", "value2"); } finally { cacheManager.close(); } }
Source:
<code>Session noAriaSession() { return Session.builder(getQueryRunner().getDefaultSession()) .setSystemProperty(ARIA_SCAN, "false") .setSystemProperty(ARIA_FLAGS, "0") <START> .setCatalogSessionProperty("hive", "aria_scan_enabled", "false") <END> .build(); }</code><technical_language>wrong indentation, HIVE_CATALOG, ARIA_SCAN_ENABLED setCatalogSessionProperty(HIVE_CATALOG, ARIA_SCAN_ENABLED, "false") (ARIA_SCAN_ENABLED field needs changed public in com.facebook.presto.hive.HiveSessionProperties)</technical_language>

Target:
private Session noAriaSession() { return Session.builder(getQueryRunner().getDefaultSession()) .setSystemProperty(ARIA_SCAN, "false") .setSystemProperty(ARIA_FLAGS, "0") .setCatalogSessionProperty(HiveQueryRunner.HIVE_CATALOG, HiveSessionProperties.ARIA_SCAN_ENABLED, "false") .build(); }
Source:
<code>protected void autoSelectGraphicsDevice() { <START> if (getParameters().getGraphicsDevices().size() == 0 END> && getVdsGroup() != null) { OsRepository osRepository = SimpleDependecyInjector.getInstance().get(OsRepository.class); DisplayType defaultDisplayType = getParameters().getVmStaticData().getDefaultDisplayType(); int osId = getParameters().getVmStaticData().getOsId(); Version clusterVersion = getVdsGroup().getCompatibilityVersion(); List<GraphicsType> templateGraphics = VmDeviceUtils.getGraphicsTypesOfEntity(getVmTemplateId()); if (!VmValidationUtils.isGraphicsAndDisplaySupported(osId, clusterVersion, templateGraphics, defaultDisplayType)) { GraphicsType defaultGraphicsType = null; List<Pair<GraphicsType, DisplayType>> pairs = osRepository.getGraphicsAndDisplays(osId, clusterVersion); for (Pair<GraphicsType, DisplayType> pair : pairs) { if (pair.getSecond().equals(defaultDisplayType)) { defaultGraphicsType = pair.getFirst(); break; } } if (defaultGraphicsType != null) { VmDeviceType vmDisplayType = defaultDisplayType.getDefaultVmDeviceType(); GraphicsDevice defaultGraphicsDevice = new GraphicsDevice(vmDisplayType); getParameters().getGraphicsDevices().put(defaultGraphicsType, defaultGraphicsDevice); } } } }</code><technical_language>please isEmpty() instead</technical_language>

Target:
protected void autoSelectGraphicsDevice() { if (getParameters().getGraphicsDevices().isEmpty() && getVdsGroup() != null) { DisplayType defaultDisplayType = getParameters().getVmStaticData().getDefaultDisplayType(); int osId = getParameters().getVmStaticData().getOsId(); Version clusterVersion = getVdsGroup().getCompatibilityVersion(); List<GraphicsType> templateGraphics = VmDeviceUtils.getGraphicsTypesOfEntity(getVmTemplateId()); if (!VmValidationUtils.isGraphicsAndDisplaySupported(osId, clusterVersion, templateGraphics, defaultDisplayType)) { GraphicsType defaultGraphicsType = null; List<Pair<GraphicsType, DisplayType>> pairs = osRepository.getGraphicsAndDisplays(osId, clusterVersion); for (Pair<GraphicsType, DisplayType> pair : pairs) { if (pair.getSecond().equals(defaultDisplayType)) { defaultGraphicsType = pair.getFirst(); break; } } if (defaultGraphicsType != null) { VmDeviceType vmDisplayType = defaultDisplayType.getDefaultVmDeviceType(); GraphicsDevice defaultGraphicsDevice = new GraphicsDevice(vmDisplayType); getParameters().getGraphicsDevices().put(defaultGraphicsType, defaultGraphicsDevice); } } } }
Source:
<code>private Long getNumberOfCases(Session session) { try { Query q = session.createQuery( "select count (distinct doc.name) from XWikiDocument as doc, " + "BaseObject as obj, BaseObject consentObj, DBStringListProperty consentProp where " <START> + HQL_BASE_PATIENT_FILTER); <END> return (Long) q.uniqueResult(); } catch (Exception e) { this.logger.error("Error retrieving a list of patients for matching: {}", e); } return null; }</code><technical_language>need add patientObj</technical_language>

Target:
private Long getNumberOfCases(Session session) { try { Query q = session.createQuery( "select count (distinct doc.name) from " + HQL_BASE_MME_PATIENT_FILTER_FROM + " where " + HQL_BASE_MME_PATIENT_FILTER_WHERE); return (Long) q.uniqueResult(); } catch (Exception e) { this.logger.error("Error retrieving a list of patients for matching: {}", e); } return null; }
Source:
<code>public void testOpsProhibitedOnSuspendedTxFromOtherThread() throws Exception { executeTestForAllCaches(new CI2Exc<Ignite, IgniteCache<Integer, Integer>>() { @Override public void applyx(Ignite ignite, final IgniteCache<Integer, Integer> cache) throws Exception { for (final CI1Exc<Transaction> txOperation : SUSPENDED_TX_PROHIBITED_OPS) { for (TransactionIsolation isolation : TransactionIsolation.values()) { final Transaction tx = ignite.transactions().txStart(transactionConcurrency(), isolation); cache.put(1, 1); tx.suspend(); <START> multithreaded(new RunnableX() { <END> @Override public void runx() throws Exception { GridTestUtils.assertThrowsWithCause(txOperation, tx, IgniteException.class); } }, 1); tx.resume(); tx.close(); assertNull(cache.get(1)); } } } }); }</code><technical_language>replaced lambda</technical_language>

Target:
public void testOpsProhibitedOnSuspendedTxFromOtherThread() throws Exception { executeTestForAllCaches(new CI2Exc<Ignite, IgniteCache<Integer, Integer>>() { @Override public void applyx(Ignite ignite, final IgniteCache<Integer, Integer> cache) throws Exception { for (final CI1<Transaction> txOperation : SUSPENDED_TX_PROHIBITED_OPS) { for (TransactionIsolation isolation : TransactionIsolation.values()) { final Transaction tx = ignite.transactions().txStart(transactionConcurrency(), isolation); cache.put(1, 1); tx.suspend(); multithreaded(() -> GridTestUtils.assertThrowsWithCause(txOperation, tx, IgniteException.class), 1); tx.resume(); tx.close(); assertNull(cache.get(1)); } } } }); }
Source:
<code>protected void resetView(ITmfTrace viewTrace) { List<@NonNull TimeGraphEntry> entryList = getEntryList(viewTrace); super.resetView(viewTrace); if (entryList != null) { synchronized (fEntries) { for (TimeGraphEntry entry : entryList) { if (entry instanceof AggregateTraceEntry) { Collection<@NonNull ITimeGraphDataProvider<? extends TimeGraphEntryModel>> providers = ((AggregateTraceEntry) entry).getProviders(); for (ITimeGraphDataProvider<? extends TimeGraphEntryModel> provider : providers) { fEntries.row(provider).clear(); } } else if (entry instanceof TraceEntry) { fEntries.row(((TraceEntry) entry).getProvider()).clear(); } } } <START> fAggregateGroup.clear(); <END> } }</code><technical_language>This is thread safe, synchronize accesses this variable lock for fEntries. clear row of view trace</technical_language>

Target:
protected void resetView(ITmfTrace viewTrace) { List<@NonNull TimeGraphEntry> entryList = getEntryList(viewTrace); super.resetView(viewTrace); if (entryList != null) { synchronized (fEntries) { for (TimeGraphEntry entry : entryList) { if (entry instanceof AggregateTraceEntry) { Collection<@NonNull ITimeGraphDataProvider<? extends TimeGraphEntryModel>> providers = ((AggregateTraceEntry) entry).getProviders(); for (ITimeGraphDataProvider<? extends TimeGraphEntryModel> provider : providers) { fEntries.row(provider).clear(); } } else if (entry instanceof TraceEntry) { fEntries.row(((TraceEntry) entry).getProvider()).clear(); } } fAggregateEntries.row(viewTrace).clear(); } } }
Source:
<code>private Optional<QueryOrdering> orderingFrom(Query<?> query) throws QueryParseException { Map params = query.getContext().getRequest().getParameterMap(); if (!params.containsKey("order_by")) { return Optional.empty(); } String[] orderByVals = ((String[]) params.get("order_by")); <START> if (orderByVals[0] == null) { <END> return Optional.empty(); } if (orderByVals.length > 1) { throw new QueryParseException("Cannot specify multiple order_by values"); } return Optional.ofNullable(QueryOrdering.fromOrderBy(orderByVals[0])); }</code><technical_language>Iterables.getOnlyOne</technical_language>

Target:
private Optional<QueryOrdering> orderingFrom(Query<?> query) throws QueryParseException { Map params = query.getContext().getRequest().getParameterMap(); if (!params.containsKey("order_by")) { return Optional.empty(); } String[] orderByVals = ((String[]) params.get("order_by")); if (orderByVals.length > 1) { throw new QueryParseException("Cannot specify multiple order_by values"); } if (orderByVals.length == 0) { return Optional.empty(); } return Optional.ofNullable(QueryOrdering.fromOrderBy(orderByVals[0])); }
Source:
<code>public void test_store() throws Exception { int[] storeOpcodes = new int[] {Opcodes.ISTORE, Opcodes.LSTORE, Opcodes.FSTORE, Opcodes.DSTORE, Opcodes.ASTORE}; SymbolicValue sv = new SymbolicValue(); ProgramState startState = ProgramState.EMPTY_STATE.stackValue(sv); for (int opcode : storeOpcodes) { <START> ProgramState programState = execute(new Instruction(opcode, 0), startState); <END> assertThat(programState.getValue(0)).isEqualTo(sv); } }</code><technical_language>I prefer index zero... for sake of testing works 42 67 (because loves prime)</technical_language>

Target:
public void test_store() throws Exception { int[] storeOpcodes = new int[] {Opcodes.ISTORE, Opcodes.LSTORE, Opcodes.FSTORE, Opcodes.DSTORE, Opcodes.ASTORE}; SymbolicValue sv = new SymbolicValue(); ProgramState startState = ProgramState.EMPTY_STATE.stackValue(sv); for (int opcode : storeOpcodes) { ProgramState programState = execute(new Instruction(opcode, 67), startState); assertThat(programState.getValue(67)).isEqualTo(sv); } }
Source:
<code>public void run() { try { int failedCount = exchange.getFailedTransmissionCount() + 1; exchange.setFailedTransmissionCount(failedCount); if (message.isAcknowledged()) { LOGGER.log(Level.FINEST, "Timeout: message already acknowledged, cancel retransmission of {0}", message); return; } else if (message.isRejected()) { LOGGER.log(Level.FINEST, "Timeout: message already rejected, cancel retransmission of {0}", message); return; } else if (message.isCanceled()) { LOGGER.log(Level.FINEST, "Timeout: canceled (MID={0}), do not retransmit", message.getMID()); return; } else if (failedCount <= max_retransmit) { LOGGER.log(Level.FINER, "Timeout: retransmit message, failed: {0}, message: {1}", new Object[]{failedCount, message}); message.retransmitting(); if (!message.isCanceled()) retransmit(); } else { LOGGER.log(Level.FINE, "Timeout: retransmission limit reached, exchange failed, message: {0}", message); exchange.setTimedOut(); message.setTimedOut(true); OptionSet options = message.getOptions(); boolean isBlockwise = options.hasBlock1() || options.hasBlock2(); <START> if (message instanceof Request && isBlockwise) { <END> Request request = exchange.getRequest(); if (request != null && request.getMID() != message.getMID()) { request.setTimedOut(true); } } } } catch (Exception e) { LOGGER.log(Level.SEVERE, String.format("Exception in MessageObserver: %s", e.getMessage()), e); } }</code><technical_language>Exchange.origin field determine if this is outbound request. For purpose e.g. add a Exchange.isOfLocalOrigin() method</technical_language>

Target:
public void run() { try { int failedCount = exchange.getFailedTransmissionCount() + 1; exchange.setFailedTransmissionCount(failedCount); if (message.isAcknowledged()) { LOGGER.log(Level.FINEST, "Timeout: message already acknowledged, cancel retransmission of {0}", message); return; } else if (message.isRejected()) { LOGGER.log(Level.FINEST, "Timeout: message already rejected, cancel retransmission of {0}", message); return; } else if (message.isCanceled()) { LOGGER.log(Level.FINEST, "Timeout: canceled (MID={0}), do not retransmit", message.getMID()); return; } else if (failedCount <= max_retransmit) { LOGGER.log(Level.FINER, "Timeout: retransmit message, failed: {0}, message: {1}", new Object[]{failedCount, message}); message.retransmitting(); if (!message.isCanceled()) retransmit(); } else { LOGGER.log(Level.FINE, "Timeout: retransmission limit reached, exchange failed, message: {0}", message); exchange.setTimedOut(); message.setTimedOut(true); OptionSet options = message.getOptions(); boolean isBlockwise = options.hasBlock1() || options.hasBlock2(); if (exchange.isOfLocalOrigin() && isBlockwise) { Request request = exchange.getRequest(); if (request != null && request.getMID() != message.getMID()) { request.setTimedOut(true); } } } } catch (Exception e) { LOGGER.log(Level.SEVERE, String.format("Exception in MessageObserver: %s", e.getMessage()), e); } }
Source:
<code>synchronized static void cleanNotificationCache(final SQLiteDatabase writableDb) { new Thread(new Runnable() { @Override public void run() { Thread.currentThread().setPriority(Process.THREAD_PRIORITY_BACKGROUND); cleanCachedNotifications(writableDb); cleanCachedUniqueOutcomeEventNotifications(writableDb); } <START> private void cleanCachedNotifications(SQLiteDatabase writableDb) { <END> String whereStr = NotificationTable.COLUMN_NAME_CREATED_TIME + " < ?"; String sevenDaysAgoInSeconds = String.valueOf((System.currentTimeMillis() / 1_000L) - ONE_WEEK_IN_MILLIS); String[] whereArgs = new String[]{ sevenDaysAgoInSeconds }; writableDb.delete( NotificationTable.TABLE_NAME, whereStr, whereArgs); } private void cleanCachedUniqueOutcomeEventNotifications(SQLiteDatabase writableDb) { String whereStr = "NOT EXISTS(SELECT NULL FROM " + NotificationTable.TABLE_NAME + " n WHERE" + " n." + NotificationTable.COLUMN_NAME_NOTIFICATION_ID + " = " + CachedUniqueOutcomeNotificationTable.COLUMN_NAME_NOTIFICATION_ID + ")"; writableDb.delete( CachedUniqueOutcomeNotificationTable.TABLE_NAME, whereStr, null); } }, OS_DELETE_CACHED_NOTIFICATIONS_THREAD).start(); }</code><technical_language>methods (cleanCachedNotifications cleanCachedUniqueOutcomeEventNotifications) thread definition</technical_language>

Target:
synchronized static void cleanNotificationCache(final SQLiteDatabase writableDb) { new Thread(new Runnable() { @Override public void run() { Thread.currentThread().setPriority(Process.THREAD_PRIORITY_BACKGROUND); cleanCachedNotifications(writableDb); cleanCachedUniqueOutcomeEventNotifications(writableDb); } }, OS_DELETE_CACHED_NOTIFICATIONS_THREAD).start(); }
Source:
<code>private static long extractValue(@Nullable Object val) { if (val instanceof Number) { return ((Number) val).longValue(); } <START> return -1; <END> }</code><technical_language>0</technical_language>

Target:
private static long extractValue(@Nullable Object val) { if (val instanceof Number) { return ((Number) val).longValue(); } return 0; }