auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<PermissionSubject>(); permissionList.add(new PermissionSubject(getVdsGroupId(), VdcObjectType.VdsGroups, getActionType().getActionGroup())); permissionList.add(new PermissionSubject(getVmTemplateId(), VdcObjectType.VmTemplate, getActionType().getActionGroup())); if (getVmTemplate() != null && !getVmTemplate().getDiskList().isEmpty()) { for (DiskImage disk : getParameters().getDiskInfoDestinationMap().values()) { if (disk.getStorageIds() != null && !disk.getStorageIds().isEmpty()) { permissionList.add(new PermissionSubject(GuidUtils.getGuidValue(getStorageDomainId()), VdcObjectType.Storage, ActionGroup.CREATE_DISK)); } } } addPermissionSubjectForAdminLevelProperties(permissionList); return permissionList; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<PermissionSubject>(); permissionList.add(new PermissionSubject(getVdsGroupId(), VdcObjectType.VdsGroups, getActionType().getActionGroup())); permissionList.add(new PermissionSubject(getVmTemplateId(), VdcObjectType.VmTemplate, getActionType().getActionGroup())); if (getVmTemplate() != null && !getVmTemplate().getDiskList().isEmpty()) { for (DiskImage disk : getParameters().getDiskInfoDestinationMap().values()) { if (disk.getStorageIds() != null && !disk.getStorageIds().isEmpty()) { permissionList.add(new PermissionSubject(GuidUtils.getGuidValue(disk.getStorageIds().get(0)), VdcObjectType.Storage, ActionGroup.CREATE_DISK)); } } } addPermissionSubjectForAdminLevelProperties(permissionList); return permissionList; }
Source:
private void processSetting(Map<String, Object> map, String prefix, String setting, Object value, Set<String> maskedSettings) { int prefixLength = setting.indexOf('.'); if (prefixLength == -1) { @SuppressWarnings("unchecked") Map<String, Object> innerMap = (Map<String, Object>) map.get(prefix + setting); if (innerMap != null) { for (Map.Entry<String, Object> entry : innerMap.entrySet()) { map.put(prefix + setting + "." + entry.getKey(), entry.getValue()); } } String settingKey = prefix + setting; Object settingValue = (maskedSettings.contains(settingKey)) ? MASKED_VALUE : value; map.put(settingKey, settingValue); } else { String key = setting.substring(0, prefixLength); String rest = setting.substring(prefixLength + 1); Object existingValue = map.get(prefix + key); if (existingValue == null) { Map<String, Object> newMap = new HashMap<>(2); processSetting(newMap, "", rest, value, maskedSettings); map.put(key, newMap); } else { if (existingValue instanceof Map) { @SuppressWarnings("unchecked") Map<String, Object> innerMap = (Map<String, Object>) existingValue; processSetting(innerMap, "", rest, value, maskedSettings); map.put(key, innerMap); } else { processSetting(map, prefix + key + ".", rest, value, maskedSettings); } } } }

Target:
private void processSetting(Map<String, Object> map, String prefix, String setting, Object value, Set<String> maskedSettings) { int prefixLength = setting.indexOf('.'); if (prefixLength == -1) { @SuppressWarnings("unchecked") Map<String, Object> innerMap = (Map<String, Object>) map.get(prefix + setting); if (innerMap != null) { for (Map.Entry<String, Object> entry : innerMap.entrySet()) { map.put(prefix + setting + "." + entry.getKey(), entry.getValue()); } } String settingKey = prefix + setting; Object settingValue = maskedSettings.contains(settingKey) ? MASKED_VALUE : value; map.put(settingKey, settingValue); } else { String key = setting.substring(0, prefixLength); String rest = setting.substring(prefixLength + 1); Object existingValue = map.get(prefix + key); if (existingValue == null) { Map<String, Object> newMap = new HashMap<>(2); processSetting(newMap, "", rest, value, maskedSettings); map.put(key, newMap); } else { if (existingValue instanceof Map) { @SuppressWarnings("unchecked") Map<String, Object> innerMap = (Map<String, Object>) existingValue; processSetting(innerMap, "", rest, value, maskedSettings); map.put(key, innerMap); } else { processSetting(map, prefix + key + ".", rest, value, maskedSettings); } } } }
Source:
public void UpdateUserActionGroups(Object targetObject, ArrayList<Guid> roleIdList) { ArrayList<VdcQueryParametersBase> queryParamsList = new ArrayList<VdcQueryParametersBase>(); ArrayList<VdcQueryType> queryTypeList = new ArrayList<VdcQueryType>(); for (Guid roleId : roleIdList) { queryTypeList.add(VdcQueryType.GetRoleActionGroupsByRoleId); queryParamsList.add(new MultilevelAdministrationByRoleIdParameters(roleId)); Frontend.RunMultipleQueries(queryTypeList, queryParamsList, new IFrontendMultipleQueryAsyncCallback() { @Override public void Executed(FrontendMultipleQueryAsyncResult result) { for (int i = 0; i < result.getReturnValues().size(); i++) { VdcQueryReturnValue retVal = result.getReturnValues().get(i); ArrayList<ActionGroup> roleActionGroupList = (ArrayList<ActionGroup>) retVal.getReturnValue(); for (ActionGroup actionGroup : roleActionGroupList) { if (!UserPortalLoginModel.this.getLoggedUserActionGroupList().contains(actionGroup)) { UserPortalLoginModel.this.getLoggedUserActionGroupList().add(actionGroup); } } UserPortalLoginModel.this.setRolesCounter(UserPortalLoginModel.this.getRolesCounter() - 1); if (UserPortalLoginModel.this.getRolesCounter() == 0) { CheckIsENGINEUser(UserPortalLoginModel.this); } } } }); } }

Target:
public void UpdateUserActionGroups(Object targetObject, ArrayList<Guid> roleIdList) { ArrayList<VdcQueryParametersBase> queryParamsList = new ArrayList<VdcQueryParametersBase>(); ArrayList<VdcQueryType> queryTypeList = new ArrayList<VdcQueryType>(); for (Guid roleId : roleIdList) { queryTypeList.add(VdcQueryType.GetRoleActionGroupsByRoleId); queryParamsList.add(new MultilevelAdministrationByRoleIdParameters(roleId)); } Frontend.RunMultipleQueries(queryTypeList, queryParamsList, new IFrontendMultipleQueryAsyncCallback() { @Override public void Executed(FrontendMultipleQueryAsyncResult result) { for (int i = 0; i < result.getReturnValues().size(); i++) { VdcQueryReturnValue retVal = result.getReturnValues().get(i); ArrayList<ActionGroup> roleActionGroupList = (ArrayList<ActionGroup>) retVal.getReturnValue(); for (ActionGroup actionGroup : roleActionGroupList) { if (!UserPortalLoginModel.this.getLoggedUserActionGroupList().contains(actionGroup)) { UserPortalLoginModel.this.getLoggedUserActionGroupList().add(actionGroup); } } UserPortalLoginModel.this.setRolesCounter(UserPortalLoginModel.this.getRolesCounter() - 1); if (UserPortalLoginModel.this.getRolesCounter() == 0) { CheckIsENGINEUser(UserPortalLoginModel.this); } } } }); }
Source:
public IndexHits<Relationship> get( String key, Object valueOrNull, Node startNodeOrNull, Node endNodeOrNull ) { KernelTransaction ktx = txBridge.get(); try ( Statement ignore = ktx.acquireStatement() ) { RelationshipExplicitIndexCursor cursor = ktx.cursors().allocateRelationshipExplicitIndexCursor(); long source = startNodeOrNull == null ? -1L : startNodeOrNull.getId(); long target = endNodeOrNull == null ? -1L : endNodeOrNull.getId(); ktx.indexRead().relationshipExplicitIndexLookup( cursor, name, key, valueOrNull, source, target ); return new CursorWrappingRelationshipIndexHits( cursor, getGraphDatabase(), ktx, name ); } catch ( ExplicitIndexNotFoundKernelException e ) { throw new NotFoundException( type + " index '" + name + "' doesn't exist" ); } }

Target:
public IndexHits<Relationship> get( String key, Object valueOrNull, Node startNodeOrNull, Node endNodeOrNull ) { KernelTransaction ktx = txBridge.get(); try ( Statement ignore = ktx.acquireStatement() ) { RelationshipExplicitIndexCursor cursor = ktx.cursors().allocateRelationshipExplicitIndexCursor(); long source = startNodeOrNull == null ? NO_SUCH_NODE : startNodeOrNull.getId(); long target = endNodeOrNull == null ? NO_SUCH_NODE : endNodeOrNull.getId(); ktx.indexRead().relationshipExplicitIndexLookup( cursor, name, key, valueOrNull, source, target ); return new CursorWrappingRelationshipIndexHits( cursor, getGraphDatabase(), ktx, name ); } catch ( ExplicitIndexNotFoundKernelException e ) { throw new NotFoundException( type + " index '" + name + "' doesn't exist" ); } }
Source:
void processFile(AbstractFile f, DrawableDB.DrawableTransaction tr) throws TskCoreException { final boolean known = f.getKnown() == TskData.FileKnown.KNOWN; if (known) { taskDB.removeFile(f.getId(), tr); } else { try { if (FileTypeUtils.hasDrawableMIMEType(f)) { taskDB.updateFile(DrawableFile.create(f, true, false), tr); } else { if (null == f.getMIMEType()) { this.setTaskCompletionStatus(false); } taskDB.removeFile(f.getId(), tr); } } catch (FileTypeDetector.FileTypeDetectorInitException ex) { throw new TskCoreException("Failed to initialize FileTypeDetector.", ex); } } }

Target:
void processFile(AbstractFile f, DrawableDB.DrawableTransaction tr) throws TskCoreException { final boolean known = f.getKnown() == TskData.FileKnown.KNOWN; if (known) { taskDB.removeFile(f.getId(), tr); } else { try { if ( null != f.getMIMEType() && FileTypeUtils.hasDrawableMIMEType(f)) { taskDB.updateFile(DrawableFile.create(f, true, false), tr); } else { if (null == f.getMIMEType()) { this.setTaskCompletionStatus(false); } taskDB.removeFile(f.getId(), tr); } } catch (FileTypeDetector.FileTypeDetectorInitException ex) { throw new TskCoreException("Failed to initialize FileTypeDetector.", ex); } } }
Source:
public boolean error(final Message message, final Throwable throwable) { if (isInvalidBusContentException(throwable)) { final YesNoCancelPopup result = YesNoCancelPopup.newYesNoCancelPopup("Session timeout", DefaultWorkbenchConstants.INSTANCE.InvalidBusResponseProbablySessionTimeout(), Window.Location::reload, () -> {}, () -> {}); result.clearScrollHeight(); result.show(); return false; } else if (isKieServerForbiddenException(throwable)) { ErrorPopup.showMessage(DefaultWorkbenchConstants.INSTANCE.KieServerError403()); return false; } else if (isKieServerUnauthorizedException(throwable)) { ErrorPopup.showMessage(DefaultWorkbenchConstants.INSTANCE.KieServerError401()); return false; } else if (throwable instanceof KieServicesHttpException) { KieServicesHttpException ex = (KieServicesHttpException) throwable; ErrorPopup.showMessage(CommonConstants.INSTANCE.ExceptionGeneric0(ex.getExceptionMessage())); return false; } else { return super.error(message, throwable); } }

Target:
public boolean error(final Message message, final Throwable throwable) { if (isInvalidBusContentException(throwable)) { final YesNoCancelPopup result = YesNoCancelPopup.newYesNoCancelPopup(DefaultWorkbenchConstants.INSTANCE.SessionTimeout(), DefaultWorkbenchConstants.INSTANCE.InvalidBusResponseProbablySessionTimeout(), Window.Location::reload, null, () -> {}); result.clearScrollHeight(); result.show(); return false; } else if (isKieServerForbiddenException(throwable)) { ErrorPopup.showMessage(DefaultWorkbenchConstants.INSTANCE.KieServerError403()); return false; } else if (isKieServerUnauthorizedException(throwable)) { ErrorPopup.showMessage(DefaultWorkbenchConstants.INSTANCE.KieServerError401()); return false; } else if (throwable instanceof KieServicesHttpException) { KieServicesHttpException ex = (KieServicesHttpException) throwable; ErrorPopup.showMessage(CommonConstants.INSTANCE.ExceptionGeneric0(ex.getExceptionMessage())); return false; } else { return super.error(message, throwable); } }
Source:
private void cleanUpStreams() { System.setOut(null); }

Target:
private void cleanUpStreams() { System.setOut(System.out); }
Source:
private void activate() { for (ExtensionEntry entry : loadedEntries.values()) { if (entry.enabled) { try { Extension extension = lookupExtension(entry, loadModule(entry.getConfig().getProperty(MODULE))).newInstance(); extension.setContext(entry.context); extension.init(); entry.setExtension(extension); activatedEntries.put(entry.getName(), entry); MultiValueMapUtils.addToMap(entry.getProvides(), entry, providesEntries); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException ex ) { log.error(String.format("Error in activating extension %1$s. Exception message is " + entry.getName()), ex.getMessage()); if (log.isDebugEnabled()) { log.error("", ex); } } } } }

Target:
private void activate() { for (ExtensionEntry entry : loadedEntries.values()) { if (entry.enabled) { try { Extension extension = (Extension) lookupService( Extension.class, entry.getConfig().getProperty(CLASS), loadModule(entry.getConfig().getProperty(MODULE)) ).newInstance(); extension.setContext(entry.context); extension.init(); entry.setExtension(extension); activatedEntries.put(entry.getName(), entry); MultiValueMapUtils.addToMap(entry.getProvides(), entry, providesEntries); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException ex ) { log.error(String.format("Error in activating extension %1$s. Exception message is " + entry.getName()), ex.getMessage()); if (log.isDebugEnabled()) { log.error("", ex); } } } } }
Source:
public void testSetAsync() { String slaDueDate = "12/25/1983"; tested.setSlaDueDate(new SLADueDate(slaDueDate)); assertTrue(CustomElement.slaDueDate.of(tested.getFlowElement()).get().contains(slaDueDate)); }

Target:
public void testSetAsync() { tested.setAsync(true); assertTrue(CustomElement.async.of(tested.getFlowElement()).get()); }
Source:
protected void ExecuteVmCommand() { lockVmWithCompensationIfNeeded(); if (!isInternalExecution()) { freeLock(); } restoreSnapshotAndRemoveObsoleteSnapshots(); boolean succeeded = true; boolean hasAsyncTasks = false; if (!getImagesList().isEmpty()) { for (DiskImage image : getImagesList()) { if (image.getimageStatus() != ImageStatus.ILLEGAL) { ImagesContainterParametersBase params = new RestoreFromSnapshotParameters(image.getImageId(), getVmId(), targetSnapshot, removedSnapshotId); VdcReturnValueBase returnValue = runAsyncTask(VdcActionType.RestoreFromSnapshot, params); if (succeeded && !returnValue.getSucceeded()) { succeeded = false; getReturnValue().setFault(returnValue.getFault()); } } } hasAsyncTasks = !getTaskIdList().isEmpty(); } removeSnapshotsFromDB(); if (hasAsyncTasks) { deleteOrphanedImages(); } else { endActionOnVmConfiguration(); } setSucceeded(succeeded); }

Target:
protected void ExecuteVmCommand() { if (!getImagesList().isEmpty()) { lockVmWithCompensationIfNeeded(); } if (!isInternalExecution()) { freeLock(); } restoreSnapshotAndRemoveObsoleteSnapshots(); boolean succeeded = true; boolean hasAsyncTasks = false; if (!getImagesList().isEmpty()) { for (DiskImage image : getImagesList()) { if (image.getimageStatus() != ImageStatus.ILLEGAL) { ImagesContainterParametersBase params = new RestoreFromSnapshotParameters(image.getImageId(), getVmId(), targetSnapshot, removedSnapshotId); VdcReturnValueBase returnValue = runAsyncTask(VdcActionType.RestoreFromSnapshot, params); if (succeeded && !returnValue.getSucceeded()) { succeeded = false; getReturnValue().setFault(returnValue.getFault()); } } } hasAsyncTasks = !getTaskIdList().isEmpty(); } removeSnapshotsFromDB(); if (hasAsyncTasks) { deleteOrphanedImages(); } else { endActionOnVmConfiguration(); } setSucceeded(succeeded); }
Source:
private void populateFileCountBySizeDB() { for (int i = 0; i < upperBoundCount.length; i++) { long fileSizeUpperBound = (long) Math.pow(2, (10 + i)); FileCountBySize fileCountRecord = fileCountBySizeDao.findById(fileSizeUpperBound); FileCountBySize newRecord = new FileCountBySize(fileSizeUpperBound, upperBoundCount[i]); if(fileCountRecord == null){ fileCountBySizeDao.insert(newRecord); } else{ fileCountBySizeDao.update(newRecord); } } }

Target:
void populateFileCountBySizeDB() { for (int i = 0; i < upperBoundCount.length; i++) { long fileSizeUpperBound = (i == upperBoundCount.length - 1) ? Long.MAX_VALUE : (long) Math.pow(2, (10 + i)); FileCountBySize fileCountRecord = fileCountBySizeDao.findById(fileSizeUpperBound); FileCountBySize newRecord = new FileCountBySize(fileSizeUpperBound, upperBoundCount[i]); if (fileCountRecord == null) { fileCountBySizeDao.insert(newRecord); } else { fileCountBySizeDao.update(newRecord); } } }
Source:
private static @Nullable String getCommonTraceType(TmfExperiment experiment) { String commonTraceType = null; try { for (final ITmfTrace trace : experiment.getTraces()) { final IResource resource = trace.getResource(); if (resource == null) { return null; } final String traceType = resource.getPersistentProperty(TmfCommonConstants.TRACETYPE); if ((commonTraceType != null) && !commonTraceType.equals(traceType)) { return null; } commonTraceType = traceType; } } catch (CoreException e) { return null; } return commonTraceType; }

Target:
private static @Nullable String getCommonTraceType(TmfExperiment experiment) { String commonTraceType = null; for (final ITmfTrace trace : experiment.getTraces()) { String traceType = trace.getTraceTypeId(); if ((commonTraceType != null) && !commonTraceType.equals(traceType)) { return null; } commonTraceType = traceType; } return commonTraceType; }
Source:
private T processInternal(ParametersWrapper parameters) throws Exception { HandlerMethod candidate = this.findHandlerMethodForParameters(parameters); Assert.notNull(candidate, "No candidate methods found for messages."); Expression expression = candidate.getExpression(); Class<?> expectedType = this.expectedType != null ? this.expectedType : candidate.method.getReturnType(); try { @SuppressWarnings("unchecked") T result = (T) this.evaluateExpression(expression, parameters, expectedType); if (this.requiresReply) { Assert.notNull(result, "Expression evaluation result was null, but this processor requires a reply."); } return result; } catch (Exception e) { Throwable evaluationException = e; if ((e instanceof EvaluationException || e instanceof MessageHandlingException) && e.getCause() != null) { evaluationException = e.getCause(); } if (evaluationException instanceof Exception) { throw (Exception) evaluationException; } else if (evaluationException instanceof Error) { throw (Error) evaluationException; } else { throw new IllegalStateException("Cannot process message", evaluationException); } } }

Target:
private T processInternal(ParametersWrapper parameters) throws Exception { HandlerMethod candidate = this.findHandlerMethodForParameters(parameters); Assert.notNull(candidate, "No candidate methods found for messages."); Expression expression = candidate.getExpression(); Class<?> expectedType = this.expectedType != null ? this.expectedType : candidate.method.getReturnType(); try { @SuppressWarnings("unchecked") T result = (T) this.evaluateExpression(expression, parameters, expectedType); if (this.requiresReply) { Assert.notNull(result, "Expression evaluation result was null, but this processor requires a reply."); } return result; } catch (Exception e) { Throwable evaluationException = e; if ((e instanceof EvaluationException || e instanceof MessageHandlingException) && e.getCause() != null) { evaluationException = e.getCause(); } if (evaluationException instanceof Exception) { throw (Exception) evaluationException; } else { throw new IllegalStateException("Cannot process message", evaluationException); } } }
Source:
private String metadataPath(String containerId, String moduleId) { return Paths.build(Paths.MODULE_DEPLOYMENTS, Paths.ALLOCATED, containerId, moduleId, "metadata"); }

Target:
private String metadataPath(String containerId, String moduleId) { return Paths.build(Paths.MODULE_DEPLOYMENTS, Paths.ALLOCATED, containerId, moduleId, Paths.METADATA); }
Source:
public boolean canEquip(EquipmentType type) { if (this.self.isOnline()) { return this.self.getPlayer().get().canEquip(type); } else { throw new UnsupportedOperationException(); } }

Target:
public boolean canEquip(EquipmentType type) { return getUserIfOnlineForInventory().canEquip(type); }
Source:
public List<String> extractWithJsonPath(String jsonString, String jsonPath) throws ParseException { JsonPath jsonPathParser = getJsonPath(jsonPath); Object values = jsonPathParser.<List<?>> read(jsonString); List<String> jsonExtraction = new ArrayList<String>(); if (values instanceof String) { jsonExtraction.add((String) values); } else if (values instanceof List<?>) { List<?> asList = (List<?>) values; for (Object object : asList) { if(object instanceof String) { jsonExtraction.add((String)object); } else { jsonExtraction.add(object.toString()); } } } return jsonExtraction; }

Target:
public List<String> extractWithJsonPath(String jsonString, String jsonPath) throws ParseException { JsonPath jsonPathParser = getJsonPath(jsonPath); return jsonPathParser.read(jsonString); }
Source:
public void setProperties(List<String> properties) { this.properties = properties; }

Target:
void setProperties(List<String> properties) { this.properties = properties; }
Source:
private static void closeSecureStorage() { for (int i = 0; i < 5; i++) { if (new ShellWithTextIsAvailable("Secure Storage").test()) { new DefaultShell("Secure Storage"); new LabeledText("Password:").setText("admin"); new PushButton("OK").click(); break; } AbstractWait.sleep(TimePeriod.SHORT); } AbstractWait.sleep(TimePeriod.SHORT); new DefaultShell("New Server"); }

Target:
private static void closeSecureStorage() { try { new WaitUntil(new ShellWithTextIsAvailable("Secure Storage"), TimePeriod.getCustom(5)); } catch (RuntimeException ex) { return; } new DefaultShell("Secure Storage"); new LabeledText("Password:").setText("admin"); new PushButton("OK").click(); AbstractWait.sleep(TimePeriod.SHORT); new DefaultShell("New Server"); }
Source:
private String readLineSimple() throws IOException { StringBuilder buff = new StringBuilder(); if (skipLF) { skipLF = false; int i = readCharacter(); if (i == -1 || i == '\r') { return buff.toString(); } else if (i == '\n') { } else { buff.append((char) i); } } while (true) { int i = readCharacter(); if (i == -1 && buff.length() == 0) { return null; } if (i == -1 || i == '\n') { break; } else if (i == '\r') { skipLF = true; break; } else { buff.append((char) i); } } String str = buff.toString(); if (str.length() > 0) { if (mask == null && isHistoryEnabled()) { history.add(str); } else { mask = null; } } history.moveToEnd(); return str; }

Target:
private String readLineSimple() throws IOException { if (skipLF) { skipLF = false; int i = readCharacter(); if (i == -1 || i == '\r') { return finishBuffer(); } else if (i == '\n') { } else { buf.buffer.append((char) i); } } while (true) { int i = readCharacter(); if (i == -1 && buf.buffer.length() == 0) { return null; } else if (i == -1 || i == '\n') { return finishBuffer(); } else if (i == '\r') { skipLF = true; return finishBuffer(); } else { buf.buffer.append((char) i); } } }
Source:
public ExitShellRequest quitShell() { return ExitShellRequest.NORMAL_EXIT; }

Target:
public ExitShellRequest quitShell() { closeClientConnection(); return ExitShellRequest.NORMAL_EXIT; }
Source:
private StudentProfileAttributes loadStudentProfile(StudentAttributes student, InstructorAttributes currentInstructor) { StudentProfileAttributes studentProfile = null; boolean hasExistingStatus = !statusToUser.isEmpty() || session.getAttribute(Const.ParamsNames.STATUS_MESSAGES_LIST) != null; boolean isInstructorAllowedToViewStudent = currentInstructor.isAllowedForPrivilege(student.section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS); boolean isStudentWithProfile = !student.googleId.isEmpty(); if (isInstructorAllowedToViewStudent && isStudentWithProfile) { studentProfile = logic.getStudentProfile(student.googleId); Assumption.assertNotNull(studentProfile); return studentProfile; } else { if (!isStudentWithProfile) { if (!hasExistingStatus) { statusToUser.add(new StatusMessage(Const.StatusMessages.STUDENT_NOT_JOINED_YET_FOR_RECORDS, StatusMessageColor.WARNING)); } } if (!isInstructorAllowedToViewStudent) { if (!hasExistingStatus) { statusToUser.add(new StatusMessage(Const.StatusMessages.STUDENT_PROFILE_UNACCESSIBLE_TO_INSTRUCTOR, StatusMessageColor.WARNING)); } } return null; } }

Target:
private StudentProfileAttributes loadStudentProfile(StudentAttributes student, InstructorAttributes currentInstructor) { StudentProfileAttributes studentProfile = null; boolean isInstructorAllowedToViewStudent = currentInstructor.isAllowedForPrivilege(student.section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS); boolean isStudentWithProfile = !student.googleId.isEmpty(); if (isInstructorAllowedToViewStudent && isStudentWithProfile) { studentProfile = logic.getStudentProfile(student.googleId); Assumption.assertNotNull(studentProfile); return studentProfile; } boolean hasExistingStatus = !statusToUser.isEmpty() || session.getAttribute(Const.ParamsNames.STATUS_MESSAGES_LIST) != null; if (!isStudentWithProfile && !hasExistingStatus) { statusToUser.add(new StatusMessage(Const.StatusMessages.STUDENT_NOT_JOINED_YET_FOR_RECORDS, StatusMessageColor.WARNING)); } if (!isInstructorAllowedToViewStudent && !hasExistingStatus) { statusToUser.add(new StatusMessage(Const.StatusMessages.STUDENT_PROFILE_UNACCESSIBLE_TO_INSTRUCTOR, StatusMessageColor.WARNING)); } return null; }
Source:
private static Function<Method, Optional<String>> hasParam(Class<? extends Annotation> annotation, Class<?> type) { return method -> { int count = 0; for (Parameter parameter : method.getParameters()) { if (parameter.isAnnotationPresent(annotation) && type.equals(parameter.getType())) { count++; } } String errorMessageCommon = " method parameter with @" + annotation.getSimpleName() + " annotation and type " + type.getSimpleName(); if (count == 0) { return Optional.of(invalid(method, "Misssing" + errorMessageCommon)); } else if (count > 1) { return Optional.of(invalid(method, "Multiple" + errorMessageCommon)); } else { return Optional.empty(); } }; }

Target:
private static Function<Method, Optional<String>> hasParam(Class<? extends Annotation> annotation, Class<?> type) { return method -> { long count = Arrays.stream(method.getParameters()) .filter(parameter -> parameter.isAnnotationPresent(annotation) && type.equals(parameter.getType())) .count(); String errorMessageCommon = " method parameter with @" + annotation.getSimpleName() + " annotation and type " + type.getSimpleName(); return evaluateResult(method, count, errorMessageCommon); }; }
Source:
public void getShop(final Callback<Shop> callback) { retrofitService.getShop().observeOn(AndroidSchedulers.mainThread()).subscribe(new InternalCallback<Shop>() { @Override public void success(Shop body, Response response) { callback.success(body, response); } @Override public void failure(RetrofitError error) { callback.failure(error); } }); }

Target:
public void getShop(final Callback<Shop> callback) { retrofitService.getShop().observeOn(getCallbackScheduler()).subscribe(new InternalCallback<Shop>() { @Override public void success(Shop body, Response response) { callback.success(body, response); } @Override public void failure(RetrofitError error) { callback.failure(error); } }); }
Source:
protected IInteractionContext getContext() { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IInteractionContext context = null; if (!(activeWorkbenchWindow == null || activeWorkbenchWindow.getActivePage() == null)) { IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); IEditorPart activeEditor = activePage.getActiveEditor(); if (activeEditor != null && activePage.getActivePart().equals(activeEditor)) { context = (IInteractionContext) activeEditor.getEditorInput().getAdapter(IInteractionContext.class); } } if (context == null && ContextCorePlugin.getContextManager().isContextActive()) { context = ContextCorePlugin.getContextManager().getActiveContext(); } if (context == null) { throw new IllegalStateException("error determining action context"); } return context; }

Target:
protected IInteractionContext getContext() { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IInteractionContext context = null; if (activeWorkbenchWindow != null && activeWorkbenchWindow.getActivePage() != null) { IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); IEditorPart activeEditor = activePage.getActiveEditor(); if (activeEditor != null && activePage.getActivePart().equals(activeEditor)) { context = (IInteractionContext) activeEditor.getEditorInput().getAdapter(IInteractionContext.class); } } if (context == null && ContextCorePlugin.getContextManager().isContextActive()) { context = ContextCorePlugin.getContextManager().getActiveContext(); } if (context == null) { throw new IllegalStateException("error determining action context"); } return context; }
Source:
protected void doHandleChanged() { if (getActionOnChange() != null) { final ActionEvent event = new ActionEvent(this, getActionCommand(), getActionObject()); final WComponent currentInput = this; Runnable later = new Runnable() { @Override public void run() { getActionOnChange().execute(event); if (AjaxHelper.isCurrentAjaxTrigger(currentInput) && UIContextHolder.getCurrent().getFocussed() == null) { setFocussed(); } } }; invokeLater(later); } else if (AjaxHelper.isCurrentAjaxTrigger(this) && UIContextHolder.getCurrent().getFocussed() == null) { setFocussed(); } }

Target:
protected void doHandleChanged() { if (getActionOnChange() != null) { final ActionEvent event = new ActionEvent(this, getActionCommand(), getActionObject()); final boolean isCAT = isCurrentAjaxTrigger(); Runnable later = new Runnable() { @Override public void run() { getActionOnChange().execute(event); if (isCAT && UIContextHolder.getCurrent().getFocussed() == null) { setFocussed(); } } }; invokeLater(later); } else if (AjaxHelper.isCurrentAjaxTrigger(this) && UIContextHolder.getCurrent().getFocussed() == null) { setFocussed(); } }
Source:
public void updateActionBars() { getStatusLineManager().update(false); getMenuManager().update(false); if (toolbarManager != null) { ToolBarManager tbm = (ToolBarManager) toolbarManager; Control tbCtrl = tbm.getControl(); if (tbCtrl == null || tbCtrl.isDisposed()) { if (part.getContext() != null) { } } else { tbm.update(true); if (!tbCtrl.isDisposed()) { Control packParent = getPackParent(tbCtrl); packParent.pack(); if (packParent.getParent() instanceof CTabFolder) packParent.getParent().layout(true); } } MToolBar toolbar = part.getToolbar(); if (toolbar != null) { Object renderer = toolbar.getRenderer(); if (renderer instanceof ToolBarManagerRenderer) { ((ToolBarManagerRenderer) renderer).reconcileManagerToModel(toolbarManager, toolbar); } } } MUIElement parent = getParentModel(); if (parent != null && isOnTop()) { Object renderer = parent.getRenderer(); if (renderer instanceof StackRenderer) { StackRenderer stackRenderer = (StackRenderer) renderer; CTabFolder folder = (CTabFolder) parent.getWidget(); stackRenderer.adjustTopRight(folder); } } super.updateActionBars(); }

Target:
public void updateActionBars() { getStatusLineManager().update(false); getMenuManager().update(false); if (toolbarManager != null) { Control tbCtrl = toolbarManager.getControl(); if (tbCtrl == null || tbCtrl.isDisposed()) { if (part.getContext() != null) { } } else { toolbarManager.update(true); if (!tbCtrl.isDisposed()) { Control packParent = getPackParent(tbCtrl); packParent.pack(); if (packParent.getParent() instanceof CTabFolder) packParent.getParent().layout(true); } } MToolBar toolbar = part.getToolbar(); if (toolbar != null) { Object renderer = toolbar.getRenderer(); if (renderer instanceof ToolBarManagerRenderer) { ((ToolBarManagerRenderer) renderer).reconcileManagerToModel(toolbarManager, toolbar); } } } MUIElement parent = getParentModel(); if (parent != null && isOnTop()) { Object renderer = parent.getRenderer(); if (renderer instanceof StackRenderer) { StackRenderer stackRenderer = (StackRenderer) renderer; CTabFolder folder = (CTabFolder) parent.getWidget(); stackRenderer.adjustTopRight(folder); } } super.updateActionBars(); }
Source:
public LdapKeyStore build() { Assert.checkNotNullParam("dirContextSupplier", dirContextSupplier); Assert.checkNotNullParam("searchPath", searchPath); Assert.checkNotNullParam("searchScope", searchScope); Assert.checkNotNullParam("searchTimeLimit", searchTimeLimit); Assert.checkNotNullParam("aliasAttribute", aliasAttribute); Assert.checkNotNullParam("certificateAttribute", certificateAttribute); Assert.checkNotNullParam("certificateType", certificateType); Assert.checkNotNullParam("certificateChainAttribute", certificateChainAttribute); Assert.checkNotNullParam("certificateChainEncoding", certificateChainEncoding); Assert.checkNotNullParam("keyAttribute", keyAttribute); Assert.checkNotNullParam("keyType", keyType); if (filterAlias == null) filterAlias = "(" + aliasAttribute + "={0})"; if (filterCertificate == null) filterCertificate = "(" + certificateAttribute + "={0})"; if (filterIterate == null) filterIterate = "(" + aliasAttribute + "=*)"; LdapKeyStoreSpi spi = new LdapKeyStoreSpi(dirContextSupplier, searchPath, searchScope, searchTimeLimit, filterAlias, filterCertificate, filterIterate, createPath, createRdn, createAttributes, aliasAttribute, certificateAttribute, certificateType, certificateChainAttribute, certificateChainEncoding, keyAttribute, keyType); return new LdapKeyStore(spi, new WildFlyElytronProvider(), "LdapRealm"); }

Target:
public LdapKeyStore build() { Assert.checkNotNullParam("dirContextSupplier", dirContextSupplier); Assert.checkNotNullParam("searchPath", searchPath); Assert.checkNotNullParam("searchScope", searchScope); Assert.checkNotNullParam("searchTimeLimit", searchTimeLimit); Assert.checkNotNullParam("aliasAttribute", aliasAttribute); Assert.checkNotNullParam("certificateAttribute", certificateAttribute); Assert.checkNotNullParam("certificateType", certificateType); Assert.checkNotNullParam("certificateChainAttribute", certificateChainAttribute); Assert.checkNotNullParam("certificateChainEncoding", certificateChainEncoding); Assert.checkNotNullParam("keyAttribute", keyAttribute); Assert.checkNotNullParam("keyType", keyType); if (filterAlias == null) filterAlias = "(" + aliasAttribute + "={0})"; if (filterCertificate == null) filterCertificate = "(" + certificateAttribute + "={0})"; if (filterIterate == null) filterIterate = "(" + aliasAttribute + "=*)"; LdapKeyStoreSpi spi = new LdapKeyStoreSpi(dirContextSupplier, searchPath, searchScope, searchTimeLimit, filterAlias, filterCertificate, filterIterate, createPath, createRdn, createAttributes, aliasAttribute, certificateAttribute, certificateType, certificateChainAttribute, certificateChainEncoding, keyAttribute, keyType); return new LdapKeyStore(spi, EmptyProvider.getInstance(), "LdapRealm"); }
Source:
private boolean isPortInUse(int port) { try { new Socket("127.0.0.1", port).close(); return true; } catch(IOException e) { } return false; }

Target:
private boolean isPortInUse(int port) { try { new ServerSocket(port, 1).close(); return false; } catch(IOException e) { } return true; }
Source:
public ValidationResult(VdcBllMessages message, String... variableReplacements) { if (message == null) { throw new IllegalArgumentException("message must not be null"); } this.message = message; this.variableReplacements = variableReplacements == null ? Collections.<String>emptyList() : Collections.unmodifiableList(Arrays.asList(variableReplacements)); }

Target:
public ValidationResult(VdcBllMessages message, String... variableReplacements) { if (message == null) { throw new IllegalArgumentException("message must not be null"); } this.message = message; this.variableReplacements = variableReplacements == null || variableReplacements.length == 0 ? Collections.<String>emptyList() : Collections.unmodifiableList(Arrays.asList(variableReplacements)); }
Source:
private void performActionForServicesOfCluster() { List<VDS> servers = getClusterUtils().getAllUpServers(clusterId); final List<GlusterService> serviceList = getServiceList(); List<Callable<Pair<VDS, VDSReturnValue>>> taskList = new ArrayList<Callable<Pair<VDS, VDSReturnValue>>>(); for (final VDS upServer : servers) { final List<String> serviceListStr = new ArrayList<String>(); for (GlusterService srvc : serviceList) { serviceListStr.add(srvc.getServiceName()); } taskList.add(new Callable<Pair<VDS, VDSReturnValue>>() { @Override public Pair<VDS, VDSReturnValue> call() throws Exception { VDSReturnValue returnValue; returnValue = runVdsCommand( VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(upServer.getId(), serviceListStr, actionType)); Pair<VDS, VDSReturnValue> pairRetVal = new Pair<VDS, VDSReturnValue>(upServer, returnValue); if (returnValue.getSucceeded()) updateService(upServer.getId(), serviceList, pairRetVal); return pairRetVal; } }); } setSucceeded(true); if (!taskList.isEmpty()) { List<Pair<VDS, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(taskList); for (Pair<VDS, VDSReturnValue> pairResult : pairResults) { VDSReturnValue retValue = pairResult.getSecond(); if (!retValue.getSucceeded()) { errors.add(retValue.getVdsError().getMessage()); } } } else { setSucceeded(false); } if (errors.size() > 0) { setSucceeded(false); handleVdsErrors(getAuditLogTypeValue(), errors); addCustomValue(GlusterConstants.FAILURE_MESSAGE, StringUtils.join(errors, SystemUtils.LINE_SEPARATOR)); } else { setSucceeded(true); } }

Target:
private void performActionForServicesOfCluster() { List<Callable<Pair<VDS, VDSReturnValue>>> taskList = getTaskList(); if (!taskList.isEmpty()) { invokeManageGlusterService(taskList); } else { setSucceeded(false); } }
Source:
public StudentProfileAttributes() { this.googleId = ""; this.shortName = ""; this.email = ""; this.institute = ""; this.nationality = ""; this.gender = "other"; this.moreInfo = ""; this.pictureKey = ""; this.modifiedDate = null; }

Target:
StudentProfileAttributes() { this.googleId = ""; this.shortName = ""; this.email = ""; this.institute = ""; this.nationality = ""; this.gender = "other"; this.moreInfo = ""; this.pictureKey = ""; this.modifiedDate = new Date(); }
Source:
private List<SqlStageExecution> getStagesReadyForExecution() { long runningPlanSections = stream(forTree(StreamingPlanSection::getChildren).depthFirstPreOrder(sectionedPlan)) .filter(section -> { StageState state = getStageExecution(section.getPlan().getFragment().getId()).getState(); return !state.isDone() && state != PLANNED; }) .count(); return stream(forTree(StreamingPlanSection::getChildren).depthFirstPreOrder(sectionedPlan)) .filter(this::isReadyForExecution) .limit(getMaxConcurrentMaterializations(session) - runningPlanSections) .flatMap(section -> stream(forTree(StreamingSubPlan::getChildren).depthFirstPreOrder(section.getPlan()))) .map(StreamingSubPlan::getFragment) .map(PlanFragment::getId) .map(this::getStageExecution) .collect(toImmutableList()); }

Target:
private List<SqlStageExecution> getStagesReadyForExecution() { long runningPlanSections = stream(forTree(StreamingPlanSection::getChildren).depthFirstPreOrder(sectionedPlan)) .map(section -> getStageExecution(section.getPlan().getFragment().getId()).getState()) .filter(state -> !state.isDone() && state != PLANNED) .count(); return stream(forTree(StreamingPlanSection::getChildren).depthFirstPreOrder(sectionedPlan)) .filter(this::isReadyForExecution) .limit(maxConcurrentMaterializations - runningPlanSections) .flatMap(section -> stream(forTree(StreamingSubPlan::getChildren).depthFirstPreOrder(section.getPlan()))) .map(StreamingSubPlan::getFragment) .map(PlanFragment::getId) .map(this::getStageExecution) .collect(toImmutableList()); }
Source:
public void postCommit() { switch (state()) { case RESTORING: case RUNNING: case SUSPENDED: commitRequested = false; commitNeeded = false; if (state() == State.RESTORING) { writeCheckpointIfNeed(); } else if (!eosEnabled) { writeCheckpointIfNeed(); } if (state() == State.SUSPENDED) { partitionGroup.clear(); } log.debug("Committed"); break; case CREATED: case CLOSED: throw new IllegalStateException("Illegal state " + state() + " while post committing active task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while post committing active task " + id); } }

Target:
public void postCommit() { commitRequested = false; commitNeeded = false; switch (state()) { case RESTORING: writeCheckpointIfNeed(); break; case RUNNING: if (!eosEnabled) { writeCheckpointIfNeed(); } break; case SUSPENDED: writeCheckpointIfNeed(); partitionGroup.clear(); break; case CREATED: case CLOSED: throw new IllegalStateException("Illegal state " + state() + " while post committing active task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while post committing active task " + id); } log.debug("Committed"); }
Source:
public User addUser(User user) { user = userRepository.saveAndFlush(user); return user; }

Target:
public User addUser(User user) { return userRepository.saveAndFlush(user); }
Source:
public void listWithMultipleLabels() { String key = getKey(); String label = getLabel(); String label2 = getLabel(); listWithMultipleLabelsRunner(key, label, label2, (setting, setting2) -> { logger.info("$$$$ listWithMultipleLabels adding setting"); assertConfigurationEquals(setting, client.addSetting(setting)); assertConfigurationEquals(setting2, client.addSetting(setting2)); logger.info("$$$$ listWithMultipleLabels listSettings"); return client.listSettings(new SettingSelector().keys(key).labels(label, label2)); }); }

Target:
public void listWithMultipleLabels() { String key = getKey(); String label = getLabel(); String label2 = getLabel(); listWithMultipleLabelsRunner(key, label, label2, (setting, setting2) -> { assertConfigurationEquals(setting, client.addSetting(setting)); assertConfigurationEquals(setting2, client.addSetting(setting2)); return client.listSettings(new SettingSelector().keys(key).labels(label, label2)); }); }
Source:
private synchronized void connected(ClientConnection conn) { conn.setCurrentRequest(this); this.conn = conn; if (pendingMaxSize != -1) { conn.doSetWriteQueueMaxSize(pendingMaxSize); } if (pendingChunks != null) { ByteBuf pending = pendingChunks; pendingChunks = null; if (completed) { writeHeadWithContent(pending, true); conn.metrics.bytesWritten(conn.remoteAddress(), written); conn.endRequest(); } else { writeHeadWithContent(pending, false); } } else { if (completed) { writeHeadWithContent(Unpooled.EMPTY_BUFFER, true); conn.metrics.bytesWritten(conn.remoteAddress(), written); conn.endRequest(); } else { if (writeHead) { writeHead(); } } } }

Target:
private synchronized void connected(ClientConnection conn) { conn.setCurrentRequest(this); this.conn = conn; if (pendingMaxSize != -1) { conn.doSetWriteQueueMaxSize(pendingMaxSize); } if (pendingChunks != null) { ByteBuf pending = pendingChunks; pendingChunks = null; if (completed) { writeHeadWithContent(pending, true); if (conn.metrics.isEnabled()) conn.metrics.bytesWritten(conn.remoteAddress(), written); conn.endRequest(); } else { writeHeadWithContent(pending, false); } } else { if (completed) { writeHeadWithContent(Unpooled.EMPTY_BUFFER, true); if (conn.metrics.isEnabled()) conn.metrics.bytesWritten(conn.remoteAddress(), written); conn.endRequest(); } else { if (writeHead) { writeHead(); } } } }
Source:
protected boolean hasTextTransform(CSSValue value) { if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value; String textTransform = primitiveValue.getStringValue(); if ("capitalize".equals(textTransform)) { return true; } if ("uppercase".equals(textTransform)) { return true; } if ("lowercase".equals(textTransform)) { return true; } } return false; }

Target:
protected boolean hasTextTransform(CSSValue value) { if (value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE || ((CSSPrimitiveValue) value).getStringValue() == null) { return false; } String textTransform = ((CSSPrimitiveValue) value).getStringValue(); switch (textTransform) { case "capitalize": case "uppercase": case "lowercase": return true; } return false; }
Source:
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { TracingTags.WORKSPACE_ID.set(identity::getWorkspaceId); StringBuilder sshConfig = new StringBuilder(); Map<String, String> map = new HashMap<>(); try { List<SshPairImpl> sshPairs = sshManager.getPairs(identity.getOwnerId(), "vcs"); if (!sshPairs.isEmpty()) { for (SshPair sshPair : sshPairs) { if (isNullOrEmpty(sshPair.getName()) || isNullOrEmpty(sshPair.getPrivateKey())) { continue; } Secret secret = new SecretBuilder() .addToData( SSH_PRIVATE_KEY, Base64.getEncoder().encodeToString(sshPair.getPrivateKey().getBytes())) .withType(SECRET_TYPE_SSH) .withNewMetadata() .withName(getValidNameForSecret(sshPair.getName())) .endMetadata() .build(); k8sEnv.getSecrets().put(secret.getMetadata().getName(), secret); if (!sshPairs.isEmpty()) { k8sEnv .getPodsData() .values() .forEach(p -> addSshKeySecret(secret.getMetadata().getName(), p.getSpec())); } sshConfig.append(buildConfig(sshPair.getName())); } map.put(SSH_CONFIG, sshConfig.toString()); ConfigMap configMap = new ConfigMapBuilder() .withNewMetadata() .withName("sshconfigmap") .endMetadata() .withData(map) .build(); k8sEnv.getConfigMaps().put(configMap.getMetadata().getName(), configMap); k8sEnv.getPodsData().values().forEach(p -> addConfigFile(p.getSpec())); } } catch (ServerException e) { LOG.warn("Unable get SSH Keys ", e); } }

Target:
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { TracingTags.WORKSPACE_ID.set(identity::getWorkspaceId); try { List<SshPairImpl> sshPairs = sshManager.getPairs(identity.getOwnerId(), "vcs"); if (sshPairs.isEmpty()) { return; } StringBuilder sshConfigData = new StringBuilder(); for (SshPair sshPair : sshPairs) { doProvisionSshKey(sshPair, k8sEnv); sshConfigData.append(buildConfig(sshPair.getName())); } doProvisionSshConfig(sshConfigData.toString(), k8sEnv); } catch (ServerException e) { LOG.warn("Unable get SSH Keys. Cause: %s", e.getMessage(), e); } }
Source:
synchronized void retry() { try (final TraceScope retryScope = Trace.startSpan(String.format("pull_retry." + " key: %s, request_id: %d, retry_count: %d", encodedKey.getKey(), requestId, retryCount + 1), pullRequestScope.getSpan())) { if (retryCount++ >= MAX_PULL_RETRY_COUNT) { throw new RuntimeException("Fail to load a value for pull"); } LOG.log(Level.WARNING, "Retry pull request for key {0}. This is {1}-th retry", new Object[]{encodedKey.getKey(), retryCount}); final int numSentBytes = sendPullMsg(encodedKey, requestId, TraceInfo.fromSpan(retryScope.getSpan())); workerThread.sentBytesStat.put(numSentBytes); state = INIT_STATE; } }

Target:
synchronized void retry() { try (final TraceScope retryScope = Trace.startSpan("pull_retry.", pullRequestScope.getSpan())) { if (retryCount++ >= MAX_PULL_RETRY_COUNT) { throw new RuntimeException("Fail to load a value for pull"); } LOG.log(Level.WARNING, "Retry pull request for key {0}. This is {1}-th retry", new Object[]{encodedKey.getKey(), retryCount}); final int numSentBytes = sendPullMsg(encodedKey, requestId, TraceInfo.fromSpan(retryScope.getSpan())); workerThread.sentBytesStat.put(numSentBytes); state = INIT_STATE; } }
Source:
public void validate() { if (feedbackSessionName != null) { assertTrue(sectionName != null, "session must comes with a section"); } }

Target:
public void validate() { if (feedbackSessionName != null) { assertTrue(sectionName != null, "session must comes with a section"); } if (sectionName != null) { boolean isNoneCourseLevelPrivilegesPresent = this.canModifyCourse == null && this.canModifySession == null && this.canModifyStudent == null && this.canModifyInstructor == null; assertTrue(isNoneCourseLevelPrivilegesPresent, "only section and session level privileges."); if (feedbackSessionName != null) { boolean isNoneSectionLevelPrivilegePresent = this.canViewStudentInSections == null; assertTrue(isNoneSectionLevelPrivilegePresent, "only session level privileges."); } } boolean isAnyPrivilegesToUpdate = this.canModifyCourse != null || this.canModifyStudent != null || this.canModifyInstructor != null || this.canModifySession != null || this.canViewStudentInSections != null || this.canSubmitSessionInSections != null || this.canViewSessionInSections != null || this.canModifySessionCommentsInSections != null; assertTrue(isAnyPrivilegesToUpdate, "should have at least one privileges present to update"); }
Source:
public Iterator<Map.Entry<UK, UV>> iterator() { Map<UK, UV> userMap = stateTable.get(currentNamespace); return userMap == null ? Collections.<UK, UV>emptyMap().entrySet().iterator() : userMap.entrySet().iterator(); }

Target:
public Iterator<Map.Entry<UK, UV>> iterator() { Map<UK, UV> userMap = stateTable.get(currentNamespace); return userMap == null ? null : userMap.entrySet().iterator(); }