auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public short vertex (Vector3 pos, Vector3 nor, Color col, Vector2 uv) { if (vindex > Short.MAX_VALUE) throw new GdxRuntimeException("Too many vertices used"); vertex[posOffset] = pos.x; if (posSize > 1) vertex[posOffset + 1] = pos.y; if (posSize > 2) vertex[posOffset + 2] = pos.z; if (norOffset >= 0) { if (nor == null) nor = tmpNormal.set(pos).nor(); vertex[norOffset] = nor.x; vertex[norOffset + 1] = nor.y; vertex[norOffset + 2] = nor.z; } if (colOffset >= 0) { if (col == null) col = Color.WHITE; vertex[colOffset] = col.r; vertex[colOffset + 1] = col.g; vertex[colOffset + 2] = col.b; if (colSize > 3) vertex[colOffset + 3] = col.a; } else if (cpOffset > 0) { if (col == null) { vertex[cpOffset] = Color.WHITE_FLOAT_BITS; } else { <START> final int colIntBits = col.toIntBits(); <END> if (colIntBits == lastColIntBits) { vertex[cpOffset] = cacheFloatBits; } else { lastColIntBits = colIntBits; cacheFloatBits = NumberUtils.intToFloatColor(colIntBits); vertex[cpOffset] = cacheFloatBits; } } } if (uv != null && uvOffset >= 0) { vertex[uvOffset] = uv.x; vertex[uvOffset + 1] = uv.y; } addVertex(vertex, 0); return lastIndex; }</code><technical_language>simplify this if/else block a bit : java if(colIntBits != lastColIntBits) { lastColIntBits = colIntBits; cacheFloatBits = NumberUtils.intToFloatColor(colIntBits); } vertex[cpOffset] = cacheFloatBits;</technical_language>

Target:
public short vertex (Vector3 pos, Vector3 nor, Color col, Vector2 uv) { if (vindex > Short.MAX_VALUE) throw new GdxRuntimeException("Too many vertices used"); vertex[posOffset] = pos.x; if (posSize > 1) vertex[posOffset + 1] = pos.y; if (posSize > 2) vertex[posOffset + 2] = pos.z; if (norOffset >= 0) { if (nor == null) nor = tmpNormal.set(pos).nor(); vertex[norOffset] = nor.x; vertex[norOffset + 1] = nor.y; vertex[norOffset + 2] = nor.z; } if (colOffset >= 0) { if (col == null) col = Color.WHITE; vertex[colOffset] = col.r; vertex[colOffset + 1] = col.g; vertex[colOffset + 2] = col.b; if (colSize > 3) vertex[colOffset + 3] = col.a; } else if (cpOffset > 0) { if (col == null) { vertex[cpOffset] = Color.WHITE_FLOAT_BITS; } else { final int colIntBits = col.toIntBits(); if (colIntBits != lastColIntBits) { lastColIntBits = colIntBits; cacheFloatBits = NumberUtils.intToFloatColor(colIntBits); } vertex[cpOffset] = cacheFloatBits; } } if (uv != null && uvOffset >= 0) { vertex[uvOffset] = uv.x; vertex[uvOffset + 1] = uv.y; } addVertex(vertex, 0); return lastIndex; }
Source:
<code>public Page getNextPage() { if (types.isEmpty()) { int rowsCount = 0; synchronized (rowsIterator) { if (!rowsIterator.hasNext()) { return null; } while (rowsIterator.hasNext() && rowsCount < MAX_ROWS_PER_ZERO_COLUMN_PAGE) { rowsIterator.next(); rowsCount++; } } return new Page(rowsCount); } SliceOutput output = new DynamicSliceOutput(BUFFER_SIZE); int rowCount = 0; synchronized (rowsIterator) { if (!rowsIterator.hasNext()) { return null; } while (rowsIterator.hasNext() && output.size() < TARGET_SIZE) { PrestoSparkMutableRow row = rowsIterator.next(); ByteBuffer buffer = row.getBuffer(); output.writeBytes(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining()); rowCount++; } } <START> SliceInput sliceInput = new BasicSliceInput(output.slice()); <END> PageBuilder pageBuilder = new PageBuilder(types); while (sliceInput.isReadable()) { pageBuilder.declarePosition(); for (int channel = 0; channel < types.size(); channel++) { BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(channel); blockBuilder.readPositionFrom(sliceInput); } } Page page = pageBuilder.build(); verify(page.getPositionCount() == rowCount, "unexpected row count: %s != %s", page.getPositionCount(), rowCount); return page; }</code><technical_language>output.slice().getInput()? (I learned this pattern previous commits.. )</technical_language>

Target:
public Page getNextPage() { if (types.isEmpty()) { int rowsCount = 0; synchronized (rowsIterator) { if (!rowsIterator.hasNext()) { return null; } while (rowsIterator.hasNext() && rowsCount < MAX_ROWS_PER_ZERO_COLUMN_PAGE) { rowsIterator.next(); rowsCount++; } } return new Page(rowsCount); } SliceOutput output = new DynamicSliceOutput(BUFFER_SIZE); int rowCount = 0; synchronized (rowsIterator) { if (!rowsIterator.hasNext()) { return null; } while (rowsIterator.hasNext() && output.size() < TARGET_SIZE) { PrestoSparkMutableRow row = rowsIterator.next(); ByteBuffer buffer = row.getBuffer(); output.writeBytes(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining()); rowCount++; } } SliceInput sliceInput = output.slice().getInput(); PageBuilder pageBuilder = new PageBuilder(types); while (sliceInput.isReadable()) { pageBuilder.declarePosition(); for (int channel = 0; channel < types.size(); channel++) { BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(channel); blockBuilder.readPositionFrom(sliceInput); } } Page page = pageBuilder.build(); verify(page.getPositionCount() == rowCount, "unexpected row count: %s != %s", page.getPositionCount(), rowCount); return page; }
Source:
<code><START> void attachConfigUpdateListeners(GoConfigService configService) { <END> configService.register(reparseOnConfigUpdate()); configService.register(reparseOnPipelineConfigUpdate()); configService.register(reparseOnEnvConfigUpdate()); configService.register(reparseOnTemplateConfigUpdate()); configService.register(reparseOnScmUpdate()); configService.register(reparseOnConfigRepoConfigUpdate()); }</code><technical_language>@bdpiparva told a do this. inject multiple listener instances, end multiple callbacks, for entity update another for full save. push a fix, point right do this (for next time implement a listener for multiple entities :))</technical_language>

