auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public EmailWrapper sendConfirmationEmailForSubmission(String courseId, String feedbackSessionName, String userId, String unregisteredStudentEmail, String regKey) throws EntityDoesNotExistException { if (!isFeedbackSessionExists(feedbackSessionName, courseId)) { throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_FS_CONFIRM + courseId + "/" + feedbackSessionName); } FeedbackSessionAttributes session = getFeedbackSession(feedbackSessionName, courseId); StudentAttributes student = null; InstructorAttributes instructor = null; if (userId != null) { student = studentsLogic.getStudentForCourseIdAndGoogleId(courseId, userId); instructor = instructorsLogic.getInstructorForGoogleId(courseId, userId); } if (student == null && unregisteredStudentEmail != null) { student = new StudentAttributes(); student.email = unregisteredStudentEmail; student.name = unregisteredStudentEmail; student.key = regKey; } Assumption.assertFalse(student == null && instructor == null); try { String timestamp = TimeHelper.formatTime12H( TimeHelper.convertToUserTimeZone(Calendar.getInstance(TimeZone.getTimeZone("UTC")), session.getTimeZone()).getTime()); EmailWrapper email = instructor == null ? new EmailGenerator().generateFeedbackSubmissionConfirmationEmailForStudent(session, student, timestamp) : new EmailGenerator().generateFeedbackSubmissionConfirmationEmailForInstructor(session, instructor, timestamp); new EmailSender().sendEmail(email); return email; } catch (Exception e) { throw new RuntimeException(ERROR_SENDING_EMAILS, e); } }

Target:
public EmailWrapper sendConfirmationEmailForSubmission(String courseId, String feedbackSessionName, String userId, String unregisteredStudentEmail, String regKey) throws EntityDoesNotExistException { if (!isFeedbackSessionExists(feedbackSessionName, courseId)) { throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_FS_CONFIRM + courseId + "/" + feedbackSessionName); } FeedbackSessionAttributes session = getFeedbackSession(feedbackSessionName, courseId); StudentAttributes student = null; InstructorAttributes instructor = null; if (userId != null) { student = studentsLogic.getStudentForCourseIdAndGoogleId(courseId, userId); instructor = instructorsLogic.getInstructorForGoogleId(courseId, userId); } if (student == null && unregisteredStudentEmail != null) { student = new StudentAttributes(); student.email = unregisteredStudentEmail; student.name = unregisteredStudentEmail; student.key = regKey; } Assumption.assertFalse(student == null && instructor == null); try { Calendar timestamp = Calendar.getInstance(TimeZone.getTimeZone("UTC")); EmailWrapper email = instructor == null ? new EmailGenerator().generateFeedbackSubmissionConfirmationEmailForStudent(session, student, timestamp) : new EmailGenerator().generateFeedbackSubmissionConfirmationEmailForInstructor(session, instructor, timestamp); new EmailSender().sendEmail(email); return email; } catch (Exception e) { throw new RuntimeException(ERROR_SENDING_EMAILS, e); } }
Source:
public CachedDatastreamReader(ZkClient zkclient, String cluster) { _zkclient = zkclient; _cluster = cluster; _datastreamList = fetchAllDatastreamNamesFromZk(); String path = KeyBuilder.datastreams(_cluster); LOG.info("Subscribing to notification on zk path " + path); _zkclient.subscribeChildChanges(path, new IZkChildListener() { @Override public void handleChildChange(String parentPath, List<String> currentChildren) throws Exception { synchronized (CachedDatastreamReader.this) { LOG.info( String.format("Received datastream add or delete notification. parentPath %s, children %s", parentPath, currentChildren)); _datastreamList = currentChildren.stream().collect(Collectors.toCollection(() -> new ArrayList<>(currentChildren.size()))); List<String> datastreamsRemoved = _datastreams.keySet().stream().filter(x -> !_datastreamList.contains(x)).collect(Collectors.toList()); if (!datastreamsRemoved.isEmpty()) { LOG.info(String.format("Removing the deleted datastreams {%s} from cache", datastreamsRemoved)); datastreamsRemoved.stream().forEach(_datastreams::remove); } LOG.info(String.format("New datastream list in the cache: %s", _datastreamList)); } } }); }

Target:
public CachedDatastreamReader(ZkClient zkclient, String cluster) { _zkclient = zkclient; _cluster = cluster; _datastreamList = fetchAllDatastreamNamesFromZk(); String path = KeyBuilder.datastreams(_cluster); LOG.info("Subscribing to notification on zk path " + path); _zkclient.subscribeChildChanges(path, new IZkChildListener() { @Override public void handleChildChange(String parentPath, List<String> currentChildren) throws Exception { synchronized (CachedDatastreamReader.this) { LOG.debug( String.format("Received datastream add or delete notification. parentPath %s, children %s", parentPath, currentChildren)); _datastreamList = currentChildren.stream().collect(Collectors.toCollection(() -> new ArrayList<>(currentChildren.size()))); List<String> datastreamsRemoved = _datastreams.keySet().stream().filter(x -> !_datastreamList.contains(x)).collect(Collectors.toList()); if (!datastreamsRemoved.isEmpty()) { LOG.info(String.format("Removing the deleted datastreams {%s} from cache", datastreamsRemoved)); datastreamsRemoved.stream().forEach(_datastreams::remove); } LOG.debug(String.format("New datastream list in the cache: %s", _datastreamList)); } } }); }
Source:
public static <T> GenericIndexed<T> fromIterable(Iterable<T> objectsIterable, ObjectStrategy<T> strategy) { Iterator<T> objects = objectsIterable.iterator(); if (!objects.hasNext()) { final ByteBuffer buffer = ByteBuffer.allocate(4).putInt(0); buffer.flip(); return new GenericIndexed<T>(buffer, strategy, true); } boolean allowReverseLookup = true; int count = 0; ByteArrayOutputStream headerBytes = new ByteArrayOutputStream(); ByteArrayOutputStream valueBytes = new ByteArrayOutputStream(); try { headerBytes.write(Ints.toByteArray(0)); int offset = 0; T prevVal = null; do { count++; T next = objects.next(); if (allowReverseLookup && prevVal != null && !(strategy.compare(prevVal, next) < 0)) { allowReverseLookup = false; } final byte[] bytes = strategy.toBytes(next); offset += 4 + bytes.length; headerBytes.write(Ints.toByteArray(offset)); valueBytes.write(Ints.toByteArray(bytes.length)); valueBytes.write(bytes); if (prevVal instanceof Closeable) { CloseQuietly.close((Closeable) prevVal); } prevVal = next; } while (objects.hasNext()); if (prevVal instanceof Closeable) { CloseQuietly.close((Closeable) prevVal); } } catch (IOException e) { throw new RuntimeException(e); } byte[] header = headerBytes.toByteArray(); byte[] values = valueBytes.toByteArray(); System.arraycopy(Ints.toByteArray(count), 0, header, 0, 4); ByteBuffer theBuffer = ByteBuffer.allocate(header.length + values.length); theBuffer.put(header); theBuffer.put(values); theBuffer.flip(); return new GenericIndexed<T>(theBuffer.asReadOnlyBuffer(), strategy, allowReverseLookup); }

Target:
public static <T> GenericIndexed<T> fromIterable(Iterable<T> objectsIterable, ObjectStrategy<T> strategy) { Iterator<T> objects = objectsIterable.iterator(); if (!objects.hasNext()) { final ByteBuffer buffer = ByteBuffer.allocate(4).putInt(0); buffer.flip(); return new GenericIndexed<T>(buffer, strategy, true); } boolean allowReverseLookup = true; int count = 0; ByteArrayOutputStream headerBytes = new ByteArrayOutputStream(); ByteArrayOutputStream valueBytes = new ByteArrayOutputStream(); try { int offset = 0; T prevVal = null; do { count++; T next = objects.next(); if (allowReverseLookup && prevVal != null && !(strategy.compare(prevVal, next) < 0)) { allowReverseLookup = false; } final byte[] bytes = strategy.toBytes(next); offset += 4 + bytes.length; headerBytes.write(Ints.toByteArray(offset)); valueBytes.write(Ints.toByteArray(bytes.length)); valueBytes.write(bytes); if (prevVal instanceof Closeable) { CloseQuietly.close((Closeable) prevVal); } prevVal = next; } while (objects.hasNext()); if (prevVal instanceof Closeable) { CloseQuietly.close((Closeable) prevVal); } } catch (IOException e) { throw new RuntimeException(e); } ByteBuffer theBuffer = ByteBuffer.allocate(Ints.BYTES + headerBytes.size() + valueBytes.size()); theBuffer.put(Ints.toByteArray(count)); theBuffer.put(headerBytes.toByteArray()); theBuffer.put(valueBytes.toByteArray()); theBuffer.flip(); return new GenericIndexed<T>(theBuffer.asReadOnlyBuffer(), strategy, allowReverseLookup); }
Source:
public boolean containsAnyScope(List<String> scope) { for (String s : scope) { if (getScope().contains(s)) { return true; } } return false; }

Target:
public boolean containsAnyScope(List<String> scope) { for (String s : scope) { for (String s2 : getScopes()) { if (s.equalsIgnoreCase(s2)) { return true; } } } return false; }
Source:
public void fault( long pageRef, PageSwapper swapper, int swapperId, long filePageId, PageFaultEvent event ) throws IOException { if ( swapper == null ) { throw new IllegalArgumentException( "swapper cannot be null" ); } int currentSwapper = getSwapperId( pageRef ); long currentFilePageId = getFilePageId( pageRef ); if ( filePageId == PageCursor.UNBOUND_PAGE_ID || !isExclusivelyLocked( pageRef ) || currentSwapper != 0 || currentFilePageId != PageCursor.UNBOUND_PAGE_ID ) { throw cannotFaultException( pageRef, swapper, swapperId, filePageId, currentSwapper, currentFilePageId ); } setFilePageId( pageRef, filePageId ); PageObj page = new PageObj( cachePageSize, address( pageRef ) ); long bytesRead = swapper.read( filePageId, page ); event.addBytesRead( bytesRead ); event.setCachePageId( (int) pageRef ); setSwapperId( pageRef, swapperId ); }

Target:
public void fault( long pageRef, PageSwapper swapper, int swapperId, long filePageId, PageFaultEvent event ) throws IOException { if ( swapper == null ) { throw swapperCannotBeNull(); } int currentSwapper = getSwapperId( pageRef ); long currentFilePageId = getFilePageId( pageRef ); if ( filePageId == PageCursor.UNBOUND_PAGE_ID || !isExclusivelyLocked( pageRef ) || currentSwapper != 0 || currentFilePageId != PageCursor.UNBOUND_PAGE_ID ) { throw cannotFaultException( pageRef, swapper, swapperId, filePageId, currentSwapper, currentFilePageId ); } setFilePageId( pageRef, filePageId ); long bytesRead = swapper.read( filePageId, getAddress( pageRef ), cachePageSize ); event.addBytesRead( bytesRead ); event.setCachePageId( toId( pageRef ) ); setSwapperId( pageRef, swapperId ); }
Source:
private void getJavaMethods (ArrayList<JavaMethod> methods, TypeDeclaration<?> type) { classStack.push(type); if (type.getMembers() != null) { for (BodyDeclaration<?> member : type.getMembers()) { if (member.isClassOrInterfaceDeclaration() || member.isEnumDeclaration()) { getJavaMethods(methods, (TypeDeclaration)member); } else { if (member instanceof MethodDeclaration) { MethodDeclaration method = (MethodDeclaration)member; if(method.isNative()) continue; methods.add(createMethod(method)); } } } } classStack.pop(); }

Target:
private void getJavaMethods (ArrayList<JavaMethod> methods, TypeDeclaration<?> type) { classStack.push(type); if (type.getMembers() != null) { for (BodyDeclaration<?> member : type.getMembers()) { if (member.isClassOrInterfaceDeclaration() || member.isEnumDeclaration()) { getJavaMethods(methods, (TypeDeclaration)member); } else { if (member instanceof MethodDeclaration) { MethodDeclaration method = (MethodDeclaration)member; if(!method.isNative()) continue; methods.add(createMethod(method)); } } } } classStack.pop(); }
Source:
public void run() { try { returnSize = min(returnSize, dao.pollNextWorkflowInstanceIds(batchSize).size()); } catch (PollingBatchException ex) { ex.printStackTrace(); returnSize = 0; detectedRaceCondition = ex.getMessage().startsWith("Race condition"); } }

Target:
public void run() { try { returnSize = min(returnSize, dao.pollNextWorkflowInstanceIds(batchSize).size()); } catch (PollingRaceConditionException ex) { ex.printStackTrace(); returnSize = 0; detectedRaceCondition = true; } }
Source:
private void deleteTempFile(File file) { notNull(file, "file"); if (!file.delete()) { throw new GoodDataException("Unable to delete temporary file " + file.getAbsolutePath()); } }

Target:
private void deleteTempFile(File file) { notNull(file, "file"); file.delete(); }
Source:
public void onRemovePassenger(net.minecraft.entity.Entity passenger, CallbackInfo ci) { if (!this.worldObj.isRemote) { DismountEntityEvent event = SpongeEventFactory.createDismountEntityEvent(Cause.of(NamedCause.source(passenger)), this); SpongeImpl.postEvent(event); } }

Target:
public void onRemovePassenger(net.minecraft.entity.Entity passenger, CallbackInfo ci) { if (!this.worldObj.isRemote && ShouldFire.DISMOUNT_ENTITY_EVENT) { SpongeImpl.postEvent(SpongeEventFactory.createDismountEntityEvent(Cause.of(NamedCause.source(passenger)), this)); } }
Source:
public CommandCallback getCallback() { VDS vds = getVds(); if (vds.getClusterSupportsGlusterService() && getParameters().getIsStopGlusterProcesses()) { return new HostMaintenanceCallback(); } else { return super.getCallback(); } }

Target:
public CommandCallback getCallback() { VDS host = getVds(); if (host.getClusterSupportsGlusterService() && getParameters().isStopGlusterService()) { return new HostMaintenanceCallback(); } else { return super.getCallback(); } }
Source:
private void clearUi() { title.setVisibility(View.INVISIBLE); instr.setVisibility(View.INVISIBLE); passcodeField.setVisibility(View.INVISIBLE); passcodeBox.setVisibility(View.INVISIBLE); logoutButton.setVisibility(View.INVISIBLE); verifyButton.setVisibility(View.INVISIBLE); bioInstrTitle.setVisibility(View.INVISIBLE); bioInstr.setVisibility(View.INVISIBLE); notNowButton.setVisibility(View.INVISIBLE); enableButton.setVisibility(View.INVISIBLE); biometricBox.setVisibility(View.INVISIBLE); fingerImage.setVisibility(View.INVISIBLE); }

Target:
private void clearUi() { title.setVisibility(View.GONE); instr.setVisibility(View.GONE); passcodeField.setVisibility(View.GONE); passcodeBox.setVisibility(View.GONE); logoutButton.setVisibility(View.GONE); verifyButton.setVisibility(View.GONE); bioInstrTitle.setVisibility(View.GONE); bioInstr.setVisibility(View.GONE); notNowButton.setVisibility(View.GONE); enableButton.setVisibility(View.GONE); biometricBox.setVisibility(View.GONE); fingerImage.setVisibility(View.GONE); }
Source:
public void asyncRealmObjectShouldNotBlockBackgroundCommitNotification() { final AtomicInteger numberOfRealmCallbackInvocation = new AtomicInteger(0); final CountDownLatch signalClosedRealm = new CountDownLatch(1); final Realm realm = looperThread.realm; realm.addChangeListener(new RealmChangeListener<Realm>() { @Override public void onChange(Realm object) { switch (numberOfRealmCallbackInvocation.incrementAndGet()) { case 1: { Dog dog = realm.where(Dog.class).findFirstAsync(); assertTrue(dog.load()); dog.addChangeListener(new RealmChangeListener<Dog>() { @Override public void onChange(Dog dog) { } }); new Thread() { @Override public void run() { Realm realm = Realm.getInstance(looperThread.realmConfiguration); realm.beginTransaction(); realm.createObject(Dog.class); realm.commitTransaction(); realm.close(); signalClosedRealm.countDown(); } }.start(); break; } case 2: { TestHelper.awaitOrFail(signalClosedRealm); looperThread.testComplete(); break; } } } }); looperThread.postRunnable(new Runnable() { @Override public void run() { realm.beginTransaction(); realm.createObject(Dog.class); realm.commitTransaction(); } }); }

Target:
public void asyncRealmObjectShouldNotBlockBackgroundCommitNotification() { final AtomicInteger numberOfRealmCallbackInvocation = new AtomicInteger(0); final CountDownLatch signalClosedRealm = new CountDownLatch(1); final Realm realm = looperThread.realm; realm.addChangeListener(new RealmChangeListener<Realm>() { @Override public void onChange(Realm realm) { switch (numberOfRealmCallbackInvocation.incrementAndGet()) { case 1: { Dog dog = realm.where(Dog.class).findFirstAsync(); assertTrue(dog.load()); dog.addChangeListener(new RealmChangeListener<Dog>() { @Override public void onChange(Dog dog) { } }); new Thread() { @Override public void run() { Realm realm = Realm.getInstance(looperThread.realmConfiguration); realm.beginTransaction(); realm.createObject(Dog.class); realm.commitTransaction(); realm.close(); signalClosedRealm.countDown(); } }.start(); break; } case 2: { TestHelper.awaitOrFail(signalClosedRealm); looperThread.testComplete(); break; } } } }); looperThread.postRunnable(new Runnable() { @Override public void run() { realm.beginTransaction(); realm.createObject(Dog.class); realm.commitTransaction(); } }); }
Source:
private static boolean isHtml(String str) { final String HTML_TAG_PATTERN = "<(\"[^\"]*\"|'[^']*'|[^'\">])*>"; Pattern htmlValidator = TextUtils.isEmpty(HTML_TAG_PATTERN) ? null : Pattern.compile(HTML_TAG_PATTERN); boolean isHtml = htmlValidator.matcher(str).find(); return isHtml; }

Target:
private static boolean isHtml(String str) { final String HTML_TAG_PATTERN = "<(\"[^\"]*\"|'[^']*'|[^'\">])*>"; Pattern htmlValidator = TextUtils.isEmpty(HTML_TAG_PATTERN) ? null : Pattern.compile(HTML_TAG_PATTERN); return htmlValidator.matcher(str).find(); }
Source:
public void isValidShouldBeValidWithExactMinPasswordLength() { PasswordChangeDTO passwordChangeDtoExactMinLength = PasswordChangeDTO.builder() .newPassword(PASSWORD_WITH_LENGTH_EQUAL_TO_MIN) .build(); boolean result = rule.isValid(passwordChangeDtoExactMinLength); assertThat(result, notNullValue()); assertTrue(result); }

Target:
public void isValidShouldBeValidWithExactMinPasswordLength() { PasswordChangeDTO passwordChangeDtoExactMinLength = PasswordChangeDTO.builder() .newPassword(PASSWORD_WITH_LENGTH_EQUAL_TO_MIN) .build(); boolean result = rule.isValid(passwordChangeDtoExactMinLength); assertTrue(result); }
Source:
public void testDeleteActionForInstructorAsFeedbackParticipant() { prepareTestData(); FeedbackResponseCommentAttributes feedbackResponseComment = getCommentFromInstructor1(); assertNotNull("response comment not found", feedbackResponseComment); InstructorAttributes instructor = dataBundle.instructors.get("instructor1InCourse1"); gaeSimulation.loginAsInstructor(instructor.googleId); ______TS("Typical successful case when feedback participant is an instructor"); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, feedbackResponseComment.courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackResponseComment.feedbackSessionName, Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponseComment.feedbackResponseId, Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID, feedbackResponseComment.getId().toString(), Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT, feedbackResponseComment.commentText + " (Edited)", }; FeedbackParticipantFeedbackResponseCommentDeleteAction action = getAction(submissionParams); AjaxResult result = getAjaxResult(action); FeedbackResponseCommentAjaxPageData data = (FeedbackResponseCommentAjaxPageData) result.data; assertFalse(data.isError); FeedbackResponseCommentsDb feedbackResponseCommentsDb = new FeedbackResponseCommentsDb(); assertNull(feedbackResponseCommentsDb.getFeedbackResponseComment(feedbackResponseComment.feedbackResponseId, feedbackResponseComment.commentGiver, feedbackResponseComment.createdAt)); assertEquals("", result.getStatusMessage()); }

Target:
public void testDeleteActionForInstructorAsFeedbackParticipant() { FeedbackResponseCommentAttributes feedbackResponseComment = getCommentFromInstructor1AsFeedbackParticipant(); assertNotNull("response comment not found", feedbackResponseComment); InstructorAttributes instructor = dataBundle.instructors.get("instructor1InCourse1"); gaeSimulation.loginAsInstructor(instructor.googleId); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, feedbackResponseComment.courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackResponseComment.feedbackSessionName, Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponseComment.feedbackResponseId, Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID, feedbackResponseComment.getId().toString(), }; FeedbackParticipantFeedbackResponseCommentDeleteAction action = getAction(submissionParams); AjaxResult result = getAjaxResult(action); FeedbackResponseCommentAjaxPageData data = (FeedbackResponseCommentAjaxPageData) result.data; assertFalse(data.isError); FeedbackResponseCommentsDb feedbackResponseCommentsDb = new FeedbackResponseCommentsDb(); assertNull(feedbackResponseCommentsDb.getFeedbackResponseComment(feedbackResponseComment.feedbackResponseId, feedbackResponseComment.commentGiver, feedbackResponseComment.createdAt)); assertEquals("", result.getStatusMessage()); }
Source:
public static String toUtcFormat(double hourOffsetTimeZone) { StringBuilder utcFormatTimeZone = new StringBuilder(); utcFormatTimeZone.append("UTC"); if (hourOffsetTimeZone != 0) { if ((int) hourOffsetTimeZone == hourOffsetTimeZone) { utcFormatTimeZone.append(String.format(" %+03d:00", (int) hourOffsetTimeZone)); } else { utcFormatTimeZone.append(String.format( " %+03d:%02d", (int) hourOffsetTimeZone, (int) (Math.abs(hourOffsetTimeZone - (int) hourOffsetTimeZone) * 300 / 5))); } } return utcFormatTimeZone.toString(); }

Target:
public static String toUtcFormat(double hourOffsetTimeZone) { String utcFormatTimeZone = "UTC"; if (hourOffsetTimeZone != 0) { if ((int) hourOffsetTimeZone == hourOffsetTimeZone) { return utcFormatTimeZone + String.format(" %+03d:00", (int) hourOffsetTimeZone); } else { return utcFormatTimeZone + String.format( " %+03d:%02d", (int) hourOffsetTimeZone, (int) (Math.abs(hourOffsetTimeZone - (int) hourOffsetTimeZone) * 300 / 5)); } } return utcFormatTimeZone; }
Source:
protected CoreEvent processFlow(CoreEvent event) throws Exception { setMuleContextIfNeeded(flow, muleContext); switch (mode) { case FLOW: return flow.process(event); case SOURCE: try { return just(event) .doOnNext(innerEvent -> flow.checkBackpressure(innerEvent)) .onErrorMap(FlowBackPressureException.class, backpressureException -> { try { return new MessagingException(newEvent(), backpressureException); } catch (MuleException e) { throw propagate(e); } }) .transform(triggerableMessageSource.getListener()) .block(); } catch (Throwable throwable) { throw rxExceptionToMuleException(throwable); } default: return null; } }

Target:
protected CoreEvent processFlow(CoreEvent event) throws Exception { setMuleContextIfNeeded(flow, muleContext); switch (mode) { case FLOW: return flow.process(event); case SOURCE: try { return just(event) .doOnNext(flow::checkBackpressure) .onErrorMap(FlowBackPressureException.class, backPressureExceptionMapper()) .transform(triggerableMessageSource.getListener()) .block(); } catch (Throwable throwable) { throw rxExceptionToMuleException(throwable); } default: return null; } }
Source:
private boolean canInvestNewbieLoan(String loginName) { if (newbieInvestLimit == 0) { return true; } int newbieInvestCount = investMapper.sumSuccessNewbieInvestCountByLoginName(loginName); return (newbieInvestCount < newbieInvestLimit); }

Target:
private boolean canInvestNewbieLoan(String loginName) { int newbieInvestCount = investMapper.sumSuccessInvestCountByLoginName(loginName); return newbieInvestLimit == 0 || newbieInvestCount < newbieInvestLimit; }
Source:
public void updateBridgeFirmware() { RestTemplate rt = new RestTemplate(); String bridgeConfigUrl = buildBridgeHttpAddress() + "config"; HueSWUpdate swUpdate = rt.getForEntity(bridgeConfigUrl, HueConfig.class).getBody().getSWUpdate(); if (swUpdate.isNotify()) { log.info("Bridge update completed"); rt.put(bridgeConfigUrl, "{\"swupdate\": {\"notify\":false}}"); } else if (swUpdate.getUpdatestate() == 0) { log.info("Initiating bridge update check"); rt.put(bridgeConfigUrl, "{\"swupdate\": {\"checkforupdate\":true}}"); } if (swUpdate.getUpdatestate() == 2) { log.info("Installing bridge update: {}", swUpdate.getText()); rt.put(bridgeConfigUrl, "{\"swupdate\": {\"updatestate\":3}}"); } }

Target:
public void updateBridgeFirmware() { RestTemplate rt = new RestTemplate(); String bridgeConfigUrl = buildBridgeHttpAddress() + "config"; HueSWUpdate swUpdate = rt.getForEntity(bridgeConfigUrl, HueConfig.class).getBody().getSWUpdate(); if (swUpdate.isNotify()) { log.info("Bridge update completed"); rt.put(bridgeConfigUrl, "{\"swupdate\": {\"notify\":false}}"); } else if (swUpdate.getUpdatestate() == 0) { log.info("Initiating bridge update check"); rt.put(bridgeConfigUrl, "{\"swupdate\": {\"checkforupdate\":true}}"); } else if (swUpdate.getUpdatestate() == 2) { log.info("Installing bridge update: {}", swUpdate.getText()); rt.put(bridgeConfigUrl, "{\"swupdate\": {\"updatestate\":3}}"); } }
Source:
public String showExperimentPage(Model model, @PathVariable String experimentAccession, @RequestParam(defaultValue = "") String accessKey) { Experiment<Cell> experiment = experimentTrader.getExperiment(experimentAccession, accessKey); model.addAllAttributes(experimentAttributesService.getAttributes(experiment)); model.addAttribute("content", GSON.toJson(experimentPageContentForExperiment(experiment, accessKey))); model.addAttribute("numberOfCells", tSnePlotServiceDao.fetchCellNumberByExperimentAccession(experimentAccession)); return "experiment-page"; }

Target:
public String showExperimentPage(Model model, @PathVariable String experimentAccession, @RequestParam(defaultValue = "") String accessKey) { Experiment<Cell> experiment = experimentTrader.getExperiment(experimentAccession, accessKey); model.addAllAttributes(experimentAttributesService.getAttributes(experiment)); model.addAttribute("content", GSON.toJson(experimentPageContentForExperiment(experiment, accessKey))); model.addAttribute("numberOfCells", tSnePlotServiceDao.fetchNumberOfCellsByExperimentAccession(experimentAccession)); return "experiment-page"; }
Source:
public void onSessionExecuted(String sessionId, String sessionComment, SessionExecutionStatus status) { log.debug("onSessionExecuted invoked"); Namespace namespace = Namespace.of(sessionId,SESSION); Multimap<String, Object> all = keyValueStorage.fetchAll(namespace); SessionData sessionData = new SessionData(); sessionData.setSessionId(sessionId); sessionData.setComment(sessionComment); Long startTime = (Long) getFirst(all, START_TIME); sessionData.setStartTime(new Date(startTime)); Long endTime = (Long) getFirst(all, END_TIME); sessionData.setEndTime(new Date(endTime)); Integer taskExecuted = (Integer) getFirst(all, TASK_EXECUTED); sessionData.setTaskExecuted(taskExecuted); Integer tasksFailed = (Integer) getFirst(all, FAILED); sessionData.setTaskFailed(tasksFailed); Integer activeKernels = (Integer) getFirst(all, KERNELS_COUNT); sessionData.setActiveKernels(activeKernels); String errorMessage = (String) getFirst(all, ERROR_MESSAGE); sessionData.setErrorMessage(errorMessage); getHibernateTemplate().persist(sessionData); persistTags(sessionId, sessionMetaDataStorage); }

Target:
public void onSessionExecuted(String sessionId, String sessionComment, SessionExecutionStatus status) { log.debug("onSessionExecuted invoked"); Namespace namespace = Namespace.of(SESSION, sessionId); Multimap<String, Object> all = keyValueStorage.fetchAll(namespace); SessionData sessionData = new SessionData(); sessionData.setSessionId(sessionId); sessionData.setComment(sessionComment); Long startTime = (Long) getFirst(all, START_TIME); sessionData.setStartTime(new Date(startTime)); Long endTime = (Long) getFirst(all, END_TIME); sessionData.setEndTime(new Date(endTime)); Integer taskExecuted = (Integer) getFirst(all, TASK_EXECUTED); sessionData.setTaskExecuted(taskExecuted); Integer tasksFailed = (Integer) getFirst(all, FAILED); sessionData.setTaskFailed(tasksFailed); Integer activeKernels = (Integer) getFirst(all, KERNELS_COUNT); sessionData.setActiveKernels(activeKernels); String errorMessage = (String) getFirst(all, ERROR_MESSAGE); sessionData.setErrorMessage(errorMessage); getHibernateTemplate().persist(sessionData); persistTags(sessionId, sessionMetaDataStorage); }
Source:
public byte[] getClassDefinition() { mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(4, 0); mv.visitEnd(); cw.visitEnd(); return cw.toByteArray(); }

Target:
byte[] getClassDefinition() { cw.visitEnd(); final byte[] result = cw.toByteArray(); newCompanion(); return result; }
Source:
ExecutionContext<T> getChildContext(Object obj) { if (subContexts == null) { return null; } ChildContext<T> subContext = subContexts.get(obj); if (subContext == null) { subContext = new ChildContext<T>(this); } ChildContext<T> old = subContexts.putIfAbsent(obj, subContext); if (old != null) { return old; } else { return subContext; } }

Target:
ExecutionContext<T> getChildContext(Object obj) { if (subContexts == null) { return null; } ChildContext<T> subContext = subContexts.get(obj); if (subContext == null) { subContext = new ChildContext<T>(this); ChildContext<T> old = subContexts.putIfAbsent(obj, subContext); if (old != null) { subContext = old; } } return subContext; }
Source:
protected String getCollectionString(String jsonString, boolean isList) { try { JSONValue jsonValue = JSONParser.parseStrict(jsonString); if (jsonValue instanceof JSONString) { String label = isList ? "List() " : "Map() "; return label + ConstantHolder.EXPRESSION; } String toFormat = isList ? "List(%s)" : "Map(%s)"; int size = -1; if (isList) { size = jsonValue.isArray().size(); } else { size = jsonValue.isObject().keySet().size(); } return toFormat.replace("%s", String.valueOf(size)); } catch (Exception e) { return jsonString; } }

Target:
protected String getCollectionString(String jsonString, boolean isList) { try { JSONValue jsonValue = JSONParser.parseStrict(jsonString); if (jsonValue instanceof JSONString) { return isList ? "List()" : "Map()"; } else { String toFormat = isList ? "List(%s)" : "Map(%s)"; int size = -1; if (isList) { size = jsonValue.isArray().size(); } else { size = jsonValue.isObject().keySet().size(); } return toFormat.replace("%s", String.valueOf(size)); } } catch (Exception e) { return jsonString; } }
Source:
public void testResourceSubset() throws InterruptedException { String testDB = "resource-testDB"; _setupTool.addResourceToCluster(_clusterName, testDB, 1, BuiltInStateModelDefinitions.MasterSlave.name(), RebalanceMode.SEMI_AUTO.toString()); IdealState idealState = _admin.getResourceIdealState(_clusterName, testDB); idealState.setReplicas(Integer.toString(2)); idealState.getRecord().setListField(testDB + "_0", Arrays.asList(_participants[1].getInstanceName(), _participants[2].getInstanceName())); _admin.setResourceIdealState(_clusterName, testDB, idealState); _admin.enableInstance(_clusterName, "localhost_12918", false); ZkHelixClusterVerifier verifier = new BestPossibleExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient) .setResources(Sets.newHashSet(testDB)).build(); Assert.assertTrue(verifier.verifyByPolling()); _admin.enableCluster(_clusterName, false); _admin.enableInstance(_clusterName, "localhost_12918", true); verifier = new StrictMatchExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient) .setResources(Sets.newHashSet(testDB)).build(); Assert.assertTrue(verifier.verifyByPolling()); verifier = new BestPossibleExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient).build(); Assert.assertFalse(verifier.verify(3000)); verifier = new StrictMatchExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient).build(); Assert.assertFalse(verifier.verify(3000)); _admin.enableCluster(_clusterName, true); }

Target:
public void testResourceSubset() throws InterruptedException { String testDB = "resource-testDB"; _setupTool.addResourceToCluster(_clusterName, testDB, 1, BuiltInStateModelDefinitions.MasterSlave.name(), RebalanceMode.SEMI_AUTO.toString()); IdealState idealState = _admin.getResourceIdealState(_clusterName, testDB); idealState.setReplicas(Integer.toString(2)); idealState.getRecord().setListField(testDB + "_0", Arrays.asList(_participants[1].getInstanceName(), _participants[2].getInstanceName())); _admin.setResourceIdealState(_clusterName, testDB, idealState); _admin.enableInstance(_clusterName, "localhost_12918", false); ZkHelixClusterVerifier verifier = new BestPossibleExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient) .setResources(Sets.newHashSet(testDB)).build(); Assert.assertTrue(verifier.verifyByPolling()); _admin.enableCluster(_clusterName, false); _admin.enableInstance(_clusterName, "localhost_12918", true); verifier = new BestPossibleExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient) .setResources(Sets.newHashSet(testDB)).build(); Assert.assertTrue(verifier.verifyByPolling()); verifier = new StrictMatchExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient) .setResources(Sets.newHashSet(testDB)).build(); Assert.assertTrue(verifier.verifyByPolling()); verifier = new BestPossibleExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient).build(); Assert.assertFalse(verifier.verify(3000)); verifier = new StrictMatchExternalViewVerifier.Builder(_clusterName).setZkClient(_gZkClient).build(); Assert.assertFalse(verifier.verify(3000)); _admin.enableCluster(_clusterName, true); }
Source:
public Job mapRow(ResultSet rs, int rowNum) throws SQLException { Job job = new Job(); job.setId(Guid.createGuidFromString(rs.getString("job_id"))); job.setActionType(VdcActionType.valueOf(rs.getString("action_type"))); job.setDescription(rs.getString("description")); job.setStatus(JobExecutionStatus.valueOf(rs.getString("status"))); job.setOwnerId(NGuid.createGuidFromString(rs.getString("owner_id"))); job.setVisible(rs.getBoolean("visible")); job.setStartTime(DbFacadeUtils.fromDate(rs.getTimestamp("start_time"))); job.setEndTime(DbFacadeUtils.fromDate(rs.getTimestamp("end_time"))); job.setLastUpdateTime(DbFacadeUtils.fromDate(rs.getTimestamp("last_update_time"))); job.setCorrelationId(rs.getString("correlation_id")); job.setExternal(rs.getBoolean("is_external")); job.setExternal(rs.getBoolean("is_auto_cleared")); return job; }

Target:
public Job mapRow(ResultSet rs, int rowNum) throws SQLException { Job job = new Job(); job.setId(Guid.createGuidFromString(rs.getString("job_id"))); job.setActionType(VdcActionType.valueOf(rs.getString("action_type"))); job.setDescription(rs.getString("description")); job.setStatus(JobExecutionStatus.valueOf(rs.getString("status"))); job.setOwnerId(NGuid.createGuidFromString(rs.getString("owner_id"))); job.setVisible(rs.getBoolean("visible")); job.setStartTime(DbFacadeUtils.fromDate(rs.getTimestamp("start_time"))); job.setEndTime(DbFacadeUtils.fromDate(rs.getTimestamp("end_time"))); job.setLastUpdateTime(DbFacadeUtils.fromDate(rs.getTimestamp("last_update_time"))); job.setCorrelationId(rs.getString("correlation_id")); job.setExternal(rs.getBoolean("is_external")); job.setAutoCleared(rs.getBoolean("is_auto_cleared")); return job; }
Source:
public static Map<String, String> getUserClaimValues(String username, String[] requestedClaims, String profile) throws IdentityException { try { username = MultitenantUtils.getTenantAwareUsername(username); UserRealm userRealm = AnonymousSessionUtil.getRealmByUserName(SAMLSSOUtil.getRegistryService(), SAMLSSOUtil.getRealmService(), username); if(userRealm == null){ throw new IdentityException("User realm is not present for this user name:" + username); } UserStoreManager userStoreManager = userRealm.getUserStoreManager(); return userStoreManager.getUserClaimValues(username, requestedClaims, profile); } catch (UserStoreException e) { log.error("Error while retrieving claims values", e); throw new IdentityException( "Error while retrieving claims values", e); } catch (CarbonException e) { log.error("Error while retrieving claims values", e); throw new IdentityException( "Error while retrieving claim values", e); } }

Target:
public static Map<String, String> getUserClaimValues(String username, String[] requestedClaims, String profile) throws IdentityException { try { UserRealm userRealm = AnonymousSessionUtil.getRealmByUserName(SAMLSSOUtil.getRegistryService(), SAMLSSOUtil.getRealmService(), username); if(userRealm == null){ throw new IdentityException("User realm is not present for this user name:" + username); } username = MultitenantUtils.getTenantAwareUsername(username); UserStoreManager userStoreManager = userRealm.getUserStoreManager(); return userStoreManager.getUserClaimValues(username, requestedClaims, profile); } catch (UserStoreException e) { log.error("Error while retrieving claims values", e); throw new IdentityException( "Error while retrieving claims values", e); } catch (CarbonException e) { log.error("Error while retrieving claims values", e); throw new IdentityException( "Error while retrieving claim values", e); } }
Source:
private void diffReplace(Edit r) { Edit lcs = new HistogramDiffIndex<S>(maxChainLength, cmp, a, b, r) .findLongestCommonSequence(); if (lcs != null) { if (lcs.isEmpty()) { edits.add(r); } else { diff(r.before(lcs)); diff(r.after(lcs)); queue.addAll(0, tmp); } } else if (fallback instanceof LowLevelDiffAlgorithm) { LowLevelDiffAlgorithm fb = (LowLevelDiffAlgorithm) fallback; fb.diffNonCommon(edits, cmp, a, b, r); } else if (fallback != null) { SubsequenceComparator<HashedSequence<S>> cs = subcmp(); Subsequence<HashedSequence<S>> as = Subsequence.a(a, r); Subsequence<HashedSequence<S>> bs = Subsequence.b(b, r); EditList res = fallback.diffNonCommon(cs, as, bs); edits.addAll(Subsequence.toBase(res, as, bs)); } else { edits.add(r); } }

Target:
private void diffReplace(Edit r) { Edit lcs = new HistogramDiffIndex<S>(maxChainLength, cmp, a, b, r) .findLongestCommonSequence(); if (lcs != null) { if (lcs.isEmpty()) { edits.add(r); } else { diff(r.before(lcs)); diff(r.after(lcs)); queue.addAll(0, tmp); tmp.clear(); } } else if (fallback instanceof LowLevelDiffAlgorithm) { LowLevelDiffAlgorithm fb = (LowLevelDiffAlgorithm) fallback; fb.diffNonCommon(edits, cmp, a, b, r); } else if (fallback != null) { SubsequenceComparator<HashedSequence<S>> cs = subcmp(); Subsequence<HashedSequence<S>> as = Subsequence.a(a, r); Subsequence<HashedSequence<S>> bs = Subsequence.b(b, r); EditList res = fallback.diffNonCommon(cs, as, bs); edits.addAll(Subsequence.toBase(res, as, bs)); } else { edits.add(r); } }
Source:
void addDefinition(SerializationDefinition definition) { serializerDefinitions.add(definition); }

Target:
public void addDefinition(SerializationDefinition definition) { serializerDefinitions.add(definition); }
Source:
protected Object doInBackground() throws Exception { Timer updateViewTime = new Timer(DELAY_DRAWING, this); try { beginDrawing = System.currentTimeMillis(); renderer = new ImageRenderer(); renderer.setRsProvider(resultSetProviderFactory); updateViewTime.start(); rendererImage = mapControl.getMapTransform().getImage(); renderer.draw(mapControl.getMapTransform(), mapContext.getLayerModel(), this.getProgressMonitor()); double renderingTime = (System.currentTimeMillis() - beginDrawing) / 1000.0; if(renderingTime >= 1) { LOGGER.debug(I18N.tr("Rendering done in {0} seconds", renderingTime)); } } catch (Exception ex) { LOGGER.error(ex.getLocalizedMessage(), ex); } finally { mapControl.getMapTransform().setImage(rendererImage); intermediateDrawing.set(false); awaitingDrawing.set(false); updateViewTime.stop(); mapControl.repaint(); } return null; }

Target:
protected Object doInBackground() throws Exception { Timer updateViewTime = new Timer(DELAY_DRAWING, this); try { beginDrawing = System.currentTimeMillis(); renderer = new ImageRenderer(); renderer.setRsProvider(resultSetProviderFactory); updateViewTime.start(); rendererImage = mapControl.getMapTransform().getImage(); renderer.draw(mapControl.getMapTransform(), mapContext.getLayerModel(), this.getProgressMonitor()); double renderingTime = (System.currentTimeMillis() - beginDrawing) / 1000.0; if(renderingTime >= Double.valueOf(System.getProperty("map.editor.renderingtimemin", DEFAULT_LOG_RENDERING_TIME_MIN))) { LOGGER.debug(I18N.tr("Rendering done in {0} seconds", renderingTime)); } } catch (Exception ex) { LOGGER.error(ex.getLocalizedMessage(), ex); } finally { mapControl.getMapTransform().setImage(rendererImage); intermediateDrawing.set(false); awaitingDrawing.set(false); updateViewTime.stop(); mapControl.repaint(); } return null; }
Source:
private void checkTableNameAndScrubResultColumns(ResultColumnList rcl, boolean isUpdateWithSubquery) throws StandardException { int columnCount = rcl.size(); int tableCount = ((SelectNode)resultSet).fromList.size(); TableName tableNameNode = null; for ( int i = 0; i < columnCount; i++ ) { boolean foundMatchingTable = false; ResultColumn column = (ResultColumn) rcl.elementAt( i ); String columnTableName = column.getTableName(); if (columnTableName != null) { for (int j = 0; j < tableCount; j++) { FromTable fromTable = (FromTable) ((SelectNode)resultSet). fromList.elementAt(j); final String tableName; if ( fromTable instanceof CurrentOfNode ) { tableName = ((CurrentOfNode)fromTable). getBaseCursorTargetTableName().getTableName(); tableNameNode = ((CurrentOfNode) fromTable).getExposedTableName(); } else { tableName = fromTable.getBaseTableName(); tableNameNode = makeTableName( null, fromTable.getExposedName()); } if (columnTableName.equals(tableName) || columnTableName.equals(tableNameNode.getTableName())) { foundMatchingTable = true; break; } } if (!foundMatchingTable) { throw StandardException.newException( SQLState.LANG_COLUMN_NOT_FOUND, column.getTableName() + "." + column.getName()); } } if (!isUpdateWithSubquery) { column.clearTableName(); } else { ValueNode expression = column.getExpression(); if (expression instanceof ColumnReference && expression.getColumnName().equals(column.getName())) { ((ColumnReference) expression).setTableNameNode(tableNameNode); } } } }

Target:
private void checkTableNameAndScrubResultColumns(ResultColumnList rcl, boolean isUpdateWithSubquery) throws StandardException { int columnCount = rcl.size(); int tableCount = ((SelectNode)resultSet).fromList.size(); TableName tableNameNode = null; for ( int i = 0; i < columnCount; i++ ) { boolean foundMatchingTable = false; ResultColumn column = (ResultColumn) rcl.elementAt( i ); String columnTableName = column.getTableName(); if (columnTableName != null) { for (int j = 0; j < tableCount; j++) { FromTable fromTable = (FromTable) ((SelectNode)resultSet). fromList.elementAt(j); final String tableName; if ( fromTable instanceof CurrentOfNode ) { tableName = ((CurrentOfNode)fromTable). getBaseCursorTargetTableName().getTableName(); tableNameNode = ((CurrentOfNode) fromTable).getExposedTableName(); } else { tableName = fromTable.getBaseTableName(); tableNameNode = makeTableName( null, fromTable.getExposedName()); } if (columnTableName.equals(tableName) || columnTableName.equals(tableNameNode.getTableName())) { foundMatchingTable = true; break; } } if (!foundMatchingTable) { throw StandardException.newException( SQLState.LANG_COLUMN_NOT_FOUND, column.getTableName() + "." + column.getName()); } } if (!isUpdateWithSubquery) { column.clearTableName(); } else { String baseTableName = targetTable.getBaseTableName(); String exposedTableName = targetTable.getExposedName(); if (!baseTableName.equals(exposedTableName)) { ValueNode expression = column.getExpression(); if (expression != null && expression instanceof ColumnReference && baseTableName.equals(expression.getTableName())) ((ColumnReference) expression).setTableNameNode(makeTableName(null,exposedTableName)); } } } }
Source:
public static Collection<String> getParserPropertyValues(Class<? extends IParser> clazz, String propertyName) { String clazzName = clazz.getName(); ArrayList<String> propertyList = new ArrayList<String>(); try { WPSConfig mockConfig = MockUtil.getMockConfig(); PropertyDocument.Property properties[] = mockConfig.getPropertiesForParserClass(clazzName); for (Property property : properties) { if (propertyName.equals(property.getName())) { propertyList.add(property.getStringValue()); } } propertyList.trimToSize(); } catch (Exception e) { log.error("parse error", e); System.err.println("ERROR parsing property " + propertyName + " for Parser class " + clazzName); } return propertyList; }

Target:
public static Collection<String> getParserPropertyValues(Class<? extends IParser> clazz, String propertyName) { String clazzName = clazz.getName(); ArrayList<String> propertyList = new ArrayList<String>(); try { WPSConfig mockConfig = MockUtil.getMockConfig(); PropertyDocument.Property properties[] = mockConfig.getPropertiesForParserClass(clazzName); for (Property property : properties) { if (propertyName.equals(property.getName())) { propertyList.add(property.getStringValue()); } } propertyList.trimToSize(); } catch (Exception e) { log.error("ERROR parsing property " + propertyName + " for Parser class " + clazzName, e); } return propertyList; }
Source:
public void init(ByteBuffer buf, int position) { card = AdaptiveCounting.Builder.obyCount(Integer.MAX_VALUE).build(); try { byte[] bytes = card.getBytes(); int size = card.sizeof(); for (int i = 0; i < size; i++) { buf.put(position + i, bytes[i]); } } catch (IOException e) { throw new RuntimeException("Failed to init: "+e); } }

Target:
public void init(ByteBuffer buf, int position) { card = AdaptiveCounting.Builder.obyCount(Integer.MAX_VALUE).build(); try { byte[] bytes = card.getBytes(); ByteBuffer copy = buf.duplicate(); copy.position(position); copy.put(bytes); } catch (IOException e) { throw new RuntimeException("Failed to init: "+e); } }
Source:
public static PluginImpl getInstance() { Jenkins jenkins = Jenkins.getInstance(); if (jenkins != null) { return jenkins.getPlugin(PluginImpl.class); } else { logger.error("INITIALIZATION Error, Jenkins could not be found, so no plugin!"); return null; } }

Target:
public static PluginImpl getInstance() { Jenkins jenkins = Jenkins.getInstance(); if (jenkins != null) { return jenkins.getPlugin(PluginImpl.class); } else { logger.debug("Error, Jenkins could not be found, so no plugin!"); return null; } }
Source:
public void drop( String identifier, FulltextIndexType type ) throws IOException { if ( type == FulltextIndexType.NODES ) { nodeIndices.remove( identifier ).drop(); writableNodeIndices.remove( identifier ).close(); } else { relationshipIndices.remove( identifier ).drop(); writableRelationshipIndices.remove( identifier ).close(); } rebuildProperties(); }

Target:
void drop( String identifier, FulltextIndexType type ) throws IOException { configurationLock.writeLock().lock(); try { awaitPopulation(); if ( type == FulltextIndexType.NODES ) { writableNodeIndices.remove( identifier ).drop(); } else { writableRelationshipIndices.remove( identifier ).drop(); } rebuildProperties(); } finally { configurationLock.writeLock().unlock(); } }
Source:
public String getJobParameter(String key, String defaultValue) { final GlobalJobParameters conf = context.getExecutionConfig().getGlobalJobParameters(); if (conf != null) { final String value = conf.toMap().get(key); if (value != null) { return value; } } return defaultValue; }

Target:
public String getJobParameter(String key, String defaultValue) { final GlobalJobParameters conf = context.getExecutionConfig().getGlobalJobParameters(); if (conf != null) { return conf.toMap().getOrDefault(key, defaultValue); } return defaultValue; }