auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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) { 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; }

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:
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 = new BasicSliceInput(output.slice()); 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; }

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:
void attachConfigUpdateListeners(GoConfigService configService) { configService.register(reparseOnConfigUpdate()); configService.register(reparseOnPipelineConfigUpdate()); configService.register(reparseOnEnvConfigUpdate()); configService.register(reparseOnTemplateConfigUpdate()); configService.register(reparseOnScmUpdate()); configService.register(reparseOnConfigRepoConfigUpdate()); }

Target:
void attachConfigUpdateListeners(GoConfigService configService) { configService.register(new ConfigRepoReparseListener(this)); }
Source:
private void loadVars(EvaluationContext ec, Detail detail) { Detail[] details = getFlattenedDetails(detail); Hashtable<String, XPathExpression> decs = 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(); 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()); } } }

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:
void redraw (boolean children) { if (display.inPaint) { display.asyncExec(() -> redraw(children)); return; } view.setNeedsDisplay(true); }

Target:
void redraw(boolean children) { if (display.inPaint) { display.asyncExec(() -> { if (!isDisposed()) setNeedsDisplay(); }); return; } setNeedsDisplay(); }
Source:
private static void extractDexFiles(String apkFileName, File outDir) throws IOException { 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(); } zis.close(); }

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:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); CrashUtil.init(this); 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); } }

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:
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.isNotEmpty(cdImagePath) && !cdImagePath.toLowerCase().endsWith(ValidationUtils.ISO_SUFFIX)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CDROM_DISK_FORMAT); } return true; }

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:
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); } prefs.saveKeywords(); } 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); } } } ); } }); }

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:
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); while (keysOrMembers.step(tempTvp)) { sb.addItem(tempTvp); } sb.finish(); result.set(abvs); break; default: throw new SystemException(ErrorCode.FORG0006); } } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } }

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:
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(); lc.run(10000); } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }

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:
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(); } Change c = db.changes().get(rsrc.getChange().getId()); if (c != null) { db.changes().update(Collections.singleton(c)); } db.patchSetApprovals().delete(del); db.commit(); } finally { db.rollback(); } return Response.none(); }

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:
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) { 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; } }

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:
private int asLit(SetVar var, DecisionOperator<SetVar> op, int val) { int l; if (op == DecisionOperatorFactory.makeSetForce()) { l = SatSolver.negated(png.Literal(var, val, true)); } else if (op == DecisionOperatorFactory.makeSetRemove()) { l = png.Literal(var, val, true); } else { throw new UnsupportedOperationException("Cannot deal with such operator: " + op); } return l; }

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:
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 refArt.getLastModified().toString(); } } } catch (OseeCoreException ex) { return LogUtil.getCellExceptionString(ex); } return ""; }

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:
public JSONObject serviceImpl(Query call, HttpServletResponse response, Authorization rights, JSONObjectWithDefault permissions) throws APIException { String profile = call.get("profile", ""); String termsS = call.get("terms", ""); Set terms = null; if (!"".equals(termsS)) { terms = new HashSet(Arrays.asList(termsS.split(","))); return scrapeGithub(profile, terms); } return scrapeGithub(profile); }

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:
public MerkleTreeConfig getMapMerkleTreeConfig(String name) { return ConfigUtils.getConfig(configPatternMatcher, mapMerkleTreeConfigs, name, MerkleTreeConfig.class); }

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:
public static AgentDto asDto(Agent agent) { AgentDto agentDto = newDto(AgentDto.class); agentDto.setName(agent.getName()); agentDto.setVersion(agent.getVersion()); agentDto.setProperties(agent.getProperties()); agentDto.setScript(agent.getScript()); agentDto.setDependencies(agent.getDependencies()); return agentDto; }

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:
public void showCompareWithLatest(final AlteredFiles alteredFiles, @Nullable final String currentFile, final String revision) { this.alteredFiles = alteredFiles; this.revision = revision; this.compareWithLatest = true; findFileIndexOrFirst(currentFile); showCompareForCurrentFile(); }

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:
public static LigerDrawerFragment build(String pageName, String pageTitle, String pageArgs, String pageOptions) { LigerDrawerFragment newFragment = new LigerDrawerFragment(); Bundle args = new Bundle(); 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; }

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:
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( "HideElement", "Element is hidden; CSS " + slotSelector, true ); }

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:
public void setup() { storage = new FileBasedKieServerTemplateStorage(); templateMap.keySet().forEach(key -> { storage.store(templateMap.get(key)); }); assertEquals("Mismatched number of server templates stored",templateMap.keySet().size(),storage.loadKeys().size()); }

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:
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); templateStore.setInstallPath("template/tmpl/2/" + templateId + "/" + template.getUuid() + "." + fileExtension); 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); }

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:
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()) { if (limit.isPresent()) { query += " LIMIT " + limit.getAsLong(); pushdown = true; } } return new DruidQueryGenerator.GeneratedDql(tableName, query, pushdown); }

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:
public List<ChallengeDto> findAll(){ UUID activeOrganization = sessionService.getActiveOrganization(); List<Challenge> challenges = null; if(activeOrganization == null){ challenges = repository.findAllByInviteOnly(false); }else{ challenges = repository.findAllByOrganization(activeOrganization); } return challenges.stream().map(ChallengeDto::new).collect(Collectors.toList()); }

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:
private ShouldBeEqualIgnoringNewLines(CharSequence actual, CharSequence expected) { super("%nExpecting:%n <%s>%nto be equal to:%n <%s>%nignoring newline (\n, \r\n) in acutal.", actual, expected); }

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:
public void detachingFromWindow_disconnectsService_whenServiceConnectionIsNotNull() { when(customTabHelper.getServiceConnection()).thenReturn(serviceConnection); UrlWidget widget = createWidget(promptWithAnswer(null)); widget.onDetachedFromWindow(); verify(serviceConnection).onServiceDisconnected(null); }

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:
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) { assertThat(ex).isNotNull(); } assertThat(tracker.hasOpenedHandle()).isFalse(); }

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:
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)); } } m_skip_null_predicate = AbstractExpression.fromJSONChild(jobj, Members.SKIP_NULL_PREDICATE.name(), m_tableScan); }

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:
public Uni<World> find(int id) { return clients.getClient().preparedQuery("SELECT * FROM World WHERE id = $1", Tuple.of(id)) .map(rowset -> { Row row = rowset.iterator().next(); return new World(row.getInteger(0), row.getInteger(1)); }); }

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:
ProgramState clearStack() { return unstackValue(Integer.MAX_VALUE).state; }