Target:
void attachConfigUpdateListeners(GoConfigService configService) { configService.register(new ConfigRepoReparseListener(this)); }
Source:
<code>private void loadVars(EvaluationContext ec, Detail detail) { Detail[] details = getFlattenedDetails(detail); <START> Hashtable<String, XPathExpression> decs = new Hashtable<String, XPathExpression>(); <END> for (int i = 0; i < details.length; i++) { for (Enumeration en = details[i].getVariableDeclarations().keys(); en.hasMoreElements(); ) { String key = (String)en.nextElement(); decs.put(key, details[i].getVariableDeclarations().get(key)); } } for(Enumeration en = decs.keys() ; en.hasMoreElements();) { String key = (String)en.nextElement(); try { ec.setVariable(key, XPathFuncExpr.unpack(decs.get(key).eval(ec))); } catch(XPathException xpe) { xpe.printStackTrace(); throw new RuntimeException("XPathException while parsing varible " + key+ " for entity. " + xpe.getMessage()); } } }</code><technical_language>name for "decs" nice</technical_language>

Target:
private void loadVars(EvaluationContext ec, Detail detail) { Detail[] details = detail.getFlattenedDetails(); Hashtable<String, XPathExpression> declarations = new Hashtable<String, XPathExpression>(); for (int i = 0; i < details.length; i++) { for (Enumeration en = details[i].getVariableDeclarations().keys(); en.hasMoreElements(); ) { String key = (String)en.nextElement(); declarations.put(key, details[i].getVariableDeclarations().get(key)); } } for(Enumeration en = declarations.keys() ; en.hasMoreElements();) { String key = (String)en.nextElement(); try { ec.setVariable(key, XPathFuncExpr.unpack(declarations.get(key).eval(ec))); } catch(XPathException xpe) { xpe.printStackTrace(); throw new RuntimeException("XPathException while parsing varible " + key+ " for entity. " + xpe.getMessage()); } } }
Source:
<code><START> void redraw (boolean children) { <END> if (display.inPaint) { display.asyncExec(() -> redraw(children)); return; } view.setNeedsDisplay(true); }</code><technical_language>This non-public method is called paint handler. I suggest removing changes this method</technical_language>

Target:
void redraw(boolean children) { if (display.inPaint) { display.asyncExec(() -> { if (!isDisposed()) setNeedsDisplay(); }); return; } setNeedsDisplay(); }
Source:
<code>private static void extractDexFiles(String apkFileName, File outDir) throws IOException { <START> ZipInputStream zis = new ZipInputStream(new FileInputStream(new File(apkFileName))); <END> ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { if (!entry.isDirectory()) { if (entry.getName().startsWith("classes") && entry.getName().endsWith(".dex")) { extractFile(zis, outDir + File.separator + entry.getName()); } } zis.closeEntry(); } zis.close(); }</code><technical_language>Maven build fails try-with-resources for</technical_language>

Target:
private static void extractDexFiles(String apkFileName, File outDir) throws IOException { try (ZipInputStream zis = new ZipInputStream(new FileInputStream(new File(apkFileName)))) { ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { if (!entry.isDirectory()) { if (entry.getName().startsWith("classes") && entry.getName().endsWith(".dex")) { extractFile(zis, outDir + File.separator + entry.getName()); } } zis.closeEntry(); } } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> CrashUtil.init(this); <END> if (finishIfNotRoot()) { return; } if (savedInstanceState != null) { shortcutExtraWasConsumed = savedInstanceState.getBoolean(EXTRA_CONSUMED_KEY); alreadyCheckedForAppFilesChange = savedInstanceState.getBoolean(KEY_APP_FILES_CHECK_OCCURRED); waitingForActivityResultFromLogin = savedInstanceState.getBoolean(KEY_WAITING_FOR_ACTIVITY_RESULT); } }</code><technical_language>reason for moving this CommCareApplication here</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (finishIfNotRoot()) { return; } if (savedInstanceState != null) { shortcutExtraWasConsumed = savedInstanceState.getBoolean(EXTRA_CONSUMED_KEY); alreadyCheckedForAppFilesChange = savedInstanceState.getBoolean(KEY_APP_FILES_CHECK_OCCURRED); waitingForActivityResultFromLogin = savedInstanceState.getBoolean(KEY_WAITING_FOR_ACTIVITY_RESULT); } }
Source:
<code>protected boolean canDoAction() { if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (!canRunActionOnNonManagedVm()) { return false; } if (!getVm().isRunningOrPaused()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL, LocalizedVmStatus.from(getVm().getStatus())); } if ((IsoDomainListSyncronizer.getInstance().findActiveISODomain(getVm().getStoragePoolId()) == null) && !StringUtils.isEmpty(cdImagePath)) { return failCanDoAction(VdcBllMessages.VM_CANNOT_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO); } <START> if (StringUtils.isNotEmpty(cdImagePath) && !cdImagePath.toLowerCase().endsWith(ValidationUtils.ISO_SUFFIX)) { <END> return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CDROM_DISK_FORMAT); } return true; }</code><technical_language>StringUtils#endsWithIgnoreCase</technical_language>

