auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void liveReload() { Supplier<AtlasDbRuntimeConfig> runtimeConfigSupplier = mock(Supplier.class); when(runtimeConfigSupplier.get()) .thenReturn(createRuntimeConfig(TARGETED_SWEEP_ENABLED, BACKGROUND_SWEEP_UNSET)) .thenReturn(createRuntimeConfig(TARGETED_SWEEP_DISABLED, BACKGROUND_SWEEP_UNSET)) .thenReturn(createRuntimeConfig(TARGETED_SWEEP_ENABLED, BACKGROUND_SWEEP_ENABLED)); ShouldRunBackgroundSweepSupplier supplier = new ShouldRunBackgroundSweepSupplier( SWEEP_QUEUE_WRITES_ENABLED, runtimeConfigSupplier); <START> assertThat(supplier.get()).isFalse(); <END> assertThat(supplier.get()).isTrue(); assertThat(supplier.get()).isTrue(); }</code><technical_language>nit, add for assert please, simple java assertThat(supplier.get()) .as("TARGETED_SWEEP_ENABLED, BACKGROUND_SWEEP_UNSET") .isFalse(); etc</technical_language>

Target:
public void liveReload() { Supplier<AtlasDbRuntimeConfig> runtimeConfigSupplier = mock(Supplier.class); when(runtimeConfigSupplier.get()) .thenReturn(createRuntimeConfig(TARGETED_SWEEP_ENABLED, BACKGROUND_SWEEP_UNSET)) .thenReturn(createRuntimeConfig(TARGETED_SWEEP_DISABLED, BACKGROUND_SWEEP_UNSET)) .thenReturn(createRuntimeConfig(TARGETED_SWEEP_ENABLED, BACKGROUND_SWEEP_ENABLED)); ShouldRunBackgroundSweepSupplier supplier = new ShouldRunBackgroundSweepSupplier( SWEEP_QUEUE_WRITES_ENABLED, runtimeConfigSupplier); assertThat(supplier.getAsBoolean()).as("TARGETED_SWEEP_ENABLED, BACKGROUND_SWEEP_UNSET").isFalse(); assertThat(supplier.getAsBoolean()).as("TARGETED_SWEEP_DISABLED, BACKGROUND_SWEEP_UNSET").isTrue(); assertThat(supplier.getAsBoolean()).as("TARGETED_SWEEP_ENABLED, BACKGROUND_SWEEP_ENABLED").isTrue(); }
Source:
<code>public Future<Map<String, Object>> setupNetworks(Map networks, Map bonding, Map options, final boolean isPolicyReset) { final JsonRpcRequest request = new RequestBuilder("Host.setupNetworks").withParameter("networks", networks) .withParameter("bondings", bonding) .withParameter("options", options) .build(); final FutureCallable callable = new FutureCallable(() -> { if (isPolicyReset) { updateHeartbeatPolicy(client.getClientRetryPolicy().clone(), false); if (client.isClosed()) { waitUntilCheck(client -> client.isClosed(), <START> "Waiting on loosing connection to {}", <END> "Connection lost for {}"); } waitUntilCheck(client -> !client.isClosed(), "Waiting on opening connection for {}", "Done reconnecting for {}!"); } return new FutureMap(client, request).withResponseKey("status"); }); FutureTask<Map<String, Object>> future = new FutureTask<Map<String, Object>>(callable) { @Override public boolean isDone() { if (callable.isDone()) { if (isPolicyReset) { updateHeartbeatPolicy(client.getClientRetryPolicy(), true); } return true; } return false; } }; ThreadPoolUtil.execute(future); return future; }</code><technical_language>s/loosing/losing</technical_language>

Target:
public Future<Map<String, Object>> setupNetworks(Map networks, Map bonding, Map options, final boolean isPolicyReset) { final JsonRpcRequest request = new RequestBuilder("Host.setupNetworks").withParameter("networks", networks) .withParameter("bondings", bonding) .withParameter("options", options) .build(); final FutureCallable callable = new FutureCallable(() -> { if (isPolicyReset) { updateHeartbeatPolicy(client.getClientRetryPolicy().clone(), false); if (client.isClosed()) { waitUntilCheck(client -> client.isClosed(), "Waiting on losing connection to {}", "Connection lost for {}"); } waitUntilCheck(client -> !client.isClosed(), "Waiting on opening connection for {}", "Done reconnecting for {}!"); } return new FutureMap(client, request).withResponseKey("status"); }); FutureTask<Map<String, Object>> future = new FutureTask<Map<String, Object>>(callable) { @Override public boolean isDone() { if (callable.isDone()) { if (isPolicyReset) { updateHeartbeatPolicy(client.getClientRetryPolicy(), true); } return true; } return false; } }; ThreadPoolUtil.execute(future); return future; }
Source:
<code>private NodeAddress getSenderNodeAddress(NetworkEnvelope networkEnvelope) { <START> return getPeersNodeAddressOptional().isPresent() ? getPeersNodeAddressOptional().get() : networkEnvelope instanceof SendersNodeAddressMessage ? ((SendersNodeAddressMessage) networkEnvelope).getSenderNodeAddress() : null; <END> }</code><technical_language>is orElse for Optional suggestion return getPeersNodeAddressOptional().orElse( networkEnvelope instanceof SendersNodeAddressMessage ? ((SendersNodeAddressMessage) networkEnvelope).getSenderNodeAddress() : null);</technical_language>

Target:
private NodeAddress getSenderNodeAddress(NetworkEnvelope networkEnvelope) { return getPeersNodeAddressOptional().orElse( networkEnvelope instanceof SendersNodeAddressMessage ? ((SendersNodeAddressMessage) networkEnvelope).getSenderNodeAddress() : null); }
Source:
<code>public String getSQL() { StringBuffer sb = new StringBuffer(); sb.append(OpTypes.aggregateName(opType)).append("("); for (Expression e : nodes) { sb.append(e.getSQL()); } sb.append(") ") .append(Tokens.T_OVER + " ("); if (m_partitionByList.size() > 0) { sb.append(Tokens.T_PARTITION + ' ' + Tokens.T_BY + ' '); for (int idx = 0; idx < m_partitionByList.size(); idx += 1) { Expression expr = m_partitionByList.get(idx); sb.append(expr.getSQL()); <START> if (idx < m_partitionByList.size()-1) { <END> sb.append(", "); } else { sb.append(" "); } } } if (m_sortAndSlice != null && m_sortAndSlice.getOrderLength() > 0) { sb.append(Tokens.T_ORDER + ' ' + Tokens.T_BY + ' '); for (int idx = 0; idx < m_sortAndSlice.getOrderLength(); idx += 1) { Expression obExpr = (Expression) m_sortAndSlice.exprList.get(idx); assert(obExpr instanceof ExpressionOrderBy); ExpressionOrderBy obOrderByExpression = (ExpressionOrderBy)obExpr; sb.append(obExpr.getSQL()) .append(' ') .append(obOrderByExpression.isDescending() ? Tokens.T_DESC : Tokens.T_ASC); if (idx < m_sortAndSlice.getOrderLength()-1) { sb.append(", "); } else { sb.append(" "); } } } sb.append(")"); return sb.toString(); }</code><technical_language>I try handle separator logic this a more terse reassigned prefix idiom: // prefix for element. String prefix = ""; for(...) { ... sb.append(prefix).append(...); // Prefix subsequent element. prefix = ", "; } BTW, put a space a closing paren, anyway</technical_language>

Target:
public String getSQL() { StringBuffer sb = new StringBuffer(); sb.append(OpTypes.aggregateName(opType)).append("("); for (Expression e : nodes) { sb.append(e.getSQL()); } sb.append(") ") .append(Tokens.T_OVER + " ("); if (m_partitionByList.size() > 0) { sb.append(Tokens.T_PARTITION + ' ' + Tokens.T_BY + ' '); String sep = ""; for (int idx = 0; idx < m_partitionByList.size(); idx += 1) { Expression expr = m_partitionByList.get(idx); sb.append(sep) .append(expr.getSQL()); sep = ", "; } } if (m_sortAndSlice != null && m_sortAndSlice.getOrderLength() > 0) { sb.append(Tokens.T_ORDER + ' ' + Tokens.T_BY + ' '); for (int idx = 0; idx < m_sortAndSlice.getOrderLength(); idx += 1) { Expression obExpr = (Expression) m_sortAndSlice.exprList.get(idx); assert(obExpr instanceof ExpressionOrderBy); ExpressionOrderBy obOrderByExpression = (ExpressionOrderBy)obExpr; sb.append(obExpr.getSQL()) .append(' ') .append(obOrderByExpression.isDescending() ? Tokens.T_DESC : Tokens.T_ASC); } } sb.append(")"); return sb.toString(); }
Source:
<code>private void cancel(boolean mayInterruptIfRunning) { <START> synchronized (syncRoot) <END> { if (readerFuture != null) { readerFuture.cancel(mayInterruptIfRunning); readerFuture = null; } } }</code><technical_language>i running.set(false); needs in this method, no? some methods call this cancel(boolean) directly, change running set in cancel()</technical_language>

Target:
private void cancel(boolean mayInterruptIfRunning) { synchronized (syncRoot) { running.set(false); if (readerFuture != null) { readerFuture.cancel(mayInterruptIfRunning); readerFuture = null; } } }
Source:
<code>public void requestSinglePulse(GlowBlock block, long tickDelay) { Location target = block.getLocation(); <START> singleTickMap.put(target, worldAge + tickDelay); <END> }</code><technical_language>Do want allow negative tickDelays</technical_language>

Target:
public void requestSinglePulse(GlowBlock block, long tickDelay) { Location target = block.getLocation(); if (tickDelay < 0) tickDelay = 0; singleTickMap.put(target, worldAge + tickDelay); }
Source:
<code>private void updateScoreStatistics(PersonaInfo pi) { listScoreStatistics = scoreStatisticsFromJSON(pi); ContentValues contentValues = scoreStatisticsForDB(pi, mSelectedPersona); try { <START> getContext().getContentResolver().insert(ScoreStatistics.URI, contentValues); <END> } catch(SQLiteConstraintException ex) { getContext().getContentResolver().update( ScoreStatistics.URI, contentValues, ScoreStatistics.Columns.PERSONA_ID + "=?", new String[] { String.valueOf(pi.getPersonaId()) } ); } }</code><technical_language>If insert fails catch do update</technical_language>

Target:
private void updateScoreStatistics(PersonaInfo pi) { listScoreStatistics = scoreStatisticsFromJSON(pi); ContentValues contentValues = scoreStatisticsForDB(pi, mSelectedPersona); getContext().getContentResolver().insert(ScoreStatistics.URI, contentValues); }
Source:
<code><START> public ComboBoxModel doFillEnvironmentItems(@QueryParameter(value = "credential") @RelativePath(value = "..") String credential, <END> @QueryParameter(value = "credential") String credential2, @AncestorInPath AbstractProject project) { String creds = !isNullOrEmpty(credential) ? credential : credential2; Credential overridingCredential = RepositoryUtils.retrieveOverridingCredentialFromProject(project); List<String> environments = new ArrayList<String>(); if (!isNullOrEmpty(creds)) { DeployitServer deployitServer = RepositoryUtils.getDeployitServer(creds, overridingCredential, project); environments = RepositoryUtils.environments(deployitServer); } return new ComboBoxModel(environments); }</code><technical_language>This method RequirePOST permission check</technical_language>

Target:
public ComboBoxModel doFillEnvironmentItems(@QueryParameter(value = "credential") @RelativePath(value = "..") String credential, @QueryParameter(value = "credential") String credential2, @AncestorInPath AbstractProject project) { project.checkPermission(Jenkins.ADMINISTER); String creds = !isNullOrEmpty(credential) ? credential : credential2; Credential overridingCredential = RepositoryUtils.retrieveOverridingCredentialFromProject(project); List<String> environments = new ArrayList<String>(); if (!isNullOrEmpty(creds)) { DeployitServer deployitServer = RepositoryUtils.getDeployitServer(creds, overridingCredential, project); environments = RepositoryUtils.environments(deployitServer); } return new ComboBoxModel(environments); }
Source:
<code><START> public void readConfiguration(File file) throws IOException, FileNotFoundException { <END> setConfiguration(Configuration.read(file)); }</code><technical_language>FileNotFoundException is a subclass of IOException</technical_language>

Target:
public void readConfiguration(File file) throws IOException { setConfiguration(Configuration.read(file)); }
Source:
<code>protected void verifyNormalizedMimetype(String expectedNormalizedMimetype, String mimetype) { <START> Optional<String> optional = mimetypeRegistryService.getNormalizedMimeType(mimetype); <END> assertTrue(String.format("'%s' should have a normalized mime type", mimetype), optional.isPresent()); assertEquals( String.format("The normalized mime type for '%s' should be '%s'", mimetype, expectedNormalizedMimetype), expectedNormalizedMimetype, optional.get()); }</code><technical_language>about: java mimetypeRegistryService.getNormalizedMimeType(mimetype) .ifPresentOrElse(mt -> assertEquals(expectedNormalizedMimetype, mt), () -> fail(String.format("'%s' a normalized mime type", mimetype)));</technical_language>

Target:
protected void verifyNormalizedMimetype(String expectedNormalizedMimetype, String mimetype) { mimetypeRegistryService.getNormalizedMimeType(mimetype) .ifPresentOrElse(r -> assertEquals(expectedNormalizedMimetype, r), () -> fail(String.format("'%s' should have a normalized mime type", mimetype))); }
Source:
<code>public Key getNextKeyHint(Key k, Value v) { if (cso.minCf.getLength() > 0) { int minCfCmp = k.compareColumnFamily(cso.minCf); if (minCfCmp < 0) { Key hint = new Key(k.getRow(), cso.minCf); return cso.minInclusive ? hint : hint.followingKey(PartialKey.ROW_COLFAM); } } if (cso.minCq.getLength() > 0) { int minCqCmp = k.compareColumnQualifier(cso.minCq); if (minCqCmp < 0) { Key hint = new Key(k.getRow(), k.getColumnFamily(), cso.minCq); return cso.minInclusive ? hint : hint.followingKey(PartialKey.ROW_COLFAM_COLQUAL); } } <START> return null; <END> }</code><technical_language>This case is covered in unit test</technical_language>

Target:
public Key getNextKeyHint(Key k, Value v) throws IllegalArgumentException { if (cso.minCf.getLength() > 0) { int minCfCmp = k.compareColumnFamily(cso.minCf); if (minCfCmp < 0) { Key hint = new Key(k.getRow(), cso.minCf); return cso.minInclusive ? hint : hint.followingKey(PartialKey.ROW_COLFAM); } } if (cso.minCq.getLength() > 0) { int minCqCmp = k.compareColumnQualifier(cso.minCq); if (minCqCmp < 0) { Key hint = new Key(k.getRow(), k.getColumnFamily(), cso.minCq); return cso.minInclusive ? hint : hint.followingKey(PartialKey.ROW_COLFAM_COLQUAL); } } throw new IllegalArgumentException("Don't know how to provide hint for key " + k); }
Source:
<code>Options(String[] args) throws CmdLineException { CmdLineParser parser = new CmdLineParser(this); try { parser.parseArgument(args); if(arguments.isEmpty()) throw new CmdLineException(parser, "No files were given"); } catch (CmdLineException e) { <START> System.err.println(e.getMessage()); <END> System.err.println("Usage: cl2dts [options...] arguments..."); parser.printUsage(System.err); System.err.println(); throw e; } }</code><technical_language>Move this usage stuff main method? relevant for command line execution, IMHO belong main()</technical_language>

Target:
Options(String[] args) throws CmdLineException { CmdLineParser parser = new CmdLineParser(this); parser.parseArgument(args); if(arguments.isEmpty()) { throw new CmdLineException(parser, "No files were given"); } }
Source:
<code>private Counter getSuccessCounter() { <START> return registry.counter("pubsub.amazon.published", "name", getName(), "topic", getTopicName()); <END> }</code><technical_language>init store instance var</technical_language>

Target:
private Counter getSuccessCounter() { return successCounter; }
Source:
<code>public KubernetesPluginsToolingApplier( @Named("che.workspace.sidecar.image_pull_policy") String sidecarImagePullPolicy, @Named("che.workspace.sidecar.default_memory_limit_mb") long defaultSidecarMemoryLimitMB, @Named("che.agents.auth_enabled") boolean isAuthEnabled) { this.defaultSidecarMemoryLimitBytes = String.valueOf(defaultSidecarMemoryLimitMB * 1024 * 1024); this.isAuthEnabled = isAuthEnabled; <START> this.sidecarImagePullPolicy = <END> stream(ImagePullPolicies.values()) .anyMatch(p -> p.getPolicy().equals(sidecarImagePullPolicy)) ? sidecarImagePullPolicy : null; }</code><technical_language>set in a static field simpler</technical_language>

Target:
public KubernetesPluginsToolingApplier( @Named("che.workspace.sidecar.image_pull_policy") String sidecarImagePullPolicy, @Named("che.workspace.sidecar.default_memory_limit_mb") long defaultSidecarMemoryLimitMB, @Named("che.agents.auth_enabled") boolean isAuthEnabled) { this.defaultSidecarMemoryLimitBytes = String.valueOf(defaultSidecarMemoryLimitMB * 1024 * 1024); this.isAuthEnabled = isAuthEnabled; this.sidecarImagePullPolicy = validImagePullPolicies.contains(sidecarImagePullPolicy) ? sidecarImagePullPolicy : null; }
Source:
<code>private MamManager(XMPPConnection connection, Jid archiveAddress) { super(connection); this.archiveAddress = archiveAddress; serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); <START> this.adHocCommandManager = AdHocCommandManager.getAddHocCommandsManager(connection); <END> }</code><technical_language>serviceDiscoveryManager in line above, do need qualify field this. here</technical_language>

Target:
private MamManager(XMPPConnection connection, Jid archiveAddress) { super(connection); this.archiveAddress = archiveAddress; serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); adHocCommandManager = AdHocCommandManager.getAddHocCommandsManager(connection); }
Source:
<code>public String classId() { <START> String computedClassId = computeClassId(); <END> boolean appendFormId = !getClass().isAnnotationPresent(ClassId.class); if (appendFormId) { String formClassId = getForm() != null ? ID_CONCAT_SYMBOL + getForm().classId() : ""; computedClassId = computedClassId + formClassId; } boolean duplicate = existsDuplicateClassId(); if (duplicate) { LOG.warn("Found a duplicate classid for {}, adding field index. Override classId for dynamically injected fields.", computedClassId); int fieldIndex = getParentField().getFieldIndex(this); computedClassId += ID_CONCAT_SYMBOL + fieldIndex; } return computedClassId; }</code><technical_language>a StringBuilder more efficient</technical_language>

Target:
public String classId() { StringBuilder classId = new StringBuilder(computeClassId()); boolean appendFormId = !getClass().isAnnotationPresent(ClassId.class); if (appendFormId && getForm() != null) { classId.append(ID_CONCAT_SYMBOL).append(getForm().classId()); } boolean duplicate = existsDuplicateClassId(); if (duplicate) { LOG.warn("Found a duplicate classid for {}, adding field index. Override classId for dynamically injected fields.", classId); int fieldIndex = getParentField().getFieldIndex(this); classId.append(ID_CONCAT_SYMBOL).append(fieldIndex); } return classId.toString(); }
Source:
<code>private Slave prepareAgentDocker() throws Exception { switch(platform) { case SLIM: case ALPINE: case CENTOS: case UBUNTU: return prepareDockerPlatforms(); case SIMPLE: <START> return prepareAgentCommandLauncher(); <END> default: fail("Unknown test platform: " + platform); return null; } }</code><technical_language>Ah, OK, clearer</technical_language>

Target:
private Slave prepareAgentDocker() throws Exception { switch(platform) { case SLIM: case ALPINE: case CENTOS: case UBUNTU: return prepareDockerPlatforms(); case NO_INIT: return new DumbSlave("docker", "/home/jenkins/agent", new SimpleCommandLauncher("docker run -i --rm jenkins/slave:3.29-2 java -jar /usr/share/jenkins/slave.jar")); default: fail("Unknown test platform: " + platform); return null; } }
Source:
<code>private <E extends Element> DocumentResult index(Set<? extends DocSchema<E>> schemas, E element, boolean create) throws IOException { for(DocSchema<E> schema : schemas) { DocSchema.Document document = schema.toDocument(element); if (document != null) { if (create) { <START> Get getRequest = new Get.Builder(document.getIndex(), document.getId()).build(); <END> if (this.client.execute(getRequest).isSucceeded()) { throw new DocumentAlreadyExistsException( new ShardId(document.getIndex(), -1), document.getType(), document.getId()); } } Index index = new Index.Builder(Seq.seq(document.getFields())) .id(document.getId()) .index(document.getIndex()) .type(document.getType()) .refresh(true) .build(); return this.client.execute(index); } } return null; }</code><technical_language>Is extra query necessary? Index.Builder accept some parameter check this</technical_language>

Target:
private <E extends Element> DocumentResult index(Set<? extends DocSchema<E>> schemas, E element, boolean create) { for (DocSchema<E> schema : schemas) { DocSchema.Document document = schema.toDocument(element); if (document != null) { if (create) { Get getRequest = new Get.Builder(document.getIndex(), document.getId()).build(); try { if (this.client.execute(getRequest).isSucceeded()) { throw new DocumentAlreadyExistsException( new ShardId(document.getIndex(), -1), document.getType(), document.getId()); } } catch (IOException e) { e.printStackTrace(); } } Index index = new Index.Builder(document.getFields()) .id(document.getId()) .index(document.getIndex()) .type(document.getType()) .refresh(true) .build(); try { return this.client.execute(index); } catch (IOException e) { e.printStackTrace(); } } } return null; }
Source:
<code>private void createActions() { Action resolveAllAsRemote = new Action(Messages.SyncMergeFileTableViewer_Resolve_all_as_remote, IAction.AS_PUSH_BUTTON) { @Override public void run() { String currentSyncServiceId = <START> SyncConfigManager.getActive(project).getSyncProviderId(); <END> ISynchronizeService syncService = SyncManager.getSyncService(currentSyncServiceId); ArrayList<IPath> paths = new ArrayList<IPath>(); for (IResource resource : getAllResources()) { paths.add(resource.getProjectRelativePath()); } try { syncService.checkoutRemoteCopy(project, paths.toArray(new IPath[paths.size()])); syncService.setMergeAsResolved(project, paths.toArray(new IPath[paths.size()])); } catch (CoreException e) { RDTSyncUIPlugin.getDefault().logErrorMessage(Messages.SyncMenuOperation_1); } activeViewerInstance.update(null); } }; resolveAllAsRemote.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin( RDTSyncUIPlugin.PLUGIN_ID, "icons/mergeview/resolve_as_remote.gif")); IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager(); toolbar.add(resolveAllAsRemote); }</code><technical_language>Need check for null project</technical_language>

Target:
private void createActions() { Action resolveAllAsRemote = new Action(Messages.SyncMergeFileTableViewer_Resolve_all_as_remote, IAction.AS_PUSH_BUTTON) { @Override public void run() { if (project == null) { return; } String currentSyncServiceId = SyncConfigManager.getActive(project).getSyncProviderId(); ISynchronizeService syncService = SyncManager.getSyncService(currentSyncServiceId); Set<IPath> paths = getAllPaths(); try { syncService.checkoutRemoteCopy(project, paths.toArray(new IPath[paths.size()])); syncService.setMergeAsResolved(project, paths.toArray(new IPath[paths.size()])); } catch (CoreException e) { MessageDialog.openError(null, Messages.SyncMergeFileTableViewer_Error, Messages.SyncMergeFileTableViewer_Error_resolving_all + Messages.SyncMergeFileTableViewer_Error_description + e.getMessage()); } activeViewerInstance.update(null); } }; resolveAllAsRemote.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin( RDTSyncUIPlugin.PLUGIN_ID, "icons/mergeview/resolve_as_remote.gif")); IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager(); toolbar.add(resolveAllAsRemote); }
Source:
<code>public void shouldEmitNoRecordIfTransformReturnsNull() { final ProcessorContext context = mock(ProcessorContext.class); final ValueTransformerWithKey<Integer, Integer, Integer> valueTransformer = mock(ValueTransformerWithKey.class); final KStreamTransformValues.KStreamTransformValuesProcessor<Integer, Integer, Integer> processor = new KStreamTransformValues.KStreamTransformValuesProcessor<>(valueTransformer); processor.init(context); <START> EasyMock.reset(context, valueTransformer); <END> final Integer inputKey = 1; final Integer inputValue = 10; EasyMock.expect(valueTransformer.transform(inputKey, inputValue)).andReturn(null); EasyMock.replay(context, valueTransformer); processor.process(inputKey, inputValue); EasyMock.verify(context, valueTransformer); }</code><technical_language>req: please remove context reset()? behavior for it, do need reset it</technical_language>

Target:
public void shouldEmitNoRecordIfTransformReturnsNull() { final ProcessorContext context = mock(ProcessorContext.class); final ValueTransformerWithKey<Integer, Integer, Integer> valueTransformer = mock(ValueTransformerWithKey.class); final KStreamTransformValues.KStreamTransformValuesProcessor<Integer, Integer, Integer> processor = new KStreamTransformValues.KStreamTransformValuesProcessor<>(valueTransformer); processor.init(context); final Integer inputKey = 1; final Integer inputValue = 10; EasyMock.expect(valueTransformer.transform(inputKey, inputValue)).andStubReturn(null); EasyMock.replay(context); processor.process(inputKey, inputValue); EasyMock.verify(context); }
Source:
<code><START> public void setPrecision(final TimeUnit precision) { <END> this.precision = precision; }</code><technical_language>is this setter public, a builder is responsible do object creation</technical_language>

Target:
void setPrecision(final TimeUnit precision) { this.precision = precision; }
Source:
<code>public void loginExistingAccount(String userName, String password) { waitForElementByElement(existingUsernameField); existingUsernameField.sendKeys(userName); PageObjectLogging.log("loginExistingAccount", "username " + userName + " typed into the field", true); waitForElementByElement(existingPasswordField); existingPasswordField.sendKeys(password); PageObjectLogging.log("loginExistingAccount", "password " + password + " typed into the field", true); loginExistingButton.click(); <START> PageObjectLogging.log("loginExistingAccount", "login button clicked", true); <END> }</code><technical_language>global event listener log click, need do yourself</technical_language>

Target:
public void loginExistingAccount(String userName, String password) { waitForElementByElement(existingUsernameField); existingUsernameField.sendKeys(userName); PageObjectLogging.log("loginExistingAccount", "username " + userName + " typed into the field", true); waitForElementByElement(existingPasswordField); existingPasswordField.sendKeys(password); PageObjectLogging.log("loginExistingAccount", "password " + password + " typed into the field", true); loginExistingButton.click(); }
Source:
<code>static Configuration getConfiguration(String modid, String name) { <START> if(name == null || name.isEmpty()) <END> name = modid; File configDir = Loader.instance().getConfigDir(); File configFile = new File(configDir, name + ".cfg"); return CONFIGS.get(configFile.getAbsolutePath()); }</code><technical_language>Strings.isNullOrEmpty(name)</technical_language>

Target:
static Configuration getConfiguration(String modid, String name) { if (Strings.isNullOrEmpty(name)) name = modid; File configDir = Loader.instance().getConfigDir(); File configFile = new File(configDir, name + ".cfg"); return CONFIGS.get(configFile.getAbsolutePath()); }
Source:
<code>private void InitializeItems(List<SanTargetModel> newItems) { <START> if (getItems() == null) <END> { setItems(new ObservableCollection<SanTargetModel>()); } ArrayList<SanTargetModel> items = new ArrayList<SanTargetModel>(); items.addAll((List<SanTargetModel>) getItems()); if (newItems != null) { for (SanTargetModel newItem : newItems) { if (Linq.FirstOrDefault(items, new Linq.TargetPredicate(newItem)) == null) { items.add(newItem); } } } setItems(items); UpdateLoginAllAvailability(); }</code><technical_language>this happen</technical_language>

Target:
private void InitializeItems(List<SanTargetModel> newItems) { if (getItems() == null) { setItems(new ObservableCollection<SanTargetModel>()); } if (newItems != null) { ArrayList<SanTargetModel> items = new ArrayList<SanTargetModel>(); items.addAll((List<SanTargetModel>) getItems()); for (SanTargetModel newItem : newItems) { if (Linq.FirstOrDefault(items, new Linq.TargetPredicate(newItem)) == null) { items.add(newItem); } } setItems(items); } UpdateLoginAllAvailability(); }
Source:
<code><START> public RowBatch nextBatch(RowBatch previous) throws IOException { <END> MessageType requestedSchema = readContext.getRequestedSchema(); List<ColumnDescriptor> columns = requestedSchema.getColumns(); int nColumns = columns.size(); ColumnVector[] columnVectors; RowBatch rowBatch = previous; if (rowBatch == null) { rowBatch = new RowBatch(); } if (rowBatch.getColumns() == null) { columnVectors = new ColumnVector[nColumns]; rowBatch.setColumns(columnVectors); } else { columnVectors = rowBatch.getColumns(); } MessageType[] columnSchemas = new MessageType[nColumns]; for (int i = 0; i < nColumns; i++) { ColumnVector columnVector = columnVectors[i]; columnSchemas[i] = new MessageType(requestedSchema.getFieldName(i), requestedSchema.getType(i)); if (columnVector == null) { columnVector = ColumnVector.from(columns.get(i)); } rowBatch.getColumns()[i] = columnVector; } return readVectors(rowBatch.getColumns(), columnSchemas) ? rowBatch : null; }</code><technical_language>"nextBatch" in contexts do things. add a verb in there</technical_language>

Target:
public RowBatch nextBatch(RowBatch previous) throws IOException { MessageType requestedSchema = readContext.getRequestedSchema(); List<ColumnDescriptor> columns = requestedSchema.getColumns(); int nColumns = columns.size(); ColumnVector[] columnVectors; RowBatch rowBatch = previous; if (rowBatch == null) { rowBatch = new RowBatch(new ColumnVector[nColumns]); } columnVectors = rowBatch.getColumns(); checkArgument(columns.size() == columnVectors.length, "Number of columns in the requested schema and the previous row batch don't match."); MessageType[] columnSchemas = new MessageType[nColumns]; for (int i = 0; i < nColumns; i++) { ColumnVector columnVector = columnVectors[i]; columnSchemas[i] = new MessageType(requestedSchema.getFieldName(i), requestedSchema.getType(i)); if (columnVector == null) { columnVector = ColumnVector.from(columns.get(i)); } rowBatch.getColumns()[i] = columnVector; } return readVectors(rowBatch.getColumns(), columnSchemas) ? rowBatch : null; }
Source:
<code>private String startPasswordDialog(String user) throws IOException { log.debug("starting password dialog."); <START> System.out.println(String.format("Please enter a password for %s:",user)); <END> return new String(System.console().readPassword()); }</code><technical_language>u simply System.out.printf("Please enter a password for %s:",user);</technical_language>

Target:
private String startPasswordDialog(String user) throws IOException { log.debug("starting password dialog."); System.out.printf("Please enter a password for %s:",user); return new String(System.console().readPassword()); }
Source:
<code>public List<StoredQuery> listStoredQueries() { final List<StoredQuery> queries = new ArrayList<>(); queries.add(StoredQuery.DEFAULT); final Resource dir = storedQueryDir(); final List<StoredQuery> globalQueries = getStoredQueryByResource(dir); final List<StoredQuery> localQueries = getLocalWorkspaceStoredQueries(); if (shouldProcessGlobalQueries()) { globalQueries .stream() .filter( q -> <START> localQueries <END> .stream() .noneMatch( local -> Objects.equals( q.getName(), local.getName()))) .forEach(q -> queries.add(q)); } queries.addAll(localQueries); return queries; }</code><technical_language>This is painful (the deep nesting indenting), get code storing this bit of code in method I believe</technical_language>

Target:
public List<StoredQuery> listStoredQueries() { final List<StoredQuery> queries = new ArrayList<>(); queries.add(StoredQuery.DEFAULT); final Resource dir = storedQueryDir(); final List<StoredQuery> globalQueries = getStoredQueryByResource(dir); final List<StoredQuery> localQueries = getLocalWorkspaceStoredQueries(); if (shouldProcessGlobalQueries()) { globalQueries .stream() .filter(q -> checkQueryNotExists(q, localQueries)) .forEach(q -> queries.add(q)); } queries.addAll(localQueries); return queries; }
Source:
<code>public void testCrossJoinBroadcastRightNoHint() throws Exception { if (useSpark.equalsIgnoreCase("false")) return; String sqlText = "sparkexplain select count(*) from\n" + " t1 --splice-properties useSpark=true\n" + " inner join big on 1=1"; <START> testQueryContains(sqlText, "BroadcastNestedLoopJoin BuildRight, Cross", methodWatcher, true); <END> }</code><technical_language>add a check for static explain table BIG is picked left table of cross join? Thanks</technical_language>

Target:
public void testCrossJoinBroadcastRightNoHint() throws Exception { if (useSpark.equalsIgnoreCase("false")) return; String sqlText = "explain select count(*) from\n" + " t1 --splice-properties useSpark=true\n" + " inner join big on 1=1"; String[] expectedList = {"CrossJoin", "TableScan[T1(", "TableScan[BIG("}; rowContainsQuery(new int[]{6, 7, 9}, sqlText, methodWatcher, expectedList); sqlText = "sparkexplain select count(*) from\n" + " t1 --splice-properties useSpark=true\n" + " inner join big on 1=1"; String expected = "BroadcastNestedLoopJoin BuildRight, Cross |\n" + " :- Scan ExistingRDD[] |\n" + "-> TableScan[BIG("; testQueryContains(sqlText, expected, methodWatcher, true); }
Source:
<code>public Mono<Void> deleteAllById(Iterable<? extends ID> ids) { Assert.notNull(ids, "The given Iterable of entities must not be null"); <START> return Flux.fromIterable(ids).flatMap(this::deleteById).then(); <END> }</code><technical_language>semantics findAllById( ) query mechanism avoid individual database queries for ID</technical_language>

Target:
public Mono<Void> deleteAllById(Iterable<? extends ID> ids) { Assert.notNull(ids, "The given Iterable of entities must not be null"); if (FindByIdQuery.hasCompositeKeys(ids)) { return deleteById(Flux.fromIterable(ids)); } if (!ids.iterator().hasNext()) { return Mono.empty(); } return this.operations.delete(createIdsInCollectionQuery(ids), this.entityInformation.getJavaType()).then(); }
Source:
<code>protected void executeCommand() { <START> VDSGroup cluster = getVdsGroupDAO().get(getParameters().getClusterId()); <END> try { getSyncJobInstance().refreshHooksInCluster(cluster, true); setSucceeded(true); } catch (VdcBLLException e) { setSucceeded(false); } }</code><technical_language>need manually get db, getVdsGroup()</technical_language>

Target:
protected void executeCommand() { getSyncJobInstance().refreshHooksInCluster(getVdsGroup(), true); setSucceeded(true); }
Source:
<code>private void resetVisibleLimits() { try { getLocalStore().resetVisibleLimits(getDisplayCount()); } catch (MessagingException e) { <START> Timber.e("Unable to reset visible limits", e); <END> } }</code><technical_language>Timber exceptions argument. Format string arguments end</technical_language>

Target:
private void resetVisibleLimits() { try { getLocalStore().resetVisibleLimits(getDisplayCount()); } catch (MessagingException e) { Timber.e(e, "Unable to reset visible limits"); } }
Source:
<code>public int[] getRequiredTokens() { return new int[] { <START> TokenTypes.SEMI, <END> }; }</code><technical_language>I a bit confused this check called line of code</technical_language>

Target:
public int[] getRequiredTokens() { return CommonUtil.EMPTY_INT_ARRAY; }
Source:
<code>public JobExecutionInfoResource getJobExecutionInfo(@PathVariable long executionId) { final JobExecution jobExecution; try { jobExecution = jobService.getJobExecution(executionId); } catch (org.springframework.batch.core.launch.NoSuchJobExecutionException e) { throw new NoSuchJobExecutionException(executionId); } final Set<String> restartableJobs = new HashSet<String>(jobLocator.getAllRestartableJobs()); final Set<String> deployedJobs = new HashSet<String>(jobLocator.getJobNames()); final Set<String> jobDefinitionNames = new HashSet<String>(getJobDefinitionNames()); final JobExecutionInfoResource jobExecutionInfoResource = getJobExecutionInfoResource(jobExecution, restartableJobs, deployedJobs, jobDefinitionNames); for (JobExecution childJobExecution : jobService.getChildJobExecutions(jobExecution.getId())) { jobExecutionInfoResource.setComposedJob(true); <START> stepExecutionDao.addStepExecutions(childJobExecution); <END> final JobExecutionInfoResource childJobExecutionInfoResource = getJobExecutionInfoResource( childJobExecution, restartableJobs, deployedJobs, jobDefinitionNames); boolean isCompposed = jobService.isComposedJobExecution(childJobExecution.getId()); childJobExecutionInfoResource.setComposedJob(isCompposed); jobExecutionInfoResource.getChildJobExecutions().add(childJobExecutionInfoResource); } return jobExecutionInfoResource; }</code><technical_language>Is this correct set childJobExecution stepExecutions here</technical_language>

Target:
public JobExecutionInfoResource getJobExecutionInfo(@PathVariable long executionId) { final JobExecution jobExecution; try { jobExecution = jobService.getJobExecution(executionId); } catch (org.springframework.batch.core.launch.NoSuchJobExecutionException e) { throw new NoSuchJobExecutionException(executionId); } final Set<String> restartableJobs = new HashSet<String>(jobLocator.getAllRestartableJobs()); final Set<String> deployedJobs = new HashSet<String>(jobLocator.getJobNames()); final Set<String> jobDefinitionNames = new HashSet<String>(getJobDefinitionNames()); final JobExecutionInfoResource jobExecutionInfoResource = getJobExecutionInfoResource(jobExecution, restartableJobs, deployedJobs, jobDefinitionNames); for (JobExecution childJobExecution : jobService.getChildJobExecutions(jobExecution.getId())) { jobExecutionInfoResource.setComposedJob(true); stepExecutionDao.addStepExecutions(childJobExecution); final JobExecutionInfoResource childJobExecutionInfoResource = getJobExecutionInfoResource( childJobExecution, restartableJobs, deployedJobs, jobDefinitionNames); boolean isComposed = jobService.isComposedJobExecution(childJobExecution.getId()); childJobExecutionInfoResource.setComposedJob(isComposed); jobExecutionInfoResource.getChildJobExecutions().add(childJobExecutionInfoResource); } return jobExecutionInfoResource; }
Source:
<code>public void create_entity_with_default_values() { final int version = 100500; final String expectedState = Values.newStringValue("").getValue(); final Timestamp defaultTimestamp = Timestamp.getDefaultInstance(); <START> final Entity entity = givenEntity().withVersion(version).build(); <END> final String actualState = entity.getState().toString(); assertEquals(TestEntity.class, entity.getClass()); assertEquals(0L, entity.getId()); assertEquals(expectedState, actualState); assertEquals(version, entity.getVersion()); assertEquals(defaultTimestamp, entity.whenModified()); }</code><technical_language>If try create Entity default values, do initialize a custom version</technical_language>

Target:
public void create_entity_with_default_values() { final Entity entity = givenEntity().build(); assertEquals(TestEntity.class, entity.getClass()); assertEquals(0L, entity.getId()); assertEquals(newStringValue(""), entity.getState()); assertEquals(0, entity.getVersion()); assertEquals(Timestamp.getDefaultInstance(), entity.whenModified()); }
Source:
<code>protected void execute() { <START> logger.debug("execute() method is called!"); <END> }</code><technical_language>Implement AbstractBinding instead of AbstractActiveBinding if do polling interval</technical_language>

Target:
public void execute() { if (!bindingsExist()) { logger.warn("There is no existing Girahomeserver binding configuration => refresh cycle aborted!"); return; } GiraHomeServerConnector connector = new GiraHomeServerConnector(ip, port, password); try { connector.connect(); readValuesFromGirahomeserver(connector); flushValuesToGirahomeserver(connector); } catch (UnknownHostException e) { logger.warn("the given hostname '{}' of the Gira Home Server is unknown", ip); } catch (IOException e) { logger.warn("couldn't establish network connection [host '{}']", ip); } finally { if (connector != null) { connector.disconnect(); } } }
Source:
<code>public void handleAnalysisStarted(TmfStartAnalysisSignal signal) { IAnalysisModule module = signal.getAnalysisModule(); if (module instanceof ITmfAnalysisModuleWithStateSystems && !module.isAutomatic()) { new Thread(() -> { <START> if (Iterables.contains(allModules(getTrace()), module)) { <END> synchronized (fStartedAnalysis) { fStartedAnalysis.add((ITmfAnalysisModuleWithStateSystems) module); ITmfTrace moduleTrace = module instanceof TmfAbstractAnalysisModule ? ((TmfAbstractAnalysisModule) module).getTrace() : getTrace(); getDataProvider(moduleTrace).startedAnalysisSignalHandler((ITmfAnalysisModuleWithStateSystems) module); rebuild(); } } else { for (ITmfTrace trace : TmfTraceManager.getInstance().getOpenedTraces()) { if (Iterables.contains(allModules(trace), module)) { synchronized (fStartedAnalysis) { fStartedAnalysis.add((ITmfAnalysisModuleWithStateSystems) module); resetView(trace); } break; } } } }).start(); } }</code><technical_language>of getTrace() is safe UI thread. asyncExec Runnable instead of a Thread</technical_language>

Target:
public void handleAnalysisStarted(TmfStartAnalysisSignal signal) { IAnalysisModule module = signal.getAnalysisModule(); if (module instanceof ITmfAnalysisModuleWithStateSystems && !module.isAutomatic()) { final ITmfTrace viewTrace = getTrace(); if (Iterables.contains(allModules(viewTrace), module)) { new Thread(() -> { synchronized (fStartedAnalysis) { fStartedAnalysis.add((ITmfAnalysisModuleWithStateSystems) module); ITmfTrace moduleTrace = module instanceof TmfAbstractAnalysisModule ? ((TmfAbstractAnalysisModule) module).getTrace() : viewTrace; if (moduleTrace != null) { getDataProvider(moduleTrace).startedAnalysisSignalHandler((ITmfAnalysisModuleWithStateSystems) module); rebuild(); } } }).start(); } else { for (ITmfTrace trace : TmfTraceManager.getInstance().getOpenedTraces()) { if (Iterables.contains(allModules(trace), module)) { synchronized (fStartedAnalysis) { fStartedAnalysis.add((ITmfAnalysisModuleWithStateSystems) module); resetView(trace); } break; } } } } }
Source:
<code>protected SelectionListener createSelectionListener() { return new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { final List<String> values = getValues(); Map<String, String> validValues = getAttributeMapper().getOptions(getTaskAttribute()); final InPlaceCheckBoxTreeDialog selectionDialog = new InPlaceCheckBoxTreeDialog( WorkbenchUtil.getShell(), button, values, validValues, NLS.bind(Messages.CheckboxMultiSelectAttributeEditor_Select_X, getLabel())); <START> createEventListener(values, selectionDialog); <END> selectionDialog.open(); } }; }</code><technical_language>nit. this method return create event listener, attached dialog consider renaming addEventListener, change return event listener caller attaches dialog</technical_language>

Target:
protected SelectionListener createSelectionListener() { return new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { final List<String> values = getValueList(); final InPlaceCheckBoxTreeDialog selectionDialog = createInPlaceCheckBoxTreeDialog(values); addEventListener(values, selectionDialog); selectionDialog.open(); } }; }
Source:
<code>public Object fromAvro(Schema schema, Object input) { switch (schema.getType()) { case NULL: if (input == null) { return null; } throw new NonNullValueException(); case UNION: for (Schema sub : schema.getTypes()) { try { return service.fromAvro(sub, Property.class, input); } catch (NonNullValueException e) { } } throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType()); case RECORD: GenericRecord record = (GenericRecord) input; List<Field> fields = schema.getFields(); Map<String, Object> data = new HashMap<>(fields.size()); for (Field field : fields) { String propertyName = service.decodeName(field.name()); Class<?> clazz = MAPPING.getOrDefault(propertyName, Property.class); Object value = service.fromAvro(field.schema(), clazz, record.get(field.name())); data.put(propertyName, value); } return data; case ARRAY: GenericData.Array<?> array = (Array<?>) input; List<Object> list = new ArrayList<>(array.size()); for (Object element : array) { list.add(service.fromAvro(schema.getElementType(), Property.class, element)); } return list; case LONG: <START> if ("timestamp-millis".equals(getLogicalType(schema))) { <END> return new Date(((Long) input).longValue()); } return input; case INT: case FLOAT: case STRING: case DOUBLE: case BOOLEAN: return input; case BYTES: return Blobs.createBlob(((ByteBuffer) input).array()); default: throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType()); } }</code><technical_language>List<Object> list = array.stream().map(el -> service.fromAvro(schema.getElementType(), Property.class, el)).collect(Collectors.toList())</technical_language>

Target:
public Object fromAvro(Schema schema, Object input) { switch (schema.getType()) { case NULL: if (input == null) { return null; } throw new NonNullValueException(); case UNION: for (Schema sub : schema.getTypes()) { try { return service.fromAvro(sub, Property.class, input); } catch (NonNullValueException e) { } } throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType()); case RECORD: GenericRecord record = (GenericRecord) input; List<Field> fields = schema.getFields(); Map<String, Object> data = new HashMap<>(fields.size()); for (Field field : fields) { String propertyName = service.decodeName(field.name()); Class<?> clazz = MAPPING.getOrDefault(propertyName, Property.class); Object value = service.fromAvro(field.schema(), clazz, record.get(field.name())); data.put(propertyName, value); } return data; case ARRAY: GenericData.Array<?> array = (Array<?>) input; List<Object> list = new ArrayList<>(array.size()); for (Object element : array) { list.add(service.fromAvro(schema.getElementType(), Property.class, element)); } return list; case LONG: if (TIMESTAMP_MILLIS.equals(getLogicalType(schema))) { return new Date(((Long) input).longValue()); } return input; case INT: case FLOAT: case STRING: case DOUBLE: case BOOLEAN: return input; case BYTES: return Blobs.createBlob(((ByteBuffer) input).array()); default: throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType()); } }
Source:
<code>public boolean hasPatchPermission(Authentication authentication, Serializable targetId, String targetType, Patch patch) { if (!hasPermission(authentication, targetId, targetType, "WRITE")) { return false; } List<Operation> operations = patch.getOperations(); for (Operation op: operations) { if (!(op.getPath().contentEquals(EPersonPasswordReplaceOperation.OPERATION_PASSWORD_CHANGE) <START> || (op.getPath().startsWith(DSpaceObjectMetadataPatchUtils.OPERATION_METADATA_PATH) || op.getPath().equals(DSpaceObjectMetadataPatchUtils.OPERATION_METADATA_PATH)))) { <END> return false; } } return true; }</code><technical_language>is this redundant</technical_language>

Target:
public boolean hasPatchPermission(Authentication authentication, Serializable targetId, String targetType, Patch patch) { if (!hasPermission(authentication, targetId, targetType, "WRITE")) { return false; } List<Operation> operations = patch.getOperations(); for (Operation op: operations) { if (!(op.getPath().contentEquals(EPersonPasswordReplaceOperation.OPERATION_PASSWORD_CHANGE) || (op.getPath().startsWith(DSpaceObjectMetadataPatchUtils.OPERATION_METADATA_PATH)))) { return false; } } return true; }
Source:
<code>public Set<SymbolicValue> getFieldValues() { <START> final HashSet<SymbolicValue> fieldValues = new HashSet<>(); <END> values.forEach(new PMap.Consumer<Symbol, SymbolicValue>() { @Override public void accept(Symbol key, SymbolicValue value) { if (isField(key)) { fieldValues.add(value); } } }); return fieldValues; }</code><technical_language>special need for final please interface. need implementation. I recommend ImmutableSet guava for safety</technical_language>

Target:
public Set<SymbolicValue> getFieldValues() { final Set<SymbolicValue> fieldValues = new HashSet<>(); values.forEach(new PMap.Consumer<Symbol, SymbolicValue>() { @Override public void accept(Symbol key, SymbolicValue value) { if (isField(key)) { fieldValues.add(value); } } }); return fieldValues; }
Source:
<code>protected void onStreamReadyForPlayback(String entryId, final KalturaMediaServerIndex serverIndex) { logger.debug("onStreamReadyForPlayback [" + entryId + "]"); <START> LiveEntryCache liveEntryCache = null; <END> synchronized (entries) { if (entries.containsKey(entryId)) { liveEntryCache = entries.get(entryId); liveEntryCache.setEntryIsLive(); } else { logger.error("entry [" + entryId + "] not found in entries array"); } } }</code><technical_language>u add this var here, onlu inside. u do entries.get(entryId).setEntryIsLive(); in line 515 instead this line instead of 515-516</technical_language>

Target:
protected void onStreamReadyForPlayback(String entryId, final KalturaMediaServerIndex serverIndex) { logger.debug("onStreamReadyForPlayback [" + entryId + "]"); synchronized (entries) { if (entries.containsKey(entryId)) { entries.get(entryId).setEntryIsLive(); } else { logger.error("entry [" + entryId + "] not found in entries array"); } } }
Source:
<code>public String getSqlOrder() { <START> return "SELECT ST_SetSRID(the_geom, 4326 or 'EPSG:4326') FROM table;"; <END> }</code><technical_language>I a good convention "|" represent _or_ in function parameters "OR" special meaning in SQL. E.g., SELECT ST_SetSRID(the_geom, 4326 | 'EPSG:4326') table;</technical_language>

Target:
public String getSqlOrder() { return "SELECT ST_SetSRID(the_geom, 4326 | 'EPSG:4326') FROM table;"; }