Target:
ProgramState clearStack() { return stack.isEmpty() ? this : new ProgramState(this, PCollections.emptyStack()); }
Source:
public String setClusterValues(String localExecCommand) { 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; }

Target:
protected String setClusterValues(String localExecCommand) { String clusterExecCommand = localExecCommand.replace(Context.topologyBinaryFile(config), EcsContext.ecsClusterBinary(config)); clusterExecCommand = clusterExecCommand.replaceAll("\"", "'"); return clusterExecCommand; }
Source:
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 { refresh(); } this.isDirty = false; this.setStyle(); } catch (NumberFormatException e) { EEFIdeUiPlugin.INSTANCE.log(e); } finally { updateInProgress.set(false); } } }

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:
public boolean checkUnsortedEncodedKeyComponentsEqual(@Nullable Float lhs, @Nullable Float rhs) { return Objects.equals(DimensionHandlerUtils.nullToZero(lhs), DimensionHandlerUtils.nullToZero(rhs)); }

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

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:
public List<CohortDefinition> getCohortQueries() { return DefinitionContext.getCohortDefinitionService().getAllDefinitions(false); }

Target:
public List<DefinitionSummary> getCohortQueries() { return DefinitionContext.getCohortDefinitionService().getAllDefinitionSummaries(false); }
Source:
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); } } }

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); } } }
Source:
public void close() { while (!connections.isEmpty()) { Connection conn = connections.poll(); if (conn != null) { try { conn.close(); } catch (SQLException e) { log.warn("Error while closing connection to {}", jdbcDriverInfo, e); } } } }

Target:
public void close() { Connection conn; while ((conn = connections.poll()) != null) { try { conn.close(); } catch (Throwable e) { log.warn("Error while closing connection to {}", jdbcDriverInfo, e); } } }
Source:
public KSyntax2GrammarStatesFilter(Context context) { super(KSyntax2GrammarStatesFilter.class.getName(), context); for (String sort : context.definedSorts) { NonTerminal nt = new NonTerminal(new NonTerminalId(sort)); grammar.add(nt); } }

Target:
public KSyntax2GrammarStatesFilter(Context context) { super(KSyntax2GrammarStatesFilter.class.getName(), context); for (String sort : context.definedSorts) { grammar.add(new NonTerminal(sort)); } }
Source:
public void handlePeriodicMeterReadsresponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final PeriodicMeterReadGasResponseDto periodMeterReadsValueDTO) { LOGGER.info("handlePeriodicMeterReadsresponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send( ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception) .withDataObject(this.monitoringMapper.map(periodMeterReadsValueDTO, PeriodicMeterReadsContainerGas.class)) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handlePeriodicMeterReadsresponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final PeriodicMeterReadGasResponseDto periodMeterReadsValueDTO) { LOGGER.info("handlePeriodicMeterReadsresponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception) .withDataObject( this.monitoringMapper.map(periodMeterReadsValueDTO, PeriodicMeterReadsContainerGas.class)) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
public static String getFileOwner(Path path, LinkOption... options) throws IOException { String owner = null; try { UserPrincipal principal = Files.getOwner(path, options); if (principal != null) { owner = principal.getName(); } } catch (UnsupportedOperationException e) { } return owner; }

Target:
public static String getFileOwner(Path path, LinkOption... options) throws IOException { try { UserPrincipal principal = Files.getOwner(path, options); return (principal == null) ? null : principal.getName(); } catch (UnsupportedOperationException e) { return null; } }
Source:
AppServiceMSICredential(String clientId, IdentityClient identityClient) { Configuration configuration = Configuration.getGlobalConfiguration(); if (configuration.contains(Configuration.PROPERTY_MSI_ENDPOINT)) { msiEndpoint = configuration.get(Configuration.PROPERTY_MSI_ENDPOINT); } else { msiEndpoint = null; } if (configuration.contains(Configuration.PROPERTY_MSI_SECRET)) { msiSecret = configuration.get(Configuration.PROPERTY_MSI_SECRET); } else { msiSecret = null; } this.identityClient = identityClient; this.clientId = clientId; }

Target:
AppServiceMSICredential(String clientId, IdentityClient identityClient) { Configuration configuration = Configuration.getGlobalConfiguration(); this.msiEndpoint = configuration.get(Configuration.PROPERTY_MSI_ENDPOINT); this.msiSecret = configuration.get(Configuration.PROPERTY_MSI_SECRET); this.identityClient = identityClient; this.clientId = clientId; }
Source:
public void lock(T id) throws InterruptedException { threadsLocked.inc(); idsLocked.update(1); lockInternal(id); threadsLocked.dec(); }

Target:
public void lock(T id) throws InterruptedException { threadsLocked.inc(); try { idsLocked.update(1); lockInternal(id); } finally { threadsLocked.dec(); } }