Target:
protected boolean canDoAction() { if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (!canRunActionOnNonManagedVm()) { return false; } if (!getVm().isRunningOrPaused()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL, LocalizedVmStatus.from(getVm().getStatus())); } if ((IsoDomainListSyncronizer.getInstance().findActiveISODomain(getVm().getStoragePoolId()) == null) && !StringUtils.isEmpty(cdImagePath)) { return failCanDoAction(VdcBllMessages.VM_CANNOT_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO); } if (!StringUtils.endsWithIgnoreCase(cdImagePath, ValidationUtils.ISO_SUFFIX)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CDROM_DISK_FORMAT); } return true; }
Source:
<code>public void checkMail(final Context context, final Account account, final boolean ignoreLastCheckedTime, final boolean useManualWakeLock, final MessagingListener listener) { TracingWakeLock twakeLock = null; if (useManualWakeLock) { TracingPowerManager pm = TracingPowerManager.getPowerManager(context); twakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "K9 MessagingController.checkMail"); twakeLock.setReferenceCounted(false); twakeLock.acquire(K9.MANUAL_WAKE_LOCK_TIMEOUT); } final TracingWakeLock wakeLock = twakeLock; for (MessagingListener l : getListeners()) { l.checkMailStarted(context, account); } putBackground("checkMail", listener, new Runnable() { @Override public void run() { try { Timber.i("Starting mail check"); Preferences prefs = Preferences.getPreferences(context); Collection<Account> accounts; if (account != null) { accounts = new ArrayList<>(1); accounts.add(account); } else { accounts = prefs.getAvailableAccounts(); } prefs.loadKeywords(); for (final Account account : accounts) { checkMailForAccount(context, account, ignoreLastCheckedTime, listener); } <START> prefs.saveKeywords(); <END> } catch (Exception e) { Timber.e(e, "Unable to synchronize mail"); addErrorMessage(account, null, e); } putBackground("finalize sync", null, new Runnable() { @Override public void run() { Timber.i("Finished mail sync"); if (wakeLock != null) { wakeLock.release(); } for (MessagingListener l : getListeners()) { l.checkMailFinished(context, account); } } } ); } }); }</code><technical_language>saving here</technical_language>

Target:
public void checkMail(final Context context, final Account account, final boolean ignoreLastCheckedTime, final boolean useManualWakeLock, final MessagingListener listener) { TracingWakeLock twakeLock = null; if (useManualWakeLock) { TracingPowerManager pm = TracingPowerManager.getPowerManager(context); twakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "K9 MessagingController.checkMail"); twakeLock.setReferenceCounted(false); twakeLock.acquire(K9.MANUAL_WAKE_LOCK_TIMEOUT); } final TracingWakeLock wakeLock = twakeLock; for (MessagingListener l : getListeners()) { l.checkMailStarted(context, account); } putBackground("checkMail", listener, new Runnable() { @Override public void run() { try { Timber.i("Starting mail check"); Preferences prefs = Preferences.getPreferences(context); Collection<Account> accounts; if (account != null) { accounts = new ArrayList<>(1); accounts.add(account); } else { accounts = prefs.getAvailableAccounts(); } prefs.loadKeywords(); for (final Account account : accounts) { checkMailForAccount(context, account, ignoreLastCheckedTime, listener); } } catch (Exception e) { Timber.e(e, "Unable to synchronize mail"); addErrorMessage(account, null, e); } putBackground("finalize sync", null, new Runnable() { @Override public void run() { Timber.i("Finished mail sync"); if (wakeLock != null) { wakeLock.release(); } for (MessagingListener l : getListeners()) { l.checkMailFinished(context, account); } } } ); } }); }
Source:
<code>protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { final TaggedValuePointable tvp = args[0]; try { switch (tvp.getTag()) { case ValueTag.OBJECT_TAG: tvp.getValue(op); op.getKeys(result); break; case ValueTag.ARRAY_TAG: abvs.reset(); sb.reset(abvs); <START> while (keysOrMembers.step(tempTvp)) { <END> sb.addItem(tempTvp); } sb.finish(); result.set(abvs); break; default: throw new SystemException(ErrorCode.FORG0006); } } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } }</code><technical_language>need call init step function</technical_language>

Target:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { abvs = abvsPool.takeOne(); keysOrMembers.init(args); try { abvs.reset(); sb.reset(abvs); while (keysOrMembers.step(tempTvp)) { sb.addItem(tempTvp); } sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { abvsPool.giveBack(abvs); } }
Source:
<code>public void testApplication() throws IOException, Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties.xml")); lma.prepareDAG(new KafkaApp(), conf); LocalMode.Controller lc = lma.getController(); <START> lc.run(10000); END> } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }</code><technical_language>nice unit test check results</technical_language>

Target:
public void testApplication() throws Exception { try { File file = new File(FILE_PATH); file.delete(); writeToTopic(); LocalMode.Controller lc = asyncRun(); chkOutput(); compare(); lc.shutdown(); } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }
Source:
<code>public Object apply(ReviewerResource rsrc, Input input) throws AuthException, ResourceNotFoundException, OrmException { ChangeControl control = rsrc.getControl(); Change.Id changeId = rsrc.getChange().getId(); ReviewDb db = dbProvider.get(); db.changes().beginTransaction(changeId); try { List<PatchSetApproval> del = Lists.newArrayList(); for (PatchSetApproval a : approvals(db, rsrc)) { if (control.canRemoveReviewer(a)) { del.add(a); } else { throw new AuthException("delete not permitted"); } } if (del.isEmpty()) { throw new ResourceNotFoundException(); } <START> Change c = db.changes().get(rsrc.getChange().getId()); <END> if (c != null) { db.changes().update(Collections.singleton(c)); } db.patchSetApprovals().delete(del); db.commit(); } finally { db.rollback(); } return Response.none(); }</code><technical_language>Feels this belongs in ChangeUtil a complement ChangeUtil.updated (only operating a field)</technical_language>

Target:
public Object apply(ReviewerResource rsrc, Input input) throws AuthException, ResourceNotFoundException, OrmException { ChangeControl control = rsrc.getControl(); Change.Id changeId = rsrc.getChange().getId(); ReviewDb db = dbProvider.get(); db.changes().beginTransaction(changeId); try { List<PatchSetApproval> del = Lists.newArrayList(); for (PatchSetApproval a : approvals(db, rsrc)) { if (control.canRemoveReviewer(a)) { del.add(a); } else { throw new AuthException("delete not permitted"); } } if (del.isEmpty()) { throw new ResourceNotFoundException(); } ChangeUtil.bumpRowVersionNotLastUpdatedOn(rsrc.getChange().getId(), db); db.patchSetApprovals().delete(del); db.commit(); } finally { db.rollback(); } return Response.none(); }
Source:
<code>public synchronized boolean put(final Connection connection) { if (connection != null) { if (!connection.isExecuting()) { throw new IllegalStateException("Connection is not executing!"); } ConnectionId connectionId = connection.getConnectionId(); if (connectionId == null) { connectionId = newConnectionId(); if (connectionId == null) { throw new IllegalStateException("Connection ids exhausted!"); } connection.setConnectionId(connectionId); } else if (connectionId.isEmpty()) { throw new IllegalStateException("Connection must have a none empty connection id!"); } else if (connections.get(connectionId) != null) { throw new IllegalStateException("Connection id already used! " + connectionId); } if (connections.put(connectionId, connection)) { if (LOG.isTraceEnabled()) { LOG.trace("{}connection: add (size {})", tag, connection, connections.size(), new Throwable("connection added!")); } else { LOG.debug("{}connection: add (size {})", tag, connectionId, connections.size()); } addToAddressConnections(connection); <START> DTLSSession session = connection.getEstablishedSession(); <END> if (session != null) { session.setPeer(connection.getPeerAddress()); putEstablishedSession(session, connection); } return true; } else { LOG.info("{}connection store is full! max. entries.", tag, connections.getCapacity()); if (LOG.isDebugEnabled()) { dump(); } return false; } } else { return false; } }</code><technical_language>I surprised change session's peer address in this method. I this is a "put in store" method change state of attribute of attribute of object add</technical_language>

Target:
public synchronized boolean put(final Connection connection) { if (connection != null) { if (!connection.isExecuting()) { throw new IllegalStateException("Connection is not executing!"); } ConnectionId connectionId = connection.getConnectionId(); if (connectionId == null) { connectionId = newConnectionId(); if (connectionId == null) { throw new IllegalStateException("Connection ids exhausted!"); } connection.setConnectionId(connectionId); } else if (connectionId.isEmpty()) { throw new IllegalStateException("Connection must have a none empty connection id!"); } else if (connections.get(connectionId) != null) { throw new IllegalStateException("Connection id already used! " + connectionId); } if (connections.put(connectionId, connection)) { if (LOG.isTraceEnabled()) { LOG.trace("{}connection: add (size {})", tag, connection, connections.size(), new Throwable("connection added!")); } else { LOG.debug("{}connection: add (size {})", tag, connectionId, connections.size()); } addToAddressConnections(connection); DTLSSession session = connection.getEstablishedSession(); if (session != null) { putEstablishedSession(session, connection); } return true; } else { LOG.info("{}connection store is full! max. entries.", tag, connections.getCapacity()); if (LOG.isDebugEnabled()) { dump(); } return false; } } else { return false; } }
Source:
<code>private int asLit(SetVar var, DecisionOperator<SetVar> op, int val) { int l; <START> if (op == DecisionOperatorFactory.makeSetForce()) { l = SatSolver.negated(png.Literal(var, val, true)); } else if (op == DecisionOperatorFactory.makeSetRemove()) { <END> l = png.Literal(var, val, true); } else { throw new UnsupportedOperationException("Cannot deal with such operator: " + op); } return l; }</code><technical_language>Method equals() instead of ==</technical_language>

Target:
private int asLit(SetVar var, DecisionOperator<SetVar> op, int val) { int l; if (DecisionOperatorFactory.makeSetForce().equals(op)) { l = SatSolver.negated(png.Literal(var, val, true)); } else if (DecisionOperatorFactory.makeSetRemove().equals(op)) { l = png.Literal(var, val, true); } else { throw new UnsupportedOperationException("Cannot deal with such operator: " + op); } return l; }
Source:
<code>public String getColumnText(Object element, XViewerColumn column, int columnIndex) { try { if (element instanceof Artifact) { Artifact refArt = ((Artifact) element).getSoleAttributeValue(AtsAttributeTypes.TaskToChangedArtifactReference, null); <START> if (refArt != null) { <END> return refArt.getLastModified().toString(); } } } catch (OseeCoreException ex) { return LogUtil.getCellExceptionString(ex); } return ""; }</code><technical_language>DateUtil.getMMDDYYHHMM(refArt.getLastModified()) return date formatted. This enables viewer sort dates correctly</technical_language>

Target:
public String getColumnText(Object element, XViewerColumn column, int columnIndex) { try { if (element instanceof Artifact) { Artifact refArt = ((Artifact) element).getSoleAttributeValue(AtsAttributeTypes.TaskToChangedArtifactReference, null); if (refArt != null) { return DateUtil.getMMDDYYHHMM(refArt.getLastModified()); } } } catch (OseeCoreException ex) { return LogUtil.getCellExceptionString(ex); } return ""; }
Source:
<code>public JSONObject serviceImpl(Query call, HttpServletResponse response, Authorization rights, JSONObjectWithDefault permissions) throws APIException { String profile = call.get("profile", ""); <START> String termsS = call.get("terms", ""); <END> Set terms = null; if (!"".equals(termsS)) { terms = new HashSet(Arrays.asList(termsS.split(","))); return scrapeGithub(profile, terms); } return scrapeGithub(profile); }</code><technical_language>This is a weird name give a confusing sS. Is issue if call terms? better</technical_language>

Target:
public JSONObject serviceImpl(Query call, HttpServletResponse response, Authorization rights, JSONObjectWithDefault permissions) throws APIException { String profile = call.get("profile", ""); String termsParam = call.get("terms", ""); Set terms = null; if (!"".equals(termsParam)) { terms = new HashSet(Arrays.asList(termsParam.split(","))); return scrapeGithub(profile, terms); } return scrapeGithub(profile); }
Source:
<code>public MerkleTreeConfig getMapMerkleTreeConfig(String name) { <START> return ConfigUtils.getConfig(configPatternMatcher, mapMerkleTreeConfigs, name, MerkleTreeConfig.class); <END> }</code><technical_language>merkle tree config is similar event journal config. needs disabled if name is "default"</technical_language>

Target:
public MerkleTreeConfig getMapMerkleTreeConfig(String name) { return ConfigUtils.getConfig(configPatternMatcher, mapMerkleTreeConfigs, name, MerkleTreeConfig.class, new BiConsumer<MerkleTreeConfig, String>() { @Override public void accept(MerkleTreeConfig merkleTreeConfig, String name) { merkleTreeConfig.setMapName(name); if ("default".equals(name)) { merkleTreeConfig.setEnabled(false); } } }); }
Source:
<code>public static AgentDto asDto(Agent agent) { <START> AgentDto agentDto = newDto(AgentDto.class); <END> agentDto.setName(agent.getName()); agentDto.setVersion(agent.getVersion()); agentDto.setProperties(agent.getProperties()); agentDto.setScript(agent.getScript()); agentDto.setDependencies(agent.getDependencies()); return agentDto; }</code><technical_language>return newDto(AgentDto.class).withName(agent.getName()) .withVersion(agent.getVersion()) .withProperties(agent.getProperties()) .withScript(agent.getScript()) .withDependencies(agent.getDependencies());</technical_language>

Target:
public static AgentDto asDto(Agent agent) { return newDto(AgentDto.class).withName(agent.getName()) .withVersion(agent.getVersion()) .withProperties(agent.getProperties()) .withScript(agent.getScript()) .withDependencies(agent.getDependencies()); }
Source:
<code>public void showCompareWithLatest(final AlteredFiles alteredFiles, @Nullable final String currentFile, final String revision) { this.alteredFiles = alteredFiles; this.revision = revision; this.compareWithLatest = true; <START> findFileIndexOrFirst(currentFile); <END> showCompareForCurrentFile(); }</code><technical_language>revealFileIndex</technical_language>

Target:
public void showCompareWithLatest( final AlteredFiles alteredFiles, @Nullable final String currentFile, final String revision) { this.alteredFiles = alteredFiles; this.revision = revision; this.compareWithLatest = true; currentFileIndex = findFileIndexOrFirst(currentFile); showCompareForCurrentFile(); }
Source:
<code>public static LigerDrawerFragment build(String pageName, String pageTitle, String pageArgs, String pageOptions) { LigerDrawerFragment newFragment = new LigerDrawerFragment(); <START> Bundle args = new Bundle(); <END> if (pageName != null) { args.putString("pageName", pageName); } if (pageTitle != null) { args.putString("pageTitle", pageTitle); } if (pageArgs != null) { args.putString("pageArgs", pageArgs); try { JSONObject childPage = new JSONObject(pageArgs); if (childPage.getString("page").equalsIgnoreCase("appMenu")){ JSONObject childPageArgs = childPage.getJSONObject("args"); JSONArray menuParentArray = childPageArgs.getJSONArray("menu"); JSONArray majorMenu = menuParentArray.optJSONArray(0); if (majorMenu != null) { newFragment.setMajorMenuItems(newFragment.createMenuItems(majorMenu, true)); } JSONArray minorMenu = menuParentArray.optJSONArray(1); if (minorMenu != null) { newFragment.setMinorMenuItems(newFragment.createMenuItems(minorMenu, false)); } } } catch (JSONException e) { throw new RuntimeException("Invalid app.json!", e); } } if (pageOptions != null) { args.putString("pageOptions", pageOptions); } newFragment.setArguments(args); return newFragment; }</code><technical_language>call bundle instead of args (since args a specific meaning of LigerMobile)</technical_language>

Target:
public static LigerDrawerFragment build(String pageName, String pageTitle, String pageArgs, String pageOptions) { LigerDrawerFragment newFragment = new LigerDrawerFragment(); Bundle bundle = new Bundle(); if (pageName != null) { bundle.putString("pageName", pageName); } if (pageTitle != null) { bundle.putString("pageTitle", pageTitle); } if (pageArgs != null) { bundle.putString("pageArgs", pageArgs); try { JSONObject childPage = new JSONObject(pageArgs); if (childPage.getString("page").equalsIgnoreCase("appMenu")){ JSONObject childPageArgs = childPage.getJSONObject("args"); JSONArray menuParentArray = childPageArgs.getJSONArray("menu"); JSONArray majorMenu = menuParentArray.optJSONArray(0); if (majorMenu != null) { newFragment.setMajorMenuItems(newFragment.createMenuItems(majorMenu, true)); } JSONArray minorMenu = menuParentArray.optJSONArray(1); if (minorMenu != null) { newFragment.setMinorMenuItems(newFragment.createMenuItems(minorMenu, false)); } } } catch (JSONException e) { throw new RuntimeException("Invalid app.json!", e); } } if (pageOptions != null) { bundle.putString("pageOptions", pageOptions); } newFragment.setArguments(bundle); return newFragment; }
Source:
<code>protected void hideSlot(String slotSelector) { JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript( "var iframe = arguments[0] + ' iframe:visible:first, ';" + "var object = arguments[0] + ' object:visible:first, ';" + "var img = arguments[0] + ' img:visible:first';" + "var element = $(iframe + object + img)[0];" + "if (element) element.style['visibility'] = 'hidden';", slotSelector ); PageObjectLogging.log( <START> "HideElement", "Element is hidden; CSS " + slotSelector, true <END> ); }</code><technical_language>is method hideSlot hideElement ? decide more apropriate change method name, parameter in log() method</technical_language>

Target:
protected void hideSlot(String slotSelector) { JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript( "var iframe = arguments[0] + ' iframe:visible:first, ';" + "var object = arguments[0] + ' object:visible:first, ';" + "var img = arguments[0] + ' img:visible:first';" + "var element = $(iframe + object + img)[0];" + "if (element) element.style['visibility'] = 'hidden';", slotSelector ); PageObjectLogging.log( "AdInSlotHidden", "Ad in slot hidden; Slot CSS " + slotSelector, true ); }
Source:
<code>public void setup() { <START> storage = new FileBasedKieServerTemplateStorage(); <END> templateMap.keySet().forEach(key -> { storage.store(templateMap.get(key)); }); assertEquals("Mismatched number of server templates stored",templateMap.keySet().size(),storage.loadKeys().size()); }</code><technical_language>for tests (to avoid set reset system properties) extra constructor accepts file path directly</technical_language>

Target:
public void setup() throws IOException { tmpTemplateStore = File.createTempFile("templates_", ".xml", TEST_SERVER_TEMPLATE_DIRECTORY); storage = new FileBasedKieServerTemplateStorage(tmpTemplateStore.getAbsolutePath()); templateMap.keySet().forEach(key -> { storage.store(templateMap.get(key)); }); assertEquals("Mismatched number of server templates stored",templateMap.keySet().size(),storage.loadKeys().size()); }
Source:
<code>private void updateTemplate(long templateId, String fileExtension, long zoneId, long size) { TemplateDataStoreVO templateStore = _tmplStoreDao.findByTemplateZone(templateId, zoneId, DataStoreRole.Image); VMTemplateVO template = _tmpltDao.findById(templateId); templateStore.setDownloadState(Status.DOWNLOADED); templateStore.setState(ObjectInDataStoreStateMachine.State.Ready); <START> templateStore.setInstallPath("template/tmpl/2/" + templateId + "/" + template.getUuid() + "." + fileExtension); <END> templateStore.setErrorString(null); templateStore.setSize(size); templateStore.setSize(0L); if (template.isActivateAfterUpload()){ template.setState(VirtualMachineTemplate.State.Active); } else { template.setState(VirtualMachineTemplate.State.Inactive); } _tmplStoreDao.update(templateStore.getId(), templateStore); _tmpltDao.update(template.getId(), template); }</code><technical_language>in a method called 'updateTemplate(...)' a hardcoded path this is suspect. name method correctly? need give a more descriptive/restrictive/deterring name</technical_language>

Target:
private void updateTemplate(long templateId, String fileExtension, long zoneId, long size) { TemplateDataStoreVO templateStore = _tmplStoreDao.findByTemplateZone(templateId, zoneId, DataStoreRole.Image); VMTemplateVO template = _tmpltDao.findById(templateId); templateStore.setDownloadState(Status.DOWNLOADED); templateStore.setState(ObjectInDataStoreStateMachine.State.Ready); Long userId = CallContext.current().getCallingUserId(); templateStore.setInstallPath(String.format("template/tmpl/%d/%d/%s.%s", userId, templateId, template.getUuid(), fileExtension)); templateStore.setErrorString(null); template.setState(VirtualMachineTemplate.State.Active); templateStore.setSize(size); if (template.isActivateAfterUpload()){ template.setState(VirtualMachineTemplate.State.Active); } else { template.setState(VirtualMachineTemplate.State.Inactive); } _tmplStoreDao.update(templateStore.getId(), templateStore); _tmpltDao.update(template.getId(), template); }
Source:
<code>public DruidQueryGenerator.GeneratedDql toQuery() { if (hasLimit() && aggregations > 1 && !groupByColumns.isEmpty()) { throw new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Could not pushdown multiple aggregates in the presence of group by and limit"); } String expressions = selections.entrySet().stream() .map(s -> s.getValue().getDefinition()) .collect(Collectors.joining(", ")); if (expressions.isEmpty()) { throw new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Empty Druid query"); } String tableName = from.orElseThrow(() -> new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Table name missing in Druid query")); String query = "SELECT " + expressions + " FROM " + tableName; boolean pushdown = false; if (filter.isPresent()) { query += " WHERE " + filter.get(); pushdown = true; } if (!groupByColumns.isEmpty()) { String groupByExpression = groupByColumns.stream().map(x -> selections.get(x).getDefinition()).collect(Collectors.joining(", ")); query = query + " GROUP BY " + groupByExpression; pushdown = true; } <START> if (!hasAggregation()) { if (limit.isPresent()) { <END> query += " LIMIT " + limit.getAsLong(); pushdown = true; } } return new DruidQueryGenerator.GeneratedDql(tableName, query, pushdown); }</code><technical_language>merge this ifs</technical_language>

Target:
public DruidQueryGenerator.GeneratedDql toQuery() { if (hasLimit() && aggregations > 1 && !groupByColumns.isEmpty()) { throw new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Could not pushdown multiple aggregates in the presence of group by and limit"); } String expressions = selections.entrySet().stream() .map(s -> s.getValue().getDefinition()) .collect(Collectors.joining(", ")); if (expressions.isEmpty()) { throw new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Empty Druid query"); } String tableName = from.orElseThrow(() -> new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Table name missing in Druid query")); String query = "SELECT " + expressions + " FROM " + tableName; boolean pushdown = false; if (filter.isPresent()) { query += " WHERE " + filter.get(); pushdown = true; } if (!groupByColumns.isEmpty()) { String groupByExpression = groupByColumns.stream().map(x -> selections.get(x).getDefinition()).collect(Collectors.joining(", ")); query = query + " GROUP BY " + groupByExpression; pushdown = true; } if (!hasAggregation() && limit.isPresent()) { query += " LIMIT " + limit.getAsLong(); pushdown = true; } return new DruidQueryGenerator.GeneratedDql(tableName, query, pushdown); }
Source:
<code>public List<ChallengeDto> findAll(){ UUID activeOrganization = sessionService.getActiveOrganization(); List<Challenge> challenges = null; if(activeOrganization == null){ <START> challenges = repository.findAllByInviteOnly(false); <END> }else{ challenges = repository.findAllByOrganization(activeOrganization); } return challenges.stream().map(ChallengeDto::new).collect(Collectors.toList()); }</code><technical_language>this yield challenges? return ended yet</technical_language>

Target:
public List<ChallengeDto> findAll() { UUID activeOrganization = sessionService.getActiveOrganization(); List<Challenge> challenges = null; if (activeOrganization == null) { challenges = repository.findAllByInviteOnlyAndEndDateAfter(false, ZonedDateTime.now().plusMinutes(5)); } else { challenges = repository.findAllByOrganization(activeOrganization); } return challenges.stream().map(ChallengeDto::new).collect(Collectors.toList()); }
Source:
<code>private ShouldBeEqualIgnoringNewLines(CharSequence actual, CharSequence expected) { <START> super("%nExpecting:%n <%s>%nto be equal to:%n <%s>%nignoring newline (\n, \r\n) in acutal.", <END> actual, expected); }</code><technical_language>typos: newline -> newlines, acutal -> actual</technical_language>

Target:
private ShouldBeEqualIgnoringNewLines(CharSequence actual, CharSequence expected) { super("%nExpecting:%n <%s>%nto be equal to:%n <%s>%nignoring newlines (\n, \r\n).", actual, expected); }
Source:
<code><START> public void detachingFromWindow_disconnectsService_whenServiceConnectionIsNotNull() { <END> when(customTabHelper.getServiceConnection()).thenReturn(serviceConnection); UrlWidget widget = createWidget(promptWithAnswer(null)); widget.onDetachedFromWindow(); verify(serviceConnection).onServiceDisconnected(null); }</code><technical_language>This test part of CustomTabHelper's tests, tests for a specific widget</technical_language>

Target:
public void detachingFromWindow_disconnectsService_whenServiceConnectionIsNotNull() { CustomTabsServiceConnection serviceConnection = mock(CustomTabsServiceConnection.class); when(customTabHelper.getServiceConnection()).thenReturn(serviceConnection); UrlWidget widget = createWidget(promptWithAnswer(null)); widget.onDetachedFromWindow(); verify(spyActivity).unbindService(serviceConnection); }
Source:
<code>public void testIteratorClosedOnReadError() throws Exception { Spiffy spiffy = dbi.onDemand(Spiffy.class); spiffy.insert(1, "Tom"); Iterator<Something> i = spiffy.crashOnFirstRead(); try { i.next(); fail("Should throw a JDBIException"); } catch (JdbiException ex) { <START> assertThat(ex).isNotNull(); <END> } assertThat(tracker.hasOpenedHandle()).isFalse(); }</code><technical_language>converted</technical_language>

Target:
public void testIteratorClosedOnReadError() throws Exception { Spiffy spiffy = dbi.onDemand(Spiffy.class); spiffy.insert(1, "Tom"); Iterator<Something> i = spiffy.crashOnFirstRead(); assertThatExceptionOfType(JdbiException.class).isThrownBy(i::next); assertThat(tracker.hasOpenedHandle()).isFalse(); }
Source:
<code>public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException { super.loadFromJSONObject(jobj, db); m_lookupType = IndexLookupType.get( jobj.getString( Members.LOOKUP_TYPE.name() ) ); m_endType = IndexLookupType.get( jobj.getString( Members.END_TYPE.name() ) ); m_targetIndexName = jobj.getString(Members.TARGET_INDEX_NAME.name()); m_catalogIndex = db.getTables().get(super.m_targetTableName).getIndexes().get(m_targetIndexName); AbstractExpression.loadFromJSONArrayChild(m_endkeyExpressions, jobj, Members.ENDKEY_EXPRESSIONS.name(), m_tableScan); AbstractExpression.loadFromJSONArrayChild(m_searchkeyExpressions, jobj, Members.SEARCHKEY_EXPRESSIONS.name(), m_tableScan); if ( ! jobj.isNull(Members.COMPARE_NOTDISTINCT.name())) { JSONArray jarray = jobj.getJSONArray(Members.COMPARE_NOTDISTINCT.name()); int numCols = jarray.length(); for (int ii = 0; ii < numCols; ++ii) { m_compareNotDistinct.add(jarray.getBoolean(ii)); } <START> } <END> m_skip_null_predicate = AbstractExpression.fromJSONChild(jobj, Members.SKIP_NULL_PREDICATE.name(), m_tableScan); }</code><technical_language>this factored out a base class method for other jarray element types</technical_language>

Target:
public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException { super.loadFromJSONObject(jobj, db); m_lookupType = IndexLookupType.get( jobj.getString( Members.LOOKUP_TYPE.name() ) ); m_endType = IndexLookupType.get( jobj.getString( Members.END_TYPE.name() ) ); m_targetIndexName = jobj.getString(Members.TARGET_INDEX_NAME.name()); m_catalogIndex = db.getTables().get(super.m_targetTableName).getIndexes().get(m_targetIndexName); AbstractExpression.loadFromJSONArrayChild(m_endkeyExpressions, jobj, Members.ENDKEY_EXPRESSIONS.name(), m_tableScan); AbstractExpression.loadFromJSONArrayChild(m_searchkeyExpressions, jobj, Members.SEARCHKEY_EXPRESSIONS.name(), m_tableScan); loadBooleanArrayFromJSONObject(jobj, Members.COMPARE_NOTDISTINCT.name(), m_compareNotDistinct); m_skip_null_predicate = AbstractExpression.fromJSONChild(jobj, Members.SKIP_NULL_PREDICATE.name(), m_tableScan); }
Source:
<code>public Uni<World> find(int id) { <START> return clients.getClient().preparedQuery("SELECT * FROM World WHERE id = $1", Tuple.of(id)) <END> .map(rowset -> { Row row = rowset.iterator().next(); return new World(row.getInteger(0), row.getInteger(1)); }); }</code><technical_language>column names explicitly faster *</technical_language>

Target:
public Uni<World> find(int id) { return clients.getClient().preparedQuery("SELECT id, randomNumber FROM World WHERE id = $1", Tuple.of(id)) .map(rowset -> { Row row = rowset.iterator().next(); return new World(row.getInteger(0), row.getInteger(1)); }); }
Source:
<code>ProgramState clearStack() { <START> return unstackValue(Integer.MAX_VALUE).state; <END> }</code><technical_language>I prefer a dedicated method handle this case for Integer.MAX_VALUE. meaningful. (or -1 bound iteration properly)</technical_language>

Target:
ProgramState clearStack() { return stack.isEmpty() ? this : new ProgramState(this, PCollections.emptyStack()); }
Source:
<code><START> public String setClusterValues(String localExecCommand) { <END> String clusterExecCommand = localExecCommand.replace(Context.topologyBinaryFile(config), EcsContext.ECS_CLUSTER_BINARY); clusterExecCommand = clusterExecCommand.replace(Context.clusterJavaHome(config), EcsContext.DESTINATION_JVM); clusterExecCommand = clusterExecCommand.replaceAll("\"", "'"); return clusterExecCommand; }</code><technical_language>methods public</technical_language>

Target:
protected String setClusterValues(String localExecCommand) { String clusterExecCommand = localExecCommand.replace(Context.topologyBinaryFile(config), EcsContext.ecsClusterBinary(config)); clusterExecCommand = clusterExecCommand.replaceAll("\"", "'"); return clusterExecCommand; }
Source:
<code>private void updateValue(boolean force) { boolean shouldUpdateWhileRendering = !EEFSpinnerLifecycleManager.this.container.isRenderingInProgress() || force; if (!this.spinner.isDisposed() && this.isDirty && shouldUpdateWhileRendering && updateInProgress.compareAndSet(false, true)) { try { String text = spinner.getText(); BigDecimal textBigDecimalValue = new BigDecimal(text); double textDoubleValue = textBigDecimalValue.doubleValue(); if (textDoubleValue > this.min && textDoubleValue <START> < this.max) <END> { IStatus result = controller.updateValue(text); if (result != null && result.getSeverity() == IStatus.ERROR) { EEFIdeUiPlugin.INSTANCE.log(result); textBigDecimalValue = new BigDecimal(referenceValue); spinner.setSelection(textBigDecimalValue.movePointRight(this.spinner.getDigits()).intValue()); } else { referenceValue = spinner.getText(); refresh(); } } else { refresh(); } this.isDirty = false; this.setStyle(); } catch (NumberFormatException e) { EEFIdeUiPlugin.INSTANCE.log(e); } finally { updateInProgress.set(false); } } }</code><technical_language><=</technical_language>

Target:
private void updateValue(boolean force) { boolean shouldUpdateWhileRendering = !EEFSpinnerLifecycleManager.this.container.isRenderingInProgress() || force; if (!this.spinner.isDisposed() && this.isDirty && shouldUpdateWhileRendering && updateInProgress.compareAndSet(false, true)) { try { String text = spinner.getText(); BigDecimal textBigDecimalValue = new BigDecimal(text); double textDoubleValue = textBigDecimalValue.doubleValue(); if (textDoubleValue >= this.min && textDoubleValue <= this.max) { IStatus result = controller.updateValue(text); if (result != null && result.getSeverity() == IStatus.ERROR) { EEFIdeUiPlugin.INSTANCE.log(result); textBigDecimalValue = new BigDecimal(referenceValue); spinner.setSelection(textBigDecimalValue.movePointRight(this.spinner.getDigits()).intValue()); } else { referenceValue = spinner.getText(); refresh(); } } else { EEFIdeUiPlugin.INSTANCE .log(new Status(IStatus.WARNING, EEFIdeUiPlugin.PLUGIN_ID, Messages.EEFSpinnerLifecycleManager_valueOutOfRange)); refresh(); } this.isDirty = false; this.setStyle(); } catch (NumberFormatException e) { EEFIdeUiPlugin.INSTANCE.log(e); } finally { updateInProgress.set(false); } } }
Source:
<code>public boolean checkUnsortedEncodedKeyComponentsEqual(@Nullable Float lhs, @Nullable Float rhs) { <START> return Objects.equals(DimensionHandlerUtils.nullToZero(lhs), DimensionHandlerUtils.nullToZero(rhs)); <END> }</code><technical_language>DimensionHandlerUtils.nullToZero(lhs) is non-null, Objects.equals() is designed accepts nullable arguments, confusing DimensionHandlerUtils.nullToZero(lhs).equals(DimensionHandlerUtils.nullToZero(rhs)) here. + for Double, Long</technical_language>

Target:
public boolean checkUnsortedEncodedKeyComponentsEqual(@Nullable Float lhs, @Nullable Float rhs) { return DimensionHandlerUtils.nullToZero(lhs).equals(DimensionHandlerUtils.nullToZero(rhs)); }
Source:
<code>public ContentType extractContentType(String filename) { <START> String extension = FilenameUtils.getExtension(filename); <END> if (!contentTypeMappings.containsKey(extension)) { throw new IllegalArgumentException("Files with extension " + extension + " are not supported"); } return contentTypeMappings.get(extension); }</code><technical_language>I suggest adding toLowerCase</technical_language>

Target:
public ContentType extractContentType(String filename) { String extension = FilenameUtils.getExtension(filename).toLowerCase(); if (!contentTypeMappings.containsKey(extension)) { throw new IllegalArgumentException("Files with extension " + extension + " are not supported"); } return contentTypeMappings.get(extension); }
Source:
<code>public List<CohortDefinition> getCohortQueries() { <START> return DefinitionContext.getCohortDefinitionService().getAllDefinitions(false); <END> }</code><technical_language>I able "getAllDefinitionSummaries(false)" "getAllDefinitions(false)", need is uuid name, is faster performing need deserialize full definition xml</technical_language>

Target:
public List<DefinitionSummary> getCohortQueries() { return DefinitionContext.getCohortDefinitionService().getAllDefinitionSummaries(false); }
Source:
<code>public void execute(JobExecutionContext context) throws JobExecutionException { String content = (String) context.getJobDetail().getJobDataMap().get(JOB_DATA_CONTENT_KEY); if (StringUtils.isNotBlank(content)) { String deviceId = content.split(";")[0]; String state = content.split(";")[1]; boolean setToOn = state == "on"; <START> logger.debug("About to execute ChangeStateJob with arguments {}", deviceId + " " + state); <END> try { MystromClient.ChangeState(deviceId, setToOn); } catch (Exception e) { throw new JobExecutionException("Executing command '" + deviceId + " " + state + "' throws an Exception. Job will be refired immediately.", e, true); } } }</code><technical_language>Please SLF4J parametrized logging instead of string concetanation</technical_language>

Target:
public void execute(JobExecutionContext context) throws JobExecutionException { String content = (String) context.getJobDetail().getJobDataMap() .get(JOB_DATA_CONTENT_KEY); if (StringUtils.isNotBlank(content)) { String deviceId = content.split(";")[0]; String state = content.split(";")[1]; boolean setToOn = state == "on"; logger.debug( "About to execute ChangeStateJob with arguments {}", deviceId, state); try { MystromClient.ChangeState(deviceId, setToOn); } catch (Exception e) { throw new JobExecutionException( "Executing command '" + deviceId + " " + state + "' throws an Exception. Job will be refired immediately.", e, true); } } }