auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean otherBranchCommit(Change change, PatchSet patchSet) throws RepositoryNotFoundException, IOException, PatchSetInfoNotAvailableException { Repository git = repoManager.openRepository(change.getProject()); String targetBranch = change.getDest().get(); try { RefDatabase refDb = git.getRefDatabase(); RevWalk rw = new RevWalk(git); RevCommit pushedCommit = rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get())); Ref targetRef = refDb.getRef(targetBranch); RevCommit mergeBase; RevFilter oldRevFilter = rw.getRevFilter(); try { rw.reset(); rw.setRevFilter(RevFilter.MERGE_BASE); rw.markStart(pushedCommit); RevCommit target = rw.parseCommit(targetRef.getObjectId()); rw.markStart(target); if (rw.next() != null) { mergeBase = rw.next(); } else { return true; } } finally { rw.reset(); rw.setRevFilter(oldRevFilter); } try { rw.markStart(pushedCommit); Collection<Ref> branches = refDb.getRefs(Constants.R_HEADS).values(); for (Ref branch : branches) { if (!branch.getObjectId().equals(mergeBase)) { rw.markUninteresting(rw.parseCommit(branch.getObjectId())); } } for (RevCommit n; (n = rw.next()) != null;) { if (n.equals(mergeBase)) { return false; } } return true; } finally { rw.release(); } } finally { git.close(); } }

Target:
private boolean otherBranchCommit(Change change, PatchSet patchSet) throws RepositoryNotFoundException, IOException, PatchSetInfoNotAvailableException { Repository git = repoManager.openRepository(change.getProject()); String targetBranch = change.getDest().get(); boolean commitBranchFlag = true; try { RefDatabase refDb = git.getRefDatabase(); Ref targetRef = refDb.getRef(targetBranch); Collection<Ref> branches = refDb.getRefs(Constants.R_HEADS).values(); RevWalk rw = new RevWalk(git); RevCommit pushedCommit = rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get())); RevCommit target = rw.parseCommit(targetRef.getObjectId()); RevCommit mergeBase = null; RevFilter oldRevFilter = rw.getRevFilter(); try { rw.reset(); rw.setRevFilter(RevFilter.MERGE_BASE); rw.markStart(pushedCommit); rw.markStart(target); if (rw.next() != null) { mergeBase = rw.next(); } } finally { rw.reset(); rw.setRevFilter(oldRevFilter); } try { rw.markStart(pushedCommit); for (Ref branch : branches) { if (branch.getObjectId() != targetRef.getObjectId()) { rw.markUninteresting(rw.parseCommit(branch.getObjectId())); } } for (RevCommit n; (n = rw.next()) != null;) { if (n.equals(mergeBase)) { commitBranchFlag = false; break; } } } finally { rw.release(); } } finally { git.close(); } return commitBranchFlag; }
Source:
public void getRetryOptionsTest() { AmqpRetryOptions testRetryOption = eventHubConnectionProcessor.getRetryOptions(); Assertions.assertNotNull(testRetryOption); }

Target:
public void getRetryOptionsTest() { AmqpRetryOptions testRetryOption = eventHubConnectionProcessor.getRetryOptions(); Assertions.assertEquals(AMQP_RETRY_OPTIONS.getTryTimeout(), testRetryOption.getTryTimeout()); Assertions.assertEquals(AMQP_RETRY_OPTIONS.getDelay(), testRetryOption.getDelay()); Assertions.assertEquals(AMQP_RETRY_OPTIONS.getMaxRetries(), testRetryOption.getMaxRetries()); Assertions.assertEquals(AMQP_RETRY_OPTIONS.getMaxDelay(), testRetryOption.getMaxDelay()); Assertions.assertEquals(AMQP_RETRY_OPTIONS.getMode(), testRetryOption.getMode()); }
Source:
public void checkParityFor(long currentId) { final Optional<ChargeEntity> maybeCharge = chargeDao.findById(currentId); try { if (maybeCharge.isPresent()) { final ChargeEntity charge = maybeCharge.get(); MDC.put("chargeId", charge.getExternalId()); if (chargeExistsInLedger(charge) && refundsExistInLedger(charge.getRefunds())) { logger.info("transaction (its refunds) exists in ledger and have the same state [id={}]", currentId); chargeService.updateChargeParityStatus(charge.getExternalId(), ParityCheckStatus.EXISTS_IN_LEDGER); } else { logger.info("transaction (its refunds) does not exist in ledger or is in a different state [id={}] -", currentId); chargeService.updateChargeParityStatus(charge.getExternalId(), ParityCheckStatus.MISSING_IN_LEDGER); emitHistoricalEvents(charge); } } else { logger.info("[{}/{}] - not found", currentId, maxId); } } finally { MDC.remove("chargeId"); } }

Target:
public void checkParityFor(long currentId) { final Optional<ChargeEntity> maybeCharge = chargeDao.findById(currentId); try { if (maybeCharge.isPresent()) { final ChargeEntity charge = maybeCharge.get(); MDC.put("chargeId", charge.getExternalId()); ParityCheckStatus parityCheckStatus = getChargeAndRefundsParityCheckStatus(charge); chargeService.updateChargeParityStatus(charge.getExternalId(), parityCheckStatus); logger.info("transaction parity check finished [id={},status={}]", currentId, parityCheckStatus); if (!parityCheckStatus.equals(ParityCheckStatus.EXISTS_IN_LEDGER)) { emitHistoricalEvents(charge); } } else { logger.info("[{}/{}] - not found", currentId, maxId); } } finally { MDC.remove("chargeId"); } }
Source:
protected final void setDatabaseName(final String databaseName) { if (!setup) { throw new IllegalStateException("Can only set this variable during valid times"); } this.databaseName = databaseName; }

Target:
protected final void setDatabaseName(final String databaseName) { if (!setup) { throw new IllegalStateException("Can only set this variable during setup"); } this.databaseName = databaseName; }
Source:
public void onAttach(Context context) { super.onAttach(context); if (!(context instanceof GeoTagActivity)) { throw new IllegalStateException("Activity is not instance of " + GeoTagActivity.class.getSimpleName()); } activity = (GeoTagActivity) context; lbm = LocalBroadcastManager.getInstance(context); }

Target:
public void onAttach(Context context) { super.onAttach(context); Activity activity = getActivity(); if (!(activity instanceof GeoTagActivity)) { throw new IllegalStateException("Activity is not instance of " + GeoTagActivity.class.getSimpleName()); } this.activity = (GeoTagActivity) activity; lbm = LocalBroadcastManager.getInstance(context); }
Source:
public ParameterListBuilder add(final Class<?> type, final String name, final boolean optional, final boolean varArgs) { final int ordinal = builder.size(); builder.add( new FunctionParameter() { public int getOrdinal() { return ordinal; } public String getName() { return name; } public RelDataType getType(RelDataTypeFactory typeFactory) { return typeFactory.createJavaType(varArgs ? type.getComponentType() : type); } public boolean isOptional() { return optional; } public boolean isVarArgs() { return varArgs; } }); return this; }

Target:
public ParameterListBuilder add(final Class<?> type, final String name, final boolean optional, final boolean varArgs) { final int ordinal = builder.size(); builder.add( new FunctionParameter() { public int getOrdinal() { return ordinal; } public String getName() { return name; } public RelDataType getType(RelDataTypeFactory typeFactory) { final Class paramType = varArgs ? type.getComponentType() : type; return typeFactory.createJavaType(paramType); } public boolean isOptional() { return optional; } public boolean isVarArgs() { return varArgs; } }); return this; }
Source:
private <V> V syncExec(final NoCheckedExceptionCallable<V> callable) { final AtomicReference<V> r = new AtomicReference<V>(); final AtomicReference<RuntimeException> exception = new AtomicReference<RuntimeException>(); browser .getDisplay() .syncExec( () -> { try { r.set(callable.call()); } catch (RuntimeException e) { exception.set(e); } }); if (exception.get() != null) { throw exception.get(); } return r.get(); }

Target:
private <V> V syncExec(final NoCheckedExceptionCallable<V> callable) { final AtomicReference<V> r = new AtomicReference<V>(); final AtomicReference<RuntimeException> exception = new AtomicReference<RuntimeException>(); final AtomicReference<Error> error = new AtomicReference<Error>(); browser .getDisplay() .syncExec( () -> { try { r.set(callable.call()); } catch (RuntimeException e) { exception.set(e); } catch (Error e) { error.set(e); } }); if (exception.get() != null) throw exception.get(); if (error.get() != null) throw error.get(); return r.get(); }
Source:
public Builder argument(BuilderFunction<GraphQLArgument.Builder> builderFunction) { GraphQLArgument.Builder builder = GraphQLArgument.newArgument(); builder = builderFunction.apply(builder); this.arguments.add(builder.build()); return this; }

Target:
public Builder argument(BuilderFunction<GraphQLArgument.Builder> builderFunction) { GraphQLArgument.Builder builder = GraphQLArgument.newArgument(); builder = builderFunction.apply(builder); return argument(builder); }
Source:
public void onEntityCollision(World world, Entity entity) { if(new BlockPos(0, 1, 1).equals(posInMultiblock)&&!world.isRemote&&entity!=null&&entity.isAlive()&&entity instanceof ItemEntity) { SawmillTileEntity master = master(); if(master==null) return; ItemStack stack = ((ItemEntity)entity).getItem(); if(stack.isEmpty()) return; master.insertItemToProcess(stack, false); if(stack.getCount() <= 0) entity.remove(); } }

Target:
public void onEntityCollision(World world, Entity entity) { if(!world.isRemote&&entity!=null&&entity.isAlive()) { SawmillTileEntity master = master(); if(master==null) return; if(new BlockPos(0, 1, 1).equals(posInMultiblock)&&entity instanceof ItemEntity) { ItemStack stack = ((ItemEntity)entity).getItem(); if(stack.isEmpty()) return; master.insertItemToProcess(stack, false); if(stack.getCount() <= 0) entity.remove(); } else if(entity instanceof LivingEntity&&!master.sawblade.isEmpty() &&CACHED_SAWBLADE_AABB.apply(master).intersects(entity.getBoundingBox())) { if(entity instanceof PlayerEntity&&((PlayerEntity)entity).abilities.disableDamage) return; int consumed = master.energyStorage.extractEnergy(80, true); if(consumed > 0) { master.energyStorage.extractEnergy(consumed, false); entity.attackEntityFrom(IEDamageSources.sawmill, 7); } } } }
Source:
public OAuthToken getToken(String userId) throws IOException { final OAuthToken token = super.getToken(userId); if (!(token == null || token.getToken() == null || token.getToken().isEmpty())) { String tokenVerifyUrl = this.openshiftEndpoint + "oapi/v1/projects"; HttpURLConnection http = null; try { http = (HttpURLConnection) new URL(tokenVerifyUrl).openConnection(); http.setInstanceFollowRedirects(false); http.setRequestMethod("GET"); http.setRequestProperty("Authorization", "Bearer " + token.getToken()); http.setRequestProperty("Accept", "application/json"); if (http.getResponseCode() == 401) { return null; } } finally { if (http != null) { http.disconnect(); } } return token; } return null; }

Target:
public OAuthToken getToken(String userId) throws IOException { final OAuthToken token = super.getToken(userId); if (!(token == null || token.getToken() == null || token.getToken().isEmpty())) { HttpURLConnection http = null; try { http = (HttpURLConnection) new URL(verifyTokenUrl).openConnection(); http.setInstanceFollowRedirects(false); http.setRequestMethod("GET"); http.setRequestProperty("Authorization", "Bearer " + token.getToken()); http.setRequestProperty("Accept", "application/json"); if (http.getResponseCode() == 401) { return null; } } finally { if (http != null) { http.disconnect(); } } return token; } return null; }
Source:
public LabelsNeededSummary getSummaryOfLabelsNeeded(final LabelsInfoInput labelsInfoInput) { final LabelsNeededSummary labelsNeededSummary = new LabelsNeededSummary(); final List<InstanceInfomationDTO> observationsByInstance = this.middlewareDatasetService.getInformationInstance(labelsInfoInput.getDatasetId(), labelsInfoInput.getStudyId()); long totalNumberOfLabelsNeeded = 0; for (InstanceInfomationDTO instanceInfomationDTO:observationsByInstance) { final LabelsNeededSummary.Row row = new LabelsNeededSummary.Row(instanceInfomationDTO.getEnvironment().toString(), instanceInfomationDTO.getnOfObservations(),instanceInfomationDTO.getnOfObservations(), instanceInfomationDTO.getnOfReps(), instanceInfomationDTO.getnOfEntries()); labelsNeededSummary.addRow(row); totalNumberOfLabelsNeeded += row.getLabelsNeeded(); } labelsNeededSummary.setTotalNumberOfLabelsNeeded(totalNumberOfLabelsNeeded); return labelsNeededSummary; }

Target:
public LabelsNeededSummary getSummaryOfLabelsNeeded(final LabelsInfoInput labelsInfoInput) { final LabelsNeededSummary labelsNeededSummary = new LabelsNeededSummary(); final List<InstanceDetailsDTO> InstanceDetailsDTOs = this.middlewareDatasetService.getInstanceDetails(labelsInfoInput.getDatasetId(), labelsInfoInput.getStudyId()); long totalNumberOfLabelsNeeded = 0; for (final InstanceDetailsDTO instanceDetailsDTO :InstanceDetailsDTOs) { final LabelsNeededSummary.Row row = new LabelsNeededSummary.Row(instanceDetailsDTO.getEnvironment().toString(), instanceDetailsDTO.getnOfObservations(), instanceDetailsDTO.getnOfObservations(), instanceDetailsDTO.getnOfReps(), instanceDetailsDTO.getnOfEntries()); labelsNeededSummary.addRow(row); totalNumberOfLabelsNeeded += row.getLabelsNeeded(); } labelsNeededSummary.setTotalNumberOfLabelsNeeded(totalNumberOfLabelsNeeded); return labelsNeededSummary; }
Source:
public String getUniqueUsername(String providerId) { String id = null; while (true) { id = "USR" + generateUniqueId() + "_" + providerId; Object existingFile = null; try { existingFile = getUser(id); } catch (QuadrigaStorageException e) { e.printStackTrace(); } if (existingFile == null) { break; } } return id; }

Target:
public String getUniqueUsername(String providerId) { String id = null; while (true) { id = "USR" + generateUniqueId() + "_" + providerId; Object existingUser = null; try { existingUser = getUser(id); } catch (QuadrigaStorageException e) { logger.error("Error while retrieving user details",e); break; } if (existingUser == null) { break; } } return id; }
Source:
private void createEmptyCommit(final Repository repo, final Project.NameKey project, final String ref) throws IOException { ObjectInserter oi = repo.newObjectInserter(); try { CommitBuilder cb = new CommitBuilder(); cb.setTreeId(oi.insert(Constants.OBJ_TREE, new byte[] {})); cb.setCommitter(currentUser.newCommitterIdent()); cb.setAuthor(cb.getCommitter()); cb.setMessage("Initial empty repository"); ObjectId id = oi.insert(cb); oi.flush(); RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(id); final Result result = ru.update(); switch (result) { case NEW: rq.scheduleUpdate(project, ref); break; default: { final String msg = "Cannot create empty commit for " + projectName + ": " + result.name(); log.error(msg); throw new IOException(result.name()); } } } catch (IOException e) { log.error("Cannot create empty commit for " + projectName, e); throw e; } finally { oi.release(); } }

Target:
private void createEmptyCommit(final Repository repo, final Project.NameKey project, final String ref) throws IOException { ObjectInserter oi = repo.newObjectInserter(); try { CommitBuilder cb = new CommitBuilder(); cb.setTreeId(oi.insert(Constants.OBJ_TREE, new byte[] {})); cb.setCommitter(serverIdent); cb.setAuthor(cb.getCommitter()); cb.setMessage("Initial empty repository"); ObjectId id = oi.insert(cb); oi.flush(); RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(id); final Result result = ru.update(); switch (result) { case NEW: rq.scheduleUpdate(project, ref); break; default: { throw new IOException(result.name()); } } } catch (IOException e) { log.error("Cannot create empty commit for " + projectName, e); throw e; } finally { oi.release(); } }
Source:
public boolean isActivated(String name) { for (IClassCollectionRole classCollection : classCollections) { if (classCollection.getConfigName().equals(name)) { return classCollection.isActivated(); } } try { return Utils.getComponentManager().lookup(ClassPackage.class, name).isActivated(); } catch (ComponentLookupException exc) { LOGGER.debug("ClassDefinitionPackage '{}' doesn't exist", name); return false; } }

Target:
public boolean isActivated(String name) { try { return Utils.getComponentManager().lookup(ClassPackage.class, name).isActivated(); } catch (ComponentLookupException exc) { LOGGER.debug("ClassDefinitionPackage '{}' doesn't exist", name); } for (IClassCollectionRole classCollection : classCollections) { if (classCollection.getConfigName().equals(name)) { return classCollection.isActivated(); } } return false; }
Source:
private void commit() { if (getEntity() != null) { if (getWindow() != null) { return; } Optional<Snapshot> inPreviewSnapshot = getItems().stream().filter(s -> s.getStatus() == SnapshotStatus.IN_PREVIEW).findFirst(); if (!inPreviewSnapshot.isPresent()) { return; } Snapshot snapshot = inPreviewSnapshot.get(); ConfirmationModel model = new ConfirmationModel(); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().commitSnapshotTitle()); model.setHelpTag(HelpTag.commit_snapshot); model.setHashName("commit_snapshot"); model.setMessage(ConstantsManager.getInstance() .getMessages() .areYouSureYouWantToCommitSnapshot( DateTimeFormat.getFormat(DATE_FORMAT).format(snapshot.getCreationDate()), snapshot.getDescription())); model.getCommands().add(UICommand.createDefaultOkUiCommand("OnCommit", this)); model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this)); } }

Target:
private void commit() { if (getEntity() != null) { if (getWindow() != null) { return; } Snapshot snapshot; if (getSelectedItem() == null) { snapshot = getItems().stream() .filter(s -> s.getStatus() == SnapshotStatus.IN_PREVIEW) .findFirst() .orElse(null); } else { snapshot = getSelectedItem(); } if (snapshot == null) { return; } ConfirmationModel model = new ConfirmationModel(); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().commitSnapshotTitle()); model.setHelpTag(HelpTag.commit_snapshot); model.setHashName("commit_snapshot"); model.setMessage(ConstantsManager.getInstance() .getMessages() .areYouSureYouWantToCommitSnapshot( DateTimeFormat.getFormat(DATE_FORMAT).format(snapshot.getCreationDate()), snapshot.getDescription())); model.getCommands().add(UICommand.createDefaultOkUiCommand("OnCommit", this)); model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this)); } }
Source:
protected void performCleanUp(SessionFactory sf) { log( "starting clean up phase" ); try ( Session s = sf.openSession() ) { final SessionImplementor session = (SessionImplementor) s; FullTextSession fulltextSession = Search.getFullTextSession( sf.openSession() ); beginTransaction( session ); s.createNativeQuery( "delete from book_author where book_id < :id" ).setParameter( "id", initialOffset ).executeUpdate(); s.createNativeQuery( "delete from book where id < :id" ).setParameter( "id", initialOffset ).executeUpdate(); s.createNativeQuery( "delete from author where id < :id" ).setParameter( "id", initialOffset ).executeUpdate(); fulltextSession.purgeAll( Book.class ); fulltextSession.flushToIndexes(); commitTransaction( session ); } }

Target:
protected void performCleanUp(SessionFactory sf) { log( "starting clean up phase" ); try ( Session s = sf.openSession() ) { final SessionImplementor session = (SessionImplementor) s; FullTextSession fulltextSession = Search.getFullTextSession( s ); beginTransaction( session ); s.createNativeQuery( "delete from book_author where book_id < :id" ).setParameter( "id", initialOffset ).executeUpdate(); s.createNativeQuery( "delete from book where id < :id" ).setParameter( "id", initialOffset ).executeUpdate(); s.createNativeQuery( "delete from author where id < :id" ).setParameter( "id", initialOffset ).executeUpdate(); fulltextSession.purgeAll( Book.class ); fulltextSession.flushToIndexes(); commitTransaction( session ); } }
Source:
public double priceFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate) { ArgChecker.isTrue(settlementDate.isBefore(bill.getNotional().getDate()), "settlement date must be before maturity date"); ArgChecker.isTrue(!settlementDate.isBefore(provider.getValuationDate()), "settlement date must be on or after valuation date"); IssuerCurveDiscountFactors discountFactors = provider.issuerCurveDiscountFactors( bill.getLegalEntityId(), bill.getCurrency()); double dfMaturity = discountFactors.discountFactor(bill.getNotional().getDate()); RepoCurveDiscountFactors discountFactorsRepo = provider.repoCurveDiscountFactors(bill.getSecurityId(), bill.getLegalEntityId(), bill.getCurrency()); double dfRepoSettle = discountFactorsRepo.discountFactor(settlementDate); double price = dfMaturity / dfRepoSettle; return price; }

Target:
public double priceFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate) { ArgChecker.inOrderNotEqual(settlementDate, bill.getNotional().getDate(), "settlementDate", "endDate"); ArgChecker.inOrderOrEqual(provider.getValuationDate(), settlementDate, "valuationDate", "settlementDate"); IssuerCurveDiscountFactors discountFactors = provider.issuerCurveDiscountFactors( bill.getLegalEntityId(), bill.getCurrency()); double dfMaturity = discountFactors.discountFactor(bill.getNotional().getDate()); RepoCurveDiscountFactors discountFactorsRepo = provider.repoCurveDiscountFactors(bill.getSecurityId(), bill.getLegalEntityId(), bill.getCurrency()); double dfRepoSettle = discountFactorsRepo.discountFactor(settlementDate); return dfMaturity / dfRepoSettle; }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { boolean doFilter = true; try { HttpSession httpSession = ((HttpServletRequest) request).getSession(false); if (httpSession != null) { String engineSession = (String) httpSession.getAttribute(FiltersHelper.Constants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); InitialContext ctx = null; if (engineSession != null) { ctx = new InitialContext(); try { VdcQueryParametersBase parameters = new VdcQueryParametersBase(engineSession); VdcQueryReturnValue returnValue = FiltersHelper.getBackend(ctx) .runPublicQuery(VdcQueryType.ValidateSession, parameters); if (!returnValue.getSucceeded()) { httpSession.removeAttribute(FiltersHelper.Constants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); } else { request.setAttribute(FiltersHelper.Constants.REQUEST_USER_KEY, returnValue.getReturnValue()); } } finally { ctx.close(); } } } } catch (Exception ex) { doFilter = false; String msg = String.format("An error has occurred while session validation. Message is %1$s", ex.getMessage()); log.error(msg); if (log.isDebugEnabled()) { log.debug("", ex); } ((HttpServletResponse) response).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (doFilter) { chain.doFilter(request, response); } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { boolean doFilter = false; try { HttpSession httpSession = ((HttpServletRequest) request).getSession(false); if (httpSession != null) { String engineSession = (String) httpSession.getAttribute(FiltersHelper.Constants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); InitialContext ctx = null; if (engineSession != null) { ctx = new InitialContext(); try { VdcQueryReturnValue returnValue = FiltersHelper.getBackend(ctx) .runPublicQuery(VdcQueryType.ValidateSession, new VdcQueryParametersBase(engineSession)); if (!returnValue.getSucceeded()) { httpSession.invalidate(); } } finally { ctx.close(); } } } doFilter = true; } catch (Exception ex) { doFilter = false; String msg = String.format("An error has occurred while session validation. Message is %1$s", ex.getMessage()); log.error(msg); if (log.isDebugEnabled()) { log.debug("", ex); } ((HttpServletResponse) response).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (doFilter) { chain.doFilter(request, response); } }
Source:
public void createDirectory(final Path dir, final FileAttribute<?>... attrs) { checkNotNull("dir", dir); final Path realDir = dir.toAbsolutePath(); checkFileExistsThenThrow(realDir); realDir.toFile().mkdirs(); }

Target:
public void createDirectory(final Path dir, final FileAttribute<?>... attrs) throws UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException { checkNotNull("dir", dir); final Path realDir = dir.toAbsolutePath(); checkFileExistsThenThrow(realDir); realDir.toFile().mkdirs(); }
Source:
private List<Change> submitWholeTopic(RevisionResource rsrc, IdentifiedUser caller, boolean force, String topic) throws ResourceConflictException, OrmException, IOException { Preconditions.checkNotNull(topic); final Timestamp timestamp = TimeUtil.nowTs(); ReviewDb db = dbProvider.get(); ChangeData cd = changeDataFactory.create(db, rsrc.getControl()); List<ChangeData> changesByTopic = queryProvider.get().byTopicOpen(topic); String problems = problemsForSubmittingChanges(changesByTopic, caller); if (problems != null) { throw new ResourceConflictException(problems); } Change change = rsrc.getChange(); ChangeUpdate update = updateFactory.create(rsrc.getControl(), timestamp); List<SubmitRecord> submitRecords = checkSubmitRule(cd, rsrc.getPatchSet(), force); update.submit(submitRecords); db.changes().beginTransaction(change.getId()); try { BatchMetaDataUpdate batch = approve(rsrc, update, caller, timestamp); batch.write(update, new CommitBuilder()); for (ChangeData c : changesByTopic) { submitToDatabase(db, c.getId(), timestamp); } db.commit(); } catch (ResourceConflictException e) { throw e; } finally { db.rollback(); } List<Change.Id> ids = new ArrayList<>(changesByTopic.size()); List<Change> ret = new ArrayList<>(changesByTopic.size()); for (ChangeData c : changesByTopic) { ids.add(c.getId()); ret.add(c.change()); } indexer.indexAsync(ids).checkedGet(); return ret; }

Target:
private List<Change> submitWholeTopic(RevisionResource rsrc, IdentifiedUser caller, boolean force, String topic) throws ResourceConflictException, OrmException, IOException { Preconditions.checkNotNull(topic); final Timestamp timestamp = TimeUtil.nowTs(); ReviewDb db = dbProvider.get(); ChangeData cd = changeDataFactory.create(db, rsrc.getControl()); List<ChangeData> changesByTopic = queryProvider.get().byTopicOpen(topic); String problems = problemsForSubmittingChanges(changesByTopic, caller); if (problems != null) { throw new ResourceConflictException(problems); } Change change = rsrc.getChange(); ChangeUpdate update = updateFactory.create(rsrc.getControl(), timestamp); List<SubmitRecord> submitRecords = checkSubmitRule(cd, rsrc.getPatchSet(), force); update.submit(submitRecords); db.changes().beginTransaction(change.getId()); try { BatchMetaDataUpdate batch = approve(rsrc, update, caller, timestamp); batch.write(update, new CommitBuilder()); for (ChangeData c : changesByTopic) { submitToDatabase(db, c.getId(), timestamp); } db.commit(); } finally { db.rollback(); } List<Change.Id> ids = new ArrayList<>(changesByTopic.size()); List<Change> ret = new ArrayList<>(changesByTopic.size()); for (ChangeData c : changesByTopic) { ids.add(c.getId()); ret.add(c.change()); } indexer.indexAsync(ids).checkedGet(); return ret; }
Source:
public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException { validateOzoneObj(obj); String prefixPath = obj.getPath(); metadataManager.getLock().acquirePrefixLock(prefixPath); try { OmPrefixInfo prefixInfo = metadataManager.getPrefixTable().get(prefixPath); List<OzoneAcl> list = null; if (prefixInfo != null) { list = prefixInfo.getAcls(); } if (list == null || !list.contains(acl)) { LOG.debug("acl does not exist for prefixpath {}", acl, prefixPath); return true; } list.remove(acl); OmPrefixInfo.Builder upiBuilder = OmPrefixInfo.newBuilder(); upiBuilder.setName(prefixPath).setAcls(list); if (prefixInfo != null && prefixInfo.getMetadata() != null) { upiBuilder.addAllMetadata(prefixInfo.getMetadata()); } prefixInfo = upiBuilder.build(); metadataManager.getPrefixTable().put(prefixPath, prefixInfo); prefixTree.insert(prefixPath, prefixInfo); } catch (IOException ex) { if (!(ex instanceof OMException)) { LOG.error("Remove prefix acl operation failed for prefix path:{}" + " acl:{}", prefixPath, acl, ex); } throw ex; } finally { metadataManager.getLock().releasePrefixLock(prefixPath); } return true; }

Target:
public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException { validateOzoneObj(obj); String prefixPath = obj.getPath(); metadataManager.getLock().acquirePrefixLock(prefixPath); try { OmPrefixInfo prefixInfo = metadataManager.getPrefixTable().get(prefixPath); List<OzoneAcl> list = null; if (prefixInfo != null) { list = prefixInfo.getAcls(); } if (list == null) { LOG.debug("acl does not exist for prefix path {}", acl, prefixPath); return false; } boolean found = false; for (OzoneAcl a: list) { if (a.getName().equals(acl.getName()) && a.getType() == acl.getType()) { found = true; a.getAclBitSet().andNot(acl.getAclBitSet()); if (a.getAclBitSet().isEmpty()) { list.remove(a); } break; } } if (!found) { LOG.debug("acl does not exist for prefix path {}", acl, prefixPath); return false; } if (!list.isEmpty()) { OmPrefixInfo.Builder upiBuilder = OmPrefixInfo.newBuilder(); upiBuilder.setName(prefixPath).setAcls(list); if (prefixInfo != null && prefixInfo.getMetadata() != null) { upiBuilder.addAllMetadata(prefixInfo.getMetadata()); } prefixInfo = upiBuilder.build(); metadataManager.getPrefixTable().put(prefixPath, prefixInfo); prefixTree.insert(prefixPath, prefixInfo); } else { metadataManager.getPrefixTable().delete(prefixPath); prefixTree.removePrefixPath(prefixPath); } } catch (IOException ex) { if (!(ex instanceof OMException)) { LOG.error("Remove prefix acl operation failed for prefix path:{}" + " acl:{}", prefixPath, acl, ex); } throw ex; } finally { metadataManager.getLock().releasePrefixLock(prefixPath); } return true; }
Source:
public static TruthState getHom(final int alleleIdx) { if (alleleIdx == 0) return HOM_REF; if (alleleIdx == 1) return HOM_VAR1; ValidationUtils.validateArg(false,"Shouldn't be here."); return null; }

Target:
public static TruthState getHom(final int alleleIdx) { if (alleleIdx == 0) return HOM_REF; if (alleleIdx == 1) return HOM_VAR1; throw new IllegalStateException("Shouldn't be here."); }
Source:
public Mono<UpdateNumberCapabilitiesResponse> updateCapabilities( Map<PhoneNumber, NumberUpdateCapabilities> phoneNumberCapabilitiesUpdate) { Map<String, NumberUpdateCapabilities> capabilitiesMap = new HashMap<>(); for (Map.Entry<PhoneNumber, NumberUpdateCapabilities> entry : phoneNumberCapabilitiesUpdate.entrySet()) { capabilitiesMap.put(entry.getKey().getValue(), entry.getValue()); } UpdateNumberCapabilitiesRequest updateNumberCapabilitiesRequest = new UpdateNumberCapabilitiesRequest(); updateNumberCapabilitiesRequest.setPhoneNumberCapabilitiesUpdate(capabilitiesMap); return phoneNumberAdminClient.getPhoneNumberAdministrations() .updateCapabilitiesAsync(updateNumberCapabilitiesRequest); }

Target:
public Mono<UpdateNumberCapabilitiesResponse> updateCapabilities( Map<PhoneNumber, NumberUpdateCapabilities> phoneNumberCapabilitiesUpdate) { Map<String, NumberUpdateCapabilities> capabilitiesMap = new HashMap<>(); for (Map.Entry<PhoneNumber, NumberUpdateCapabilities> entry : phoneNumberCapabilitiesUpdate.entrySet()) { capabilitiesMap.put(entry.getKey().getValue(), entry.getValue()); } UpdateNumberCapabilitiesRequest updateNumberCapabilitiesRequest = new UpdateNumberCapabilitiesRequest(); updateNumberCapabilitiesRequest.setPhoneNumberCapabilitiesUpdate(capabilitiesMap); return phoneNumberAdministrations.updateCapabilitiesAsync(updateNumberCapabilitiesRequest); }
Source:
public Instant getDeletedAt() { if (this.deletedAt == null) { return null; } else { return TimeHelper.convertDateToInstant(this.deletedAt); } }

Target:
public Instant getDeletedAt() { return TimeHelper.convertDateToInstant(deletedAt); }
Source:
public ImageResource getValue(T item) { String osTypeName = AsyncDataProvider.getOsName(extractor.extractOsType(item)); ResourcePrototype resource = getApplicationResourcesWithLookup().getResource(osTypeName + "SmallImage"); if (resource == null || !(resource instanceof ImageResource)) { resource = getApplicationResourcesWithLookup().UnassignedSmallImage(); } return (ImageResource) resource; }

Target:
public ImageResource getValue(T item) { String osTypeName = AsyncDataProvider.getOsUniqueOsNames().get(extractor.extractOsType(item)); ResourcePrototype resource = getApplicationResourcesWithLookup().getResource(osTypeName + "SmallImage"); if (resource == null || !(resource instanceof ImageResource)) { resource = getApplicationResourcesWithLookup().UnassignedSmallImage(); } return (ImageResource) resource; }
Source:
public Map<String, Object> getVariableValues(GraphQLSchema schema, List<VariableDefinition> variableDefinitions, Map<String, Object> inputs) { Map<String, Object> result = new LinkedHashMap<String, Object>(); for (VariableDefinition variableDefinition : variableDefinitions) { Object variableValue = getVariableValue(schema, variableDefinition, inputs.get(variableDefinition.getName())); if (variableValue != null) { result.put(variableDefinition.getName(), variableValue); } } return result; }

Target:
public Map<String, Object> getVariableValues(GraphQLSchema schema, List<VariableDefinition> variableDefinitions, Map<String, Object> inputs) { final Map<String, Object> result = new LinkedHashMap<String, Object>(); for (VariableDefinition variableDefinition : variableDefinitions) { final String name = variableDefinition.getName(); if (inputs.containsKey(name)) { Object variableValue = getVariableValue(schema, variableDefinition, inputs.get(variableDefinition.getName())); result.put(name, variableValue); } } return result; }
Source:
public boolean isActive(FeatureState featureState, FeatureUser user) { HttpServletRequest request = HttpServletRequestHolder.get(); if (request != null) { List<String> parts = Strings.splitAndTrim(featureState.getParameter(PARAM_IPS), "[\\s,]+"); List<InetAddress> ips = new ArrayList<>(); List<CIDRUtils> cidrUtils = new ArrayList<>(); for (String part : parts) { try { if (part.contains("/")) { cidrUtils.add(new CIDRUtils(part)); } else { ips.add(InetAddress.getByName(part)); } } catch (Exception e) { log.warn("Ignoring illegal IP address or CIDR range " + part); } } try { if (ips.contains(InetAddress.getByName(request.getRemoteAddr()))) { return true; } for (CIDRUtils cidrUtil : cidrUtils) { if (cidrUtil.isInRange(request.getRemoteAddr())) { return true; } } } catch (UnknownHostException e) { log.error("Illegal address " + request.getRemoteAddr()); } } return false; }

Target:
public boolean isActive(FeatureState featureState, FeatureUser user) { HttpServletRequest request = HttpServletRequestHolder.get(); if (request != null) { List<String> parts = Strings.splitAndTrim(featureState.getParameter(PARAM_IPS), "[\\s,]+"); try { String remoteAddr = request.getRemoteAddr(); InetAddress remoteInetAddress = InetAddress.getByName(remoteAddr); for (String part : parts) { if (part.equals(remoteAddr)) { return true; } if (part.contains("/")) { CIDRUtils cidrUtil = new CIDRUtils(part); if (cidrUtil.isInRange(remoteInetAddress)) { return true; } } else if (remoteInetAddress.equals(InetAddress.getByName(part))) { return true; } } } catch (UnknownHostException | IllegalArgumentException e) { log.warn("Ignoring illegal IP address or CIDR range "); } } return false; }
Source:
public TeamInviteToken inviteMember(Long teamId, String username) { User user = userService.getUserByUsername(username).orElseThrow(() -> new UsernameNotFoundException(username)); Team team = getTeamById(teamId); if (team.getMembers().contains(user)) { throw new IllegalArgumentException("User is already a member of this team"); } boolean userAlreadyInvited = teamInviteTokenRepository.findByUserUsername(username).stream() .filter(token -> token.getTeam().equals(team)) .noneMatch(TeamInviteToken::isValid); if (userAlreadyInvited) { String token = UUID.randomUUID().toString(); TeamInviteToken inviteToken = new TeamInviteToken(token, user, team); teamInviteTokenRepository.save(inviteToken); try { mailService.sendTeamInviteMail(user, team.getTeamName(), team.getCaptain()); } catch (MessagingException e) { e.printStackTrace(); } return inviteToken; } else { throw new IllegalArgumentException("User already invited"); } }

Target:
public TeamInviteToken inviteMember(Long teamId, String username) { User user = userService.getUserByUsername(username).orElseThrow(() -> new UsernameNotFoundException(username)); Team team = getTeamById(teamId); if (team.getMembers().contains(user)) { throw new IllegalArgumentException("User is already a member of this team"); } if (isUserAlreadyInvited(username, team)) { TeamInviteToken inviteToken = new TeamInviteToken(user, team); teamInviteTokenRepository.save(inviteToken); try { mailService.sendTeamInviteMail(user, team.getTeamName(), team.getCaptain()); } catch (MessagingException e) { e.printStackTrace(); } return inviteToken; } else { throw new IllegalArgumentException("User already invited"); } }
Source:
public void inputChanged(@Nullable Viewer viewer, @Nullable Object oldInput, @Nullable Object newInput) { fTableViewer = (TableViewer) viewer; if (newInput instanceof ISegmentStore<?>) { ISegmentStore<?> segmentStore = (ISegmentStore<?>) newInput; fSegmentArray = Iterables.toArray(segmentStore, ISegment.class); if (fComparator != null){ Arrays.sort(fSegmentArray, fComparator); } } }

Target:
public void inputChanged(@Nullable Viewer viewer, @Nullable Object oldInput, @Nullable Object newInput) { fTableViewer = (TableViewer) viewer; if (newInput instanceof ISegmentStore<?>) { ISegmentStore<?> segmentStore = (ISegmentStore<?>) newInput; fSegmentArray = Iterables.toArray(segmentStore, ISegment.class); if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else { fSegmentArray = null; } }
Source:
private Map<String, MessageAttributeValue> translateAttributes(Map<String, Object> headers, Exchange exchange) { HashMap result = new HashMap(); HeaderFilterStrategy headerFilterStrategy = this.getEndpoint().getHeaderFilterStrategy(); Iterator var5 = headers.entrySet().iterator(); while (var5.hasNext()) { Entry entry = (Entry) var5.next(); if (!headerFilterStrategy.applyFilterToCamelHeaders((String) entry.getKey(), entry.getValue(), exchange)) { Object value = entry.getValue(); MessageAttributeValue mav; if (value instanceof String) { mav = new MessageAttributeValue(); mav.setDataType("String"); mav.withStringValue((String) value); result.put(entry.getKey(), mav); } else if (value instanceof ByteBuffer) { mav = new MessageAttributeValue(); mav.setDataType("Binary"); mav.withBinaryValue((ByteBuffer) value); result.put(entry.getKey(), mav); } else { LOG.warn("Cannot put the message header key={}, value={} into Sqs MessageAttribute", entry.getKey(), entry.getValue()); } } } return result; }

Target:
private Map<String, MessageAttributeValue> translateAttributes(Map<String, Object> headers, Exchange exchange) { Map<String, MessageAttributeValue> result = new HashMap<String, MessageAttributeValue>(); HeaderFilterStrategy headerFilterStrategy = getEndpoint().getHeaderFilterStrategy(); for (Entry<String, Object> entry : headers.entrySet()) { if (!headerFilterStrategy.applyFilterToCamelHeaders(entry.getKey(), entry.getValue(), exchange)) { Object value = entry.getValue(); if (value instanceof String) { MessageAttributeValue mav = new MessageAttributeValue(); mav.setDataType("String"); mav.withStringValue((String)value); result.put(entry.getKey(), mav); } else if (value instanceof ByteBuffer) { MessageAttributeValue mav = new MessageAttributeValue(); mav.setDataType("Binary"); mav.withBinaryValue((ByteBuffer)value); result.put(entry.getKey(), mav); } else { LOG.warn("Cannot put the message header key={}, value={} into Sns MessageAttribute", entry.getKey(), entry.getValue()); } } } return result; }
Source:
public void compute(LocalDate date, U entity) throws Exception { LocalDate lowerLimit = date.minusDays(observationPeriodDays); eventRecorder.getDatabase() .createQuery("SELECT COUNT(DISTINCT eventDate) AS numberOfDays" + " FROM useractivityevent" + " WHERE userData_userId = ${userId}" + " AND eventDate > ${lowerLimit}" + " AND eventDate <= ${upperLimit}") .set("userId", entity.getUniqueName()) .set("lowerLimit", lowerLimit) .set("upperLimit", date) .first() .ifPresent(row -> { int numberOfActiveDays = row.getValue("numberOfDays").asInt(0); int activityRateInPercent = numberOfActiveDays * 100 / observationPeriodDays; metrics.updateMonthlyMetric(entity, METRIC_USER_ACTIVITY, date, activityRateInPercent); if (date.getMonthValue() == LocalDate.now().getMonthValue()) { entity.getPerformanceData() .modify() .set(getActiveUserFlag(), numberOfActiveDays >= minDaysForActiveUsers) .set(getFrequentUserFlag(), numberOfActiveDays >= minDaysForFrequentUsers) .commit(); } }); }

Target:
public void compute(LocalDate date, U entity) throws Exception { LocalDate lowerLimit = date.minusDays(observationPeriodDays); int numberOfActiveDays = eventRecorder.getDatabase() .createQuery("SELECT COUNT(DISTINCT eventDate) AS numberOfDays" + " FROM useractivityevent" + " WHERE userData_userId = ${userId}" + " AND eventDate > ${lowerLimit}" + " AND eventDate <= ${upperLimit}") .set("userId", entity.getUniqueName()) .set("lowerLimit", lowerLimit) .set("upperLimit", date) .first() .flatMap(row -> row.getValue("numberOfDays").asOptionalInt()) .orElse(0); int activityRateInPercent = numberOfActiveDays * 100 / observationPeriodDays; metrics.updateMonthlyMetric(entity, METRIC_USER_ACTIVITY, date, activityRateInPercent); if (date.getMonthValue() == LocalDate.now().getMonthValue()) { entity.getPerformanceData() .modify() .set(getActiveUserFlag(), numberOfActiveDays >= minDaysForActiveUsers) .set(getFrequentUserFlag(), numberOfActiveDays >= minDaysForFrequentUsers) .commit(); } }
Source:
public void setUp() throws IOException { Configuration config = Configuration.getInstance(); config.init(); config.setProperty(CoreConfig.ZOOKEEPER_CLUSTER, "NONE"); config.setProperty(CoreConfig.INGEST_MODE, "false"); config.setProperty(CoreConfig.ROLLUP_MODE, "false"); config.setProperty(CoreConfig.QUERY_MODE, "false"); BluefloodServiceStarter.SkipInstantiateRestartGauge = true; }

Target:
public void setUp() throws IOException { Configuration config = Configuration.getInstance(); config.init(); config.setProperty(CoreConfig.ZOOKEEPER_CLUSTER, "NONE"); config.setProperty(CoreConfig.INGEST_MODE, "false"); config.setProperty(CoreConfig.ROLLUP_MODE, "false"); config.setProperty(CoreConfig.QUERY_MODE, "false"); BluefloodServiceStarter.shouldInstantiateRestartGauge = false; }
Source:
public PlotFrame(final Composite comp, final int style) { super(comp, style, null, ChartComposite.DEFAULT_WIDTH, ChartComposite.DEFAULT_HEIGHT, 0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE, ChartComposite.DEFAULT_BUFFER_USED, true, true, true, true, true); addSWTListener(new PlotKeyListener()); addMouseWheelListener(new PlotMouseWheelListener()); addSWTListener(new PlotMouseMoveListener()); setZoomInFactor(0.75); setZoomOutFactor(1.25); toolTip = new DefaultToolTip(this, SWT.BALLOON, false); toolTip.setBackgroundColor(new Color(comp.getDisplay(), 255, 255, 255)); toolTip.setForegroundColor(new Color(comp.getDisplay(), 128, 128, 128)); toolTip.setRespectDisplayBounds(true); toolTip.setShift(new Point(0, -50)); toolTip.setHideDelay(0); toolTip.setHideOnMouseDown(false); toolTip.setPopupDelay(0); }

Target:
public PlotFrame(final Composite comp, final int style) { super(comp, style, null, ChartComposite.DEFAULT_WIDTH, ChartComposite.DEFAULT_HEIGHT, 0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE, ChartComposite.DEFAULT_BUFFER_USED, true, true, true, true, true); addSWTListener(new PlotKeyListener()); addMouseWheelListener(new PlotMouseWheelListener()); addSWTListener(new PlotMouseMoveListener()); setZoomInFactor(0.75); setZoomOutFactor(1.25); toolTip = new ExtendedToolTip(this, org.eclipse.swt.SWT.BALLOON, false); toolTip.setBackgroundColor(new Color(comp.getDisplay(), 255, 255, 255)); toolTip.setForegroundColor(new Color(comp.getDisplay(), 128, 128, 128)); toolTip.setRespectDisplayBounds(false); toolTip.setShift(new Point(0, -50)); toolTip.setHideDelay(0); toolTip.setHideOnMouseDown(false); toolTip.setPopupDelay(0); }
Source:
private static Properties stringAsProperties(String stringProperties) { if(stringProperties == null) { return null; } Properties properties = new Properties(); String[] property = stringProperties.split("'"); for(String p : property) { String[] kv = p.split(">"); if(kv.length == 1) { properties.put(kv[0], ""); } else { properties.put(kv[0], kv[1]); } } return properties; }

Target:
private static Properties stringAsProperties(String stringProperties) { if(stringProperties == null) { return null; } Properties properties = new Properties(); String[] property = stringProperties.split("<'>"); for(String p : property) { String[] kv = p.split("<>"); if(kv.length == 1) { properties.put(kv[0], ""); } else { properties.put(kv[0], kv[1]); } } return properties; }
Source:
public int compareTo(BlockLocation o) { return (new Long(offset)).compareTo(o.getOffset()); }

Target:
public int compareTo(BlockLocation o) { return ((Long) (offset)).compareTo(o.getOffset()); }
Source:
public void setupJob(JobContext context) throws IOException { if (algorithmVersion == 2) { Logger log = LoggerFactory.getLogger( "org.apache.hadoop.mapreduce.lib.output." + "FileOutputCommitter.Algorithm"); log.warn("The v2 commit algorithm is deprecated;" + " please switch to the v1 algorithm"); } if (hasOutputPath()) { Path jobAttemptPath = getJobAttemptPath(context); FileSystem fs = jobAttemptPath.getFileSystem( context.getConfiguration()); if (!fs.mkdirs(jobAttemptPath)) { LOG.error("Mkdirs failed to create " + jobAttemptPath); } } else { LOG.warn("Output Path is null in setupJob()"); } }

Target:
public void setupJob(JobContext context) throws IOException { if (algorithmVersion == 2) { Logger log = LoggerFactory.getLogger( "org.apache.hadoop.mapreduce.lib.output." + "FileOutputCommitter.Algorithm"); log.warn("The v2 commit algorithm assumes that the content of generated output files is" + " consistent across all task attempts" + " -if this is not true for this job, switch to the v1 commit algorithm." + " See MAPREDUCE-7282"); } if (hasOutputPath()) { Path jobAttemptPath = getJobAttemptPath(context); FileSystem fs = jobAttemptPath.getFileSystem( context.getConfiguration()); if (!fs.mkdirs(jobAttemptPath)) { LOG.error("Mkdirs failed to create " + jobAttemptPath); } } else { LOG.warn("Output Path is null in setupJob()"); } }
Source:
public boolean isCellEditable(int column) { return getColumnClass(column).equals(ParseTreeTableModel.class); }

Target:
public boolean isCellEditable(int column) { return false; }
Source:
public void requireSystemDuringStart() throws Exception { r.jenkins.setSecurityRealm(r.createDummySecurityRealm()); r.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy()); String pluginShortName = "require-system-during-load"; dynamicLoad(pluginShortName + ".hpi"); try (ACLContext context = ACL.as(User.getOrCreateByIdOrFullName("underprivileged").impersonate())) { r.jenkins.pluginManager.start(Collections.singletonList(r.jenkins.pluginManager.getPlugin(pluginShortName))); } }

Target:
public void requireSystemDuringStart() throws Exception { r.jenkins.setSecurityRealm(r.createDummySecurityRealm()); r.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy()); String pluginShortName = "require-system-during-load"; dynamicLoad(pluginShortName + ".hpi"); try (ACLContext context = ACL.as(User.getById("underprivileged", true).impersonate())) { r.jenkins.pluginManager.start(Collections.singletonList(r.jenkins.pluginManager.getPlugin(pluginShortName))); } }
Source:
public EditorTab(Editor editor, SketchFile file, String contents) throws IOException { super(new BorderLayout()); if (contents == null) { contents = file.load(); modified = false; } else { modified = true; } this.editor = editor; this.file = file; RSyntaxDocument document = createDocument(contents); textarea = createTextArea(document); scrollPane = createScrollPane(textarea); file.setStorage(this); applyPreferences(); add(scrollPane, BorderLayout.CENTER); textarea.setupAutoComplete(file.getSketch(), new FakeCompletionProvider()); }

Target:
public EditorTab(Editor editor, SketchFile file, String contents) throws IOException { super(new BorderLayout()); if (contents == null) { contents = file.load(); modified = false; } else { modified = true; } this.editor = editor; this.file = file; RSyntaxDocument document = createDocument(contents); textarea = createTextArea(document); scrollPane = createScrollPane(textarea); file.setStorage(this); applyPreferences(); add(scrollPane, BorderLayout.CENTER); }