auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected ActionResult execute() throws EntityDoesNotExistException { verifyBasicAccessibility(); courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); if(courseId == null){ courseId = ""; } List<String> coursePaginationList = new ArrayList<String>(); String courseName = getCoursePaginationList(coursePaginationList); if (!isJoinedCourse(courseId, account.googleId)) { return createPleaseJoinCourseResponse(courseId); } verifyAccessible(); studentEmail = logic.getStudentForGoogleId(courseId, account.googleId).email; CourseRoster roster = null; Map<String, FeedbackSessionResultsBundle> feedbackResultBundles = new HashMap<String, FeedbackSessionResultsBundle>(); List<CommentAttributes> comments = new ArrayList<CommentAttributes>(); if(coursePaginationList.size() > 0){ roster = new CourseRoster( logic.getStudentsForCourse(courseId), logic.getInstructorsForCourse(courseId)); StudentAttributes student = roster.getStudentForEmail(studentEmail); comments = logic.getCommentsForStudent(student); feedbackResultBundles = getFeedbackResultBundles(roster); } data = new StudentCommentsPageData(account); data.init(courseId, courseName, coursePaginationList, comments, roster, previousPageLink, nextPageLink, studentEmail, feedbackResultBundles); statusToAdmin = "studentComments Page Load<br>" + "Viewing <span class=\"bold\">" + account.googleId + "'s</span> comment records " + "for Course <span class=\"bold\">[" + courseId + "]</span>"; return createShowPageResult(Const.ViewURIs.STUDENT_COMMENTS, data); }

Target:
protected ActionResult execute() throws EntityDoesNotExistException { verifyBasicAccessibility(); courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); if (courseId == null) { courseId = ""; } List<String> coursePaginationList = new ArrayList<String>(); String courseName = getCoursePaginationList(coursePaginationList); if (!isJoinedCourse(courseId, account.googleId)) { return createPleaseJoinCourseResponse(courseId); } verifyAccessible(); studentEmail = logic.getStudentForGoogleId(courseId, account.googleId).email; CourseRoster roster = null; Map<String, FeedbackSessionResultsBundle> feedbackResultBundles = new HashMap<String, FeedbackSessionResultsBundle>(); List<CommentAttributes> comments = new ArrayList<CommentAttributes>(); if (coursePaginationList.size() > 0) { roster = new CourseRoster( logic.getStudentsForCourse(courseId), logic.getInstructorsForCourse(courseId)); StudentAttributes student = roster.getStudentForEmail(studentEmail); comments = logic.getCommentsForStudent(student); feedbackResultBundles = getFeedbackResultBundles(roster); } data = new StudentCommentsPageData(account); data.init(courseId, courseName, coursePaginationList, comments, roster, studentEmail, feedbackResultBundles); statusToAdmin = "studentComments Page Load<br>" + "Viewing <span class=\"bold\">" + account.googleId + "'s</span> comment records " + "for Course <span class=\"bold\">[" + courseId + "]</span>"; return createShowPageResult(Const.ViewURIs.STUDENT_COMMENTS, data); }
Source:
public boolean isLossless() { return getCodecA() != null && (isPCM() || isFLAC() || isMLP() || isShorten() || isTrueHD() || isWavPack() || isALAC() || isMonkeysAudio()) || isRALF() || isTTA() || isWMALossless(); }

Target:
public boolean isLossless() { return getCodecA() != null && ( isAIFF() || isALAC() || isFLAC() || isMLP() || isMonkeysAudio() || isPCM() || isRALF() || isShorten() || isTrueHD() || isTTA() || isWAV() || isWavPack() || isWMALossless() ); }
Source:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Map.Entry<String, InternalMachineConfig> entry : internalEnv.getMachines().entrySet()) { String name = entry.getKey(); DockerContainerConfig container = internalEnv.getContainers().get(name); HashMap<String, String> attributes = new HashMap<>(); attributes.put(Machine.MEMORY_LIMIT_ATTRIBUTE, String.valueOf(container.getMemLimit())); container .getLabels() .putAll( Labels.newSerializer() .machineName(name) .machineAttributes(attributes) .runtimeId(identity) .labels()); } }

Target:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Map.Entry<String, InternalMachineConfig> entry : internalEnv.getMachines().entrySet()) { String name = entry.getKey(); DockerContainerConfig container = internalEnv.getContainers().get(name); container .getLabels() .putAll( Labels.newSerializer() .machineName(name) .machineAttributes(entry.getValue().getAttributes()) .runtimeId(identity) .labels()); } }
Source:
public static void validateParameter(String parameter, String parameterName) { if (Pattern.matches(ParameterHelper.PATTERN, parameter)) { return; } throw new RuntimeException("The " + parameter + "/" + parameterName + " parameter check failed"); }

Target:
public static void validateParameter(String parameter, String parameterName) { if (Pattern.matches(ParameterHelper.PATTERN, parameter)) { return; } throw new RuntimeException("The parameter " + parameterName + " not match with " + ParameterHelper.PATTERN); }
Source:
protected TupleBatch fetchNextReady() throws DbException { if (!nonBlocking) { return fetchNextReadySynchronousEOI(); } if (order.equals(JoinPullOrder.LEFT) || order.equals(JoinPullOrder.LEFT_EOS)) { pollLeft = true; } else if (order.equals(JoinPullOrder.RIGHT) || order.equals(JoinPullOrder.RIGHT_EOS)) { pollLeft = false; } TupleBatch nexttb = ans.popFilled(); if (nexttb != null) { return nexttb; } if (isEOIReady()) { nexttb = ans.popAny(); if (nexttb == null) { checkEOSAndEOI(); } return nexttb; } final Operator left = getLeft(); final Operator right = getRight(); int noDataStreak = 0; while (noDataStreak < 2 && (!left.eos() || !right.eos())) { Operator current; if (pollLeft) { current = left; } else { current = right; } TupleBatch tb = current.nextReady(); if (tb != null) { processChildTB(tb, pollLeft); noDataStreak = 0; if (order.equals(JoinPullOrder.ALTER)) { pollLeft = !pollLeft; } nexttb = ans.popAnyUsingTimeout(); if (nexttb != null) { return nexttb; } } else if (current.eoi()) { consumeChildEOI(pollLeft); noDataStreak = 0; if (order.equals(JoinPullOrder.ALTER)) { pollLeft = !pollLeft; } if (isEOIReady()) { break; } } else { if (pollLeft && order.equals(JoinPullOrder.LEFT_EOS) || !pollLeft && order.equals(JoinPullOrder.RIGHT_EOS)) { if (!current.eos()) { break; } } pollLeft = !pollLeft; noDataStreak++; } } if (isEOIReady()) { nexttb = ans.popAny(); if (nexttb == null) { checkEOSAndEOI(); } } return nexttb; }

Target:
protected TupleBatch fetchNextReady() throws DbException { if (!nonBlocking) { return fetchNextReadySynchronousEOI(); } if (order.equals(JoinPullOrder.LEFT) || order.equals(JoinPullOrder.LEFT_EOS)) { pollLeft = true; } else if (order.equals(JoinPullOrder.RIGHT) || order.equals(JoinPullOrder.RIGHT_EOS)) { pollLeft = false; } TupleBatch nexttb = ans.popFilled(); if (nexttb != null) { return nexttb; } if (isEOIReady()) { nexttb = ans.popAny(); if (nexttb == null) { checkEOSAndEOI(); } return nexttb; } final Operator left = getLeft(); final Operator right = getRight(); int noDataStreak = 0; while (noDataStreak < 2 && (!left.eos() || !right.eos())) { Operator current; if (pollLeft) { current = left; } else { current = right; } TupleBatch tb = current.nextReady(); if (tb != null) { processChildTB(tb, pollLeft); noDataStreak = 0; if (order.equals(JoinPullOrder.ALTER)) { pollLeft = !pollLeft; } nexttb = ans.popAnyUsingTimeout(); if (nexttb != null) { return nexttb; } } else if (current.eoi()) { consumeChildEOI(pollLeft); noDataStreak = 0; if (order.equals(JoinPullOrder.ALTER)) { pollLeft = !pollLeft; } if (isEOIReady()) { break; } } else { if ((pollLeft && order.equals(JoinPullOrder.LEFT_EOS)) || (!pollLeft && order.equals(JoinPullOrder.RIGHT_EOS))) { if (!current.eos()) { break; } } pollLeft = !pollLeft; noDataStreak++; } } if (isEOIReady()) { nexttb = ans.popAny(); if (nexttb == null) { checkEOSAndEOI(); } } return nexttb; }
Source:
public void execute(int iterationId) { try { if (getStorageDomain() != null && getStorageDomain().getStorageDomainType() == StorageDomainType.Master) { try { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(getVdss().get(iterationId), getStoragePool(), masterStorageDomainId, storagePoolIsoMap)); } catch (Exception e) { log.error("Could not connect vds '{}' to pool '{}' - moving host to non-operational. Error: {}", getVdss().get(iterationId).getName(), getStoragePool().getName(), e.getMessage()); log.debug("Exception", e); synchronized (_vdsIdsToSetNonOperational) { _vdsIdsToSetNonOperational.add(getVdss().get(iterationId).getId()); } } } else { Backend.getInstance().getResourceManager().RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(getVdss().get(iterationId), getStoragePool(), masterStorageDomainId, storagePoolIsoMap, true)); log.info("Refreshed vds '{}' in pool '{}'", getVdss().get(iterationId).getName(), getStoragePool().getName()); } } catch (RuntimeException e) { log.error("Failed to connect/refresh storagePool. Host '{}' to storage pool '{}'. Error: {}", getVdss().get(iterationId).getName(), getStoragePool().getName(), e.getMessage()); log.debug("Exception", e); } }

Target:
public void execute(int iterationId) { try { if (getStorageDomain() != null && getStorageDomain().getStorageDomainType() == StorageDomainType.Master) { try { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(getVdss().get(iterationId), getStoragePool(), masterStorageDomainId, storagePoolIsoMap)); } catch (Exception e) { log.error("Could not connect vds '{}' to pool '{}' - moving host to non-operational: {}", getVdss().get(iterationId).getName(), getStoragePool().getName(), e.getMessage()); log.debug("Exception", e); synchronized (_vdsIdsToSetNonOperational) { _vdsIdsToSetNonOperational.add(getVdss().get(iterationId).getId()); } } } else { Backend.getInstance().getResourceManager().RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(getVdss().get(iterationId), getStoragePool(), masterStorageDomainId, storagePoolIsoMap, true)); log.info("Refreshed vds '{}' in pool '{}'", getVdss().get(iterationId).getName(), getStoragePool().getName()); } } catch (RuntimeException e) { log.error("Failed to connect/refresh storagePool. Host '{}' to storage pool '{}': {}", getVdss().get(iterationId).getName(), getStoragePool().getName(), e.getMessage()); log.debug("Exception", e); } }
Source:
public static co.cask.cdap.etl.proto.v2.ETLPlugin getPlugin(String tableName) { Map<String, String> properties = new HashMap<>(); properties.put("tableName", tableName); return new co.cask.cdap.etl.proto.v2.ETLPlugin("Mock", BatchSource.PLUGIN_TYPE, properties, null); }

Target:
public static ETLPlugin getPlugin(String tableName) { Map<String, String> properties = new HashMap<>(); properties.put("tableName", tableName); return new ETLPlugin("Mock", BatchSource.PLUGIN_TYPE, properties, null); }
Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String command = request.getParameter(COMMAND); String version = request.getParameter(VERSION); try { if (!VERSION.equals(command)) { if (StringUtils.isEmpty(version)) { throw new Exception("No version found in request."); } if (!SSOUtils.versionSupported(version)) { throw new Exception("Unsupported version found in request."); } } switch (command) { case AUTHN_CREDENTIALS: authCredentials(request, response); break; case GET_TOKEN: getToken(request, response); break; case INVALIDATE_SESSION: HttpSession existingSession = request.getSession(false); if (existingSession != null) { existingSession.invalidate(); } break; case TOKEN_QUERY: getTokenUser(request, response); break; case VALIDATE_SESSION: validateSession(request, response); break; case VERSION: response.getWriter().print(SSOUtils.SSO_VERSION); break; default: log.error("Unknown command " + command); response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); break; } } catch (Exception ex) { log.debug("Exception in handling command " + command, ex); response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String command = request.getParameter(COMMAND); String version = request.getParameter(VERSION); try { if (!VERSION.equals(command)) { if (StringUtils.isEmpty(version)) { throw new Exception("No version found in request."); } if (!SSOUtils.versionSupported(version)) { throw new Exception("Unsupported version found in request."); } } switch (command) { case AUTHN_CREDENTIALS: authCredentials(request, response); break; case GET_TOKEN_PAYLOAD: getTokenPayload(request, response); break; case INVALIDATE_SESSION: HttpSession existingSession = request.getSession(false); if (existingSession != null) { existingSession.invalidate(); } break; case TOKEN_QUERY: getTicketUser(request, response); break; case VALIDATE_SESSION: validateSession(request, response); break; case VERSION: Map<String, String> versionData = new HashMap<>(); versionData.put(VERSION, SSOUtils.SSO_VERSION); response.getWriter().print(SSOUtils.getJson(versionData)); break; default: log.error("Unknown command " + command); response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); break; } } catch (Exception ex) { log.debug("Exception in handling command " + command, ex); response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); } }
Source:
public ApplicationReportModel getMainApplicationReportForFile(FileModel fileModel) { GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<>(getGraphContext().getGraph()); pipe.V(WindupVertexFrame.TYPE_PROP, ApplicationReportModel.TYPE); pipe.has(ApplicationReportModel.MAIN_APPLICATION_REPORT, true); pipe.as("applicationReport"); pipe.out(ApplicationReportModel.REPORT_TO_PROJECT_MODEL); ProjectModel rootProjectModel = fileModel.getProjectModel(); if (rootProjectModel == null) { return null; } else { rootProjectModel = rootProjectModel.getRootProjectModel(); } String rootFilePath = rootProjectModel.getRootFileModel().getFilePath(); pipe.out(ProjectModel.ROOT_FILE_MODEL); pipe.has(FileModel.FILE_PATH, rootFilePath); pipe.back("applicationReport"); if (pipe.iterator().hasNext()) { Vertex v = pipe.iterator().next(); ApplicationReportModel mainAppReport = frame(v); if(pipe.iterator().hasNext()) { System.err.println("There are multiple ApplicationReportModels for a single file " + fileModel.getFilePath() +". This may cause some broken" + "links in the report file"); } return mainAppReport; } return null; }

Target:
public ApplicationReportModel getMainApplicationReportForFile(FileModel fileModel) { GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<>(getGraphContext().getGraph()); pipe.V(WindupVertexFrame.TYPE_PROP, ApplicationReportModel.TYPE); pipe.has(ApplicationReportModel.MAIN_APPLICATION_REPORT, true); pipe.as("applicationReport"); pipe.out(ApplicationReportModel.REPORT_TO_PROJECT_MODEL); ProjectModel rootProjectModel = fileModel.getProjectModel(); if (rootProjectModel == null) { return null; } else { rootProjectModel = rootProjectModel.getRootProjectModel(); } String rootFilePath = rootProjectModel.getRootFileModel().getFilePath(); pipe.out(ProjectModel.ROOT_FILE_MODEL); pipe.has(FileModel.FILE_PATH, rootFilePath); pipe.back("applicationReport"); if (pipe.iterator().hasNext()) { Vertex v = pipe.iterator().next(); ApplicationReportModel mainAppReport = frame(v); if(pipe.iterator().hasNext()) { LOG.warning("There are multiple ApplicationReportModels for a single file " + fileModel.getFilePath() +". This may cause some broken" + "links in the report file"); } return mainAppReport; } return null; }
Source:
public String getMessageLevel() { return messageLevel.toString(); }

Target:
public MessageLevel getMessageLevel() { return messageLevel; }
Source:
private void attemptExecuteAndUpdateRepository(final Instant scheduled) { if (!_cachedJob.isPresent()) { LOGGER.error() .setMessage("unable to execute: executor is not initialized") .log(); return; } final CachedJob<T> cachedJob = _cachedJob.get(); final JobRef<T> ref = cachedJob.getRef(); final Job<T> job = cachedJob.getJob(); final JobRepository<T> repo = ref.getRepository(_injector); if (_currentlyExecuting.getAndSet(true)) { return; } try { repo.jobStarted(ref.getJobId(), ref.getOrganization(), scheduled); } catch (final NoSuchElementException error) { _currentlyExecuting.set(false); killSelf(); return; } job.execute(getSelf(), scheduled) .handle((result, error) -> { try { if (error == null) { repo.jobSucceeded(ref.getJobId(), ref.getOrganization(), scheduled, result); } else { repo.jobFailed(ref.getJobId(), ref.getOrganization(), scheduled, error); } cachedJob.reload(_injector); } catch (final NoSuchElementException error2) { killSelf(); } return result; }) .whenComplete((result, error) -> _currentlyExecuting.set(false)); }

Target:
private void attemptExecuteAndUpdateRepository(final Instant scheduled) throws ActorNotInitializedException, NoSuchJobException { if (!_cachedJob.isPresent()) { throw new ActorNotInitializedException("unable to execute: executor is not initialized"); } final CachedJob<T> cachedJob = _cachedJob.get(); final JobRef<T> ref = cachedJob.getRef(); final Job<T> job = cachedJob.getJob(); final JobRepository<T> repo = ref.getRepository(_injector); if (_currentlyExecuting) { return; } _currentlyExecuting = true; try { repo.jobStarted(ref.getJobId(), ref.getOrganization(), scheduled); } catch (final NoSuchElementException error) { _currentlyExecuting = false; throw new NoSuchJobException("job no longer exists in repository", error); } PatternsCS.pipe( job.execute(getSelf(), scheduled) .handle((result, error) -> new JobCompleted.Builder<T>() .setScheduled(scheduled) .setError(error) .setResult(result) .build()), getContext().system().dispatcher() ).to(getSelf()); }
Source:
private void processIndexSegmentEntriesBackward(IndexSegment indexSegment, List<IndexEntry> indexEntries, Map<StoreKey, Long> deletedKeys) throws StoreException { logger.trace("Processing index entries backward by IndexScanner for segment for store {}", indexSegment, storeId); List<IndexEntry> validIndexEntries = getValidIndexEntries(indexSegment, indexEntries, newScanResults.containerForecastStartTimeMs, deletedKeys); processEntriesForContainerBucket(newScanResults, validIndexEntries, deletedKeys); validIndexEntries = getValidIndexEntries(indexSegment, indexEntries, newScanResults.logSegmentForecastStartTimeMs, deletedKeys); processEntriesForLogSegmentBucket(newScanResults, validIndexEntries, deletedKeys); }

Target:
private void processIndexSegmentEntriesBackward(IndexSegment indexSegment, List<IndexEntry> indexEntries, Map<StoreKey, Long> deletedKeys) throws StoreException { logger.trace("Processing index entries backward by IndexScanner for segment for store {}", indexSegment.getFile().getName(), storeId); List<IndexEntry> validIndexEntries = getValidIndexEntries(indexSegment, indexEntries, newScanResults.containerForecastStartTimeMs, deletedKeys); processEntriesForContainerBucket(newScanResults, validIndexEntries, deletedKeys); validIndexEntries = getValidIndexEntries(indexSegment, indexEntries, newScanResults.logSegmentForecastStartTimeMs, deletedKeys); processEntriesForLogSegmentBucket(newScanResults, validIndexEntries, deletedKeys); }
Source:
private float getCurrentSpeed() { if (isPlayingVideo) { return UserPreferences.getVideoPlaybackSpeed(); } if (controller != null) { Playable media = controller.getMedia(); boolean isFeedMedia = media instanceof FeedMedia; if (isFeedMedia) { return ((FeedMedia) media).getMediaPlaybackSpeed(); } } return UserPreferences.getPlaybackSpeed(); }

Target:
private float getCurrentSpeed() { Playable media = null; if (controller != null) { media = controller.getMedia(); } return PlaybackSpeedHelper.getCurrentPlaybackSpeed(media); }
Source:
public void shouldUseDocValues() { elasticsearchTemplate.createIndex(DocValuesEntity.class); elasticsearchTemplate.putMapping(DocValuesEntity.class); Map mapping = elasticsearchTemplate.getMapping(DocValuesEntity.class); Map descriptionMapping = (Map) ((Map) mapping.get("properties")).get("description"); Map keywordDescriptionMapping = (Map) ((Map) descriptionMapping.get("fields")).get("keyword"); Map nameMapping = (Map) ((Map) mapping.get("properties")).get("name"); Map bucketsMapping = (Map) ((Map) mapping.get("properties")).get("buckets"); assertTrue(bucketsMapping.size() == 1); assertThat(bucketsMapping.get("type")).isEqualTo("nested"); assertTrue(nameMapping.size() == 2); assertThat(nameMapping.get("type")).isEqualTo("keyword"); assertThat(nameMapping.get("doc_values")).isEqualTo(false); assertTrue(descriptionMapping.size() == 2); assertThat(descriptionMapping.get("type")).isEqualTo("text"); assertTrue(keywordDescriptionMapping.size() == 2); assertThat(keywordDescriptionMapping.get("type")).isEqualTo("keyword"); assertThat(keywordDescriptionMapping.get("doc_values")).isEqualTo(false); }

Target:
public void shouldUseDocValues() { elasticsearchTemplate.createIndex(DocValuesEntity.class); elasticsearchTemplate.putMapping(DocValuesEntity.class); Map mapping = elasticsearchTemplate.getMapping(DocValuesEntity.class); Map descriptionMapping = (Map) ((Map) mapping.get("properties")).get("description"); Map keywordDescriptionMapping = (Map) ((Map) descriptionMapping.get("fields")).get("keyword"); Map nameMapping = (Map) ((Map) mapping.get("properties")).get("name"); Map bucketsMapping = (Map) ((Map) mapping.get("properties")).get("buckets"); assertThat(bucketsMapping).hasSize(1); assertThat(bucketsMapping.get("type")).isEqualTo("nested"); assertThat(nameMapping).hasSize(2); assertThat(nameMapping.get("type")).isEqualTo("keyword"); assertThat(nameMapping.get("doc_values")).isEqualTo(false); assertThat(descriptionMapping).hasSize(2); assertThat(descriptionMapping.get("type")).isEqualTo("text"); assertThat(keywordDescriptionMapping).hasSize(2); assertThat(keywordDescriptionMapping.get("type")).isEqualTo("keyword"); assertThat(keywordDescriptionMapping.get("doc_values")).isEqualTo(false); }
Source:
public void test_starting_states() throws Exception { BytecodeEGWalker walker = new BytecodeEGWalker(null, null); String signature = "type#()V"; walker.methodBehavior = new MethodBehavior(signature); ProgramState startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, false)); SymbolicValue thisSv = startingState.getValue(0); assertThat(thisSv).isNotNull(); assertThat(startingState.getConstraints(thisSv).get(ObjectConstraint.class)).isEqualTo(ObjectConstraint.NOT_NULL); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, true)); assertThat(startingState).isEqualTo(ProgramState.EMPTY_STATE); signature = "type#(DIJ)V"; walker.methodBehavior = new MethodBehavior(signature); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, true)); assertThat(startingState.getValue(0)).isNotNull(); SymbolicValue doubleArg = startingState.getValue(0); assertThat(startingState.getConstraint(doubleArg, BytecodeEGWalker.StackValueCategoryConstraint.class)).isEqualTo(BytecodeEGWalker.StackValueCategoryConstraint.LONG_OR_DOUBLE); assertThat(startingState.getValue(1)).isNull(); assertThat(startingState.getValue(2)).isNotNull(); SymbolicValue longArg = startingState.getValue(3); assertThat(longArg).isNotNull(); assertThat(startingState.getConstraint(longArg, BytecodeEGWalker.StackValueCategoryConstraint.class)).isEqualTo(BytecodeEGWalker.StackValueCategoryConstraint.LONG_OR_DOUBLE); }

Target:
public void test_starting_states() throws Exception { BytecodeEGWalker walker = new BytecodeEGWalker(null, semanticModel); String signature = "type#foo()V"; walker.methodBehavior = new MethodBehavior(signature); ProgramState startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, false)); SymbolicValue thisSv = startingState.getValue(0); assertThat(thisSv).isNotNull(); assertThat(startingState.getConstraints(thisSv).get(ObjectConstraint.class)).isEqualTo(ObjectConstraint.NOT_NULL); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, true)); assertThat(startingState).isEqualTo(ProgramState.EMPTY_STATE); signature = "type#foo(DIJ)V"; walker.methodBehavior = new MethodBehavior(signature); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, true)); assertThat(startingState.getValue(0)).isNotNull(); SymbolicValue doubleArg = startingState.getValue(0); assertThat(startingState.getConstraint(doubleArg, BytecodeEGWalker.StackValueCategoryConstraint.class)).isEqualTo(BytecodeEGWalker.StackValueCategoryConstraint.LONG_OR_DOUBLE); assertThat(startingState.getValue(1)).isNull(); assertThat(startingState.getValue(2)).isNotNull(); SymbolicValue longArg = startingState.getValue(3); assertThat(longArg).isNotNull(); assertThat(startingState.getConstraint(longArg, BytecodeEGWalker.StackValueCategoryConstraint.class)).isEqualTo(BytecodeEGWalker.StackValueCategoryConstraint.LONG_OR_DOUBLE); }
Source:
protected IStatus validate() { final Object selectedData = selectedDataObservable.getValue(); if (selectedData != null && selectedData instanceof BusinessObjectData) { final BusinessObjectData value = (BusinessObjectData) selectedData; return toBusinessObject(value) != null ? Status.OK_STATUS : ValidationStatus.error(Messages.invalidBusinessDataSelected); } else { if (availableBusinessData.isEmpty()) { return selectionTypeObservable.getValue().equals(Boolean.TRUE) ? ValidationStatus.warning(Messages.warningAddFromData_noDataAvailable) : Status.OK_STATUS; } else { return selectionTypeObservable.getValue().equals(Boolean.TRUE) ? ValidationStatus.warning(Messages.warningAddFromData_noDataSelected) : Status.OK_STATUS; } } }

Target:
protected IStatus validate() { final Object selectedData = selectedDataObservable.getValue(); if (selectedData != null && selectedData instanceof BusinessObjectData) { final BusinessObjectData value = (BusinessObjectData) selectedData; return toBusinessObject(value) != null ? Status.OK_STATUS : ValidationStatus.error(Messages.invalidBusinessDataSelected); } else { if (availableBusinessData.isEmpty()) { return Boolean.TRUE.equals(selectionTypeObservable.getValue()) ? ValidationStatus.warning(Messages.warningAddFromData_noDataAvailable) : Status.OK_STATUS; } else { return Boolean.TRUE.equals(selectionTypeObservable.getValue()) ? ValidationStatus.warning(Messages.warningAddFromData_noDataSelected) : Status.OK_STATUS; } } }
Source:
private void saveTask(String processTitle, Task task) { try { serviceManager.getTaskService().save(task); } catch (DataException e) { Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while saving - " + processTitle, e); logger.error(KITODO_SCRIPT_FIELD + "Error while saving - " + processTitle, e); } }

Target:
private void saveTask(String processTitle, Task task) { try { serviceManager.getTaskService().save(task); } catch (DataException e) { logger.error(KITODO_SCRIPT_FIELD + "Error while saving - " + processTitle, e); Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while saving - " + processTitle, e); } }
Source:
public long offset() throws IOException { return exists() ? writer().getFilePointer() : 0; }

Target:
public long offset() throws IOException { return exists() ? reader().getFilePointer() : 0; }
Source:
CommandResult build() { return new CommandResult(this.processed, this.successCount, this.affectedBlocks, this.affectedEntities, this.affectedItems, this.queryResult, this.resultInfo); }

Target:
public CommandResult build() { return new CommandResult(this.processed, this.successCount, this.affectedBlocks, this.affectedEntities, this.affectedItems, this.queryResult, this.resultInfo); }
Source:
private void doBuildGetBlobOptionsTestForSubResource(Map<String, Object> args, RestUtils.SubResource subResource, ByteRange expectedRange, GetBlobOptions.OperationType expectedOpType, boolean shouldSucceed) throws RestServiceException { if (shouldSucceed) { GetBlobOptions options = RestUtils.buildGetBlobOptions(args, subResource); assertEquals("Unexpected range for args=" + args + " and subResource=" + subResource, expectedRange, options.getRange()); assertEquals("Unexpected operation type for args=" + args + " and subResource=" + subResource, expectedOpType, options.getOperationType()); } else { try { RestUtils.buildGetBlobOptions(args, subResource); fail("buildGetBlobOptions should not have succeeded with args=" + args + "and subResource=" + subResource); } catch (RestServiceException expected) { } } }

Target:
private void doBuildGetBlobOptionsTestForSubResource(Map<String, Object> args, RestUtils.SubResource subResource, ByteRange expectedRange, GetBlobOptions.OperationType expectedOpType, boolean shouldSucceed) throws RestServiceException { if (shouldSucceed) { GetBlobOptions options = RestUtils.buildGetBlobOptions(args, subResource); assertEquals("Unexpected range for args=" + args + " and subResource=" + subResource, expectedRange, options.getRange()); assertEquals("Unexpected operation type for args=" + args + " and subResource=" + subResource, expectedOpType, options.getOperationType()); } else { try { RestUtils.buildGetBlobOptions(args, subResource); fail("buildGetBlobOptions should not have succeeded with args=" + args + "and subResource=" + subResource); } catch (RestServiceException expected) { assertEquals("Unexpected error code.", RestServiceErrorCode.InvalidArgs, expected.getErrorCode()); } } }
Source:
public synchronized Collection<MetaAnnotation> getAnnotations() { final Annotation[] array; if (_annotationsCache != null) { array = _annotationsCache; } else { array = _annotationsCache = field.getAnnotations(); } return Arrays.stream(array).map(JavaReflectionAnnotation::new).collect(Collectors.toList()); }

Target:
public Collection<MetaAnnotation> getAnnotations() { return Arrays.stream(field.getAnnotations()).map(JavaReflectionAnnotation::new).collect(toList()); }
Source:
private FutureTask<EventResult> submitTaskInternal(Event event, Callable<EventResult> callable) { FutureTask<EventResult> task = null; Guid storagePoolId = event.getStoragePoolId(); ReentrantLock lock = getPoolLock(storagePoolId); lock.lock(); try { Event currentEvent = poolCurrentEventMap.get(storagePoolId); if (currentEvent != null) { switch (currentEvent.getEventType()) { case RECOVERY: if (event.getEventType() == EventType.VDSCONNECTTOPOOL || event.getEventType() == EventType.VDSCLEARCACHE) { task = addTaskToQueue(event, callable, storagePoolId, isEventShouldBeFirst(event)); } else { log.debugFormat("Current event was skiped because of recovery is running now for pool {0}, event {1}", storagePoolId, event); } break; case RECONSTRUCT: if (event.getEventType() == EventType.VDSCONNECTTOPOOL || event.getEventType() == EventType.RECOVERY || event.getEventType() == EventType.DOMAINFAILOVER || event.getEventType() == EventType.VDSCLEARCACHE) { task = addTaskToQueue(event, callable, storagePoolId, isEventShouldBeFirst(event)); } else { log.debugFormat("Current event was skiped because of reconstruct is running now for pool {0}, event {1}", storagePoolId, event); } break; default: task = addTaskToQueue(event, callable, storagePoolId, isEventShouldBeFirst(event)); break; } } else { task = addTaskToQueue(event, callable, storagePoolId, false); poolCurrentEventMap.put(storagePoolId, event); ThreadPoolUtil.execute(new InternalEventQueueThread(storagePoolId, lock, poolsEventsMap, poolCurrentEventMap)); } } finally { lock.unlock(); } return task; }

Target:
private FutureTask<EventResult> submitTaskInternal(Event event, Callable<EventResult> callable) { FutureTask<EventResult> task = null; Guid storagePoolId = event.getStoragePoolId(); ReentrantLock lock = getPoolLock(storagePoolId); lock.lock(); try { Event currentEvent = poolCurrentEventMap.get(storagePoolId); if (currentEvent != null) { switch (currentEvent.getEventType()) { case RECOVERY: if (event.getEventType() == EventType.VDSCONNECTTOPOOL || event.getEventType() == EventType.VDSCLEARCACHE || event.getEventType() == EventType.DOMAINFAILOVER) { task = addTaskToQueue(event, callable, storagePoolId, isEventShouldBeFirst(event)); } else { log.debugFormat("Current event was skiped because of recovery is running now for pool {0}, event {1}", storagePoolId, event); } break; case RECONSTRUCT: if (event.getEventType() == EventType.VDSCONNECTTOPOOL || event.getEventType() == EventType.RECOVERY || event.getEventType() == EventType.DOMAINFAILOVER || event.getEventType() == EventType.VDSCLEARCACHE) { task = addTaskToQueue(event, callable, storagePoolId, isEventShouldBeFirst(event)); } else { log.debugFormat("Current event was skiped because of reconstruct is running now for pool {0}, event {1}", storagePoolId, event); } break; default: task = addTaskToQueue(event, callable, storagePoolId, isEventShouldBeFirst(event)); break; } } else { task = addTaskToQueue(event, callable, storagePoolId, false); poolCurrentEventMap.put(storagePoolId, event); ThreadPoolUtil.execute(new InternalEventQueueThread(storagePoolId, lock, poolsEventsMap, poolCurrentEventMap)); } } finally { lock.unlock(); } return task; }
Source:
private void checkIfOnRail() { for (y = -1; y != 2 && this.state == Minecart.STATE_INITIAL; y++) { positionToCheck = this.temporalVector.setComponents(this.x, this.y + y, this.z); Block block = this.level.getBlock(positionToCheck); if (this.isRail(block)) { minecartPosition = positionToCheck.floor().add(0.5, 0, 0.5); this.setPosition(minecartPosition); this.state = Minecart::STATE_ON_RAIL; } } if (this.state != Minecart::STATE_ON_RAIL) { this.state = Minecart::STATE_OFF_RAIL; } }

Target:
private void checkIfOnRail() { for (y = -1; y != 2 && this.state == Minecart.STATE_INITIAL; y++) { positionToCheck = this.temporalVector.setComponents(this.x, this.y + y, this.z); Block block = this.level.getBlock(positionToCheck); if (this.isRail(block)) { minecartPosition = positionToCheck.floor().add(0.5, 0, 0.5); this.setPosition(minecartPosition); this.state = Minecart.STATE_ON_RAIL; } } if (this.state != Minecart.STATE_ON_RAIL) { this.state = Minecart.STATE_OFF_RAIL; } }
Source:
@Override public RelNode convert(RelNode rel) { LogicalJoin join = (LogicalJoin) rel; List<RelNode> newInputs = new ArrayList<>(); for (RelNode input : join.getInputs()) { if (!(input.getConvention() instanceof EnumerableConvention)) { input = convert( input, input.getTraitSet() .replace(EnumerableConvention.INSTANCE)); } newInputs.add(input); } final RelOptCluster cluster = join.getCluster(); final RelNode left = newInputs.get(0); final RelNode right = newInputs.get(1); final JoinInfo info = JoinInfo.of(left, right, join.getCondition()); if (!info.isEqui() && join.getJoinType() != JoinRelType.INNER) { return EnumerableNestedLoopJoin.create( left, right, join.getCondition(), join.getVariablesSet(), join.getJoinType()); } else { RelNode newRel; newRel = EnumerableHashJoin.create( left, right, info.getEquiCondition(left, right, cluster.getRexBuilder()), join.getVariablesSet(), join.getJoinType()); RexNode nonEqui = info.getRemaining(cluster.getRexBuilder()); if (!nonEqui.isAlwaysTrue()) { newRel = new EnumerableFilter(cluster, newRel.getTraitSet(), newRel, nonEqui); } return newRel; } }

Target:
@Override public RelNode convert(RelNode rel) { LogicalJoin join = (LogicalJoin) rel; List<RelNode> newInputs = new ArrayList<>(); for (RelNode input : join.getInputs()) { if (!(input.getConvention() instanceof EnumerableConvention)) { input = convert( input, input.getTraitSet() .replace(EnumerableConvention.INSTANCE)); } newInputs.add(input); } final RelOptCluster cluster = join.getCluster(); final RelNode left = newInputs.get(0); final RelNode right = newInputs.get(1); final JoinInfo info = join.analyzeCondition(); if (!info.isEqui() && join.getJoinType() != JoinRelType.INNER) { return EnumerableNestedLoopJoin.create( left, right, join.getCondition(), join.getVariablesSet(), join.getJoinType()); } else { RelNode newRel; newRel = EnumerableHashJoin.create( left, right, info.getEquiCondition(left, right, cluster.getRexBuilder()), join.getVariablesSet(), join.getJoinType()); if (!info.isEqui()) { RexNode nonEqui = RexUtil.composeConjunction(cluster.getRexBuilder(), info.getNonEquiConditions()); newRel = new EnumerableFilter(cluster, newRel.getTraitSet(), newRel, nonEqui); } return newRel; } }
Source:
public void throw_exception_for_unknown_Java_class() { TypeUrl.of("unknown/JavaClass") .toMessageClass(); }

Target:
public void throw_exception_for_unknown_Java_class() { final TypeUrl url = TypeUrl.of("unknown/JavaClass"); url.toMessageClass(); }
Source:
protected void moveToMediaAdapter(String caseId) { Cursor cursor = this.managedQuery(Uri.parse("content://org.commcare.dalvik.case/casedb/attachment/" + caseId), null, null, null, null); cursor.moveToFirst(); while (cursor.isAfterLast() == false) { String filePath = cursor.getString(cursor.getColumnIndex("file-source")); if(!"invalid".equals(filePath)) { ImageView imageView = (ImageView) this.findViewById(R.id.image_view); Bitmap mBmp = BitmapFactory.decodeFile(filePath); if(mBmp != null) { imageView.setImageBitmap(mBmp); } } cursor.moveToNext(); } }

Target:
private void moveToMediaAdapter(String caseId) { Cursor cursor = this.managedQuery(Uri.parse(CASE_URI_ROOT + "attachment/" + caseId), null, null, null, null); cursor.moveToFirst(); while (!cursor.isAfterLast()) { String filePath = cursor.getString(cursor.getColumnIndex("file-source")); if(!"invalid".equals(filePath)) { ImageView imageView = (ImageView) this.findViewById(R.id.image_view); Bitmap mBmp = BitmapFactory.decodeFile(filePath); if(mBmp != null) { imageView.setImageBitmap(mBmp); } } cursor.moveToNext(); } }
Source:
public int compare(EndpointMultiRank o1, EndpointMultiRank o2) { int idealHeightDiff = o1.endpointConstraints.getIdealHeight() - o2.endpointConstraints.getIdealHeight(); if (idealHeightDiff != 0) { return idealHeightDiff; } else { return o1.speakerRank - o2.speakerRank; } }

Target:
public int compare(EndpointMultiRank o1, EndpointMultiRank o2) { int preferredHeightDiff = o1.videoConstraints.getPreferredHeight() - o2.videoConstraints.getPreferredHeight(); if (preferredHeightDiff != 0) { return preferredHeightDiff; } else { int idealHeightDiff = o1.videoConstraints.getIdealHeight() - o2.videoConstraints.getIdealHeight(); if (idealHeightDiff != 0) { return idealHeightDiff; } return o2.speakerRank - o1.speakerRank; } }
Source:
public void update(@Nonnull Block b) { Config blockData = BlockStorage.getLocationInfo(b.getLocation()); String id = blockData.getString("id"); SlimefunItem item = SlimefunItem.getByID(id); BlockMenu menu = BlockStorage.getInventory(b.getLocation()); if (item == null || menu == null) { clear(false); } else if (id.equals("CARGO_NODE_OUTPUT")) { clear(true); } else { this.items.clear(); this.checkLore = Objects.equals(blockData.getString("filter-lore"), "true"); this.defaultValue = !Objects.equals(blockData.getString("filter-type"), "whitelist"); for (int slot : CargoUtils.FILTER_SLOTS) { ItemStack stack = menu.getItemInSlot(slot); if (stack != null && stack.getType() != Material.AIR) { this.items.add(new ItemStackWrapper(stack)); } } } this.dirty = false; }

Target:
public void update(@Nonnull Block b) { Config blockData = BlockStorage.getLocationInfo(b.getLocation()); String id = blockData.getString("id"); SlimefunItem item = SlimefunItem.getByID(id); BlockMenu menu = BlockStorage.getInventory(b.getLocation()); if (item == null || menu == null) { clear(false); } else if (id.equals("CARGO_NODE_OUTPUT")) { clear(true); } else { this.items.clear(); this.checkLore = Objects.equals(blockData.getString("filter-lore"), "true"); this.rejectOnMatch = !Objects.equals(blockData.getString("filter-type"), "whitelist"); for (int slot : CargoUtils.FILTER_SLOTS) { ItemStack stack = menu.getItemInSlot(slot); if (stack != null && stack.getType() != Material.AIR) { this.items.add(new ItemStackWrapper(stack)); } } } this.dirty = false; }
Source:
public MenuItem menu(String textToShow, List<String> menuItems, String defaultValue) { final List<String> copiedMenuItems = new ArrayList<>(menuItems); return messageSender.runAndWait(message -> setupUi.showMenuStep(message, textToShow, copiedMenuItems, defaultValue)); }

Target:
public MenuItem menu(String textToShow, List<String> menuItems, String defaultValue) { final List<String> copiedMenuItems = List.copyOf(menuItems); return messageSender .runAndWait(message -> setupUi.showMenuStep(message, textToShow, copiedMenuItems, defaultValue)); }
Source:
private Lock tryCreateLock(final LockOptions lockOptions) throws IOException { Object payload = redisClientDelegate.withScriptingClient(c -> { return c.eval( ACQUIRE_SCRIPT, Collections.singletonList(lockKey(lockOptions.getLockName())), Arrays.asList( Long.toString(lockOptions.getLeaseDuration().toMillis()), ownerName, Long.toString(clock.millis()), String.valueOf(lockOptions.getVersion()) ) ); }); if (payload == null) { throw new LockNotAcquiredException(String.format("Lock not acquired %s", lockOptions)); } return objectMapper.readValue(payload.toString(), Lock.class); }

Target:
private Lock tryCreateLock(final LockOptions lockOptions) { try { List<String> attributes = Optional.ofNullable(lockOptions.getAttributes()).orElse(Collections.emptyList()); Object payload = redisClientDelegate.withScriptingClient(c -> { return c.eval( ACQUIRE_SCRIPT, Collections.singletonList(lockKey(lockOptions.getLockName())), Arrays.asList( Long.toString(Duration.ofMillis(leaseDurationMillis).toMillis()), ownerName, Long.toString(clock.millis()), String.valueOf(lockOptions.getVersion()), lockOptions.getLockName(), String.join(";", attributes) )); }); if (payload == null) { throw new LockNotAcquiredException(String.format("Lock not acquired %s", lockOptions)); } return objectMapper.readValue(payload.toString(), Lock.class); } catch (IOException e) { throw new LockNotAcquiredException(String.format("Lock not acquired %s", lockOptions), e); } }
Source:
private void allocateMacsMissingInMacPool(MacPool macPool, Map<String, Long> preexistingMacsUsageFrequency, Map<String, Long> macsFromRequestUsageFrequency) { List<String> macsToAcquire = new LinkedList<>(); for (Map.Entry<String, Long> entry : macsFromRequestUsageFrequency.entrySet()) { String mac = entry.getKey(); Long targetUsage = entry.getValue(); Long currentUsage = preexistingMacsUsageFrequency.get(mac); long macToAcquire = currentUsage == null ? targetUsage : targetUsage - currentUsage; LongStream.range(0, macToAcquire).forEach(e -> macsToAcquire.add(mac)); } macPool.addMacs(macsToAcquire); }

Target:
private List<String> allocateMacsMissingInMacPool(MacPool macPool, Map<String, Long> preexistingMacsUsageFrequency, Map<String, Long> macsFromRequestUsageFrequency) { List<String> macsToAcquire = new LinkedList<>(); for (Map.Entry<String, Long> entry : macsFromRequestUsageFrequency.entrySet()) { String mac = entry.getKey(); Long targetUsage = entry.getValue(); Long currentUsage = preexistingMacsUsageFrequency.get(mac); long macToAcquire = currentUsage == null ? targetUsage : targetUsage - currentUsage; LongStream.range(0, macToAcquire).forEach(e -> macsToAcquire.add(mac)); } return macPool.addMacs(macsToAcquire); }
Source:
public synchronized void updateTo(ArrayList<BoxItem> items){ final HashMap<String, Integer> oldPositionMap = mItemsPositionMap; final Set<String> oldIds = oldPositionMap.keySet(); mItemsPositionMap = new HashMap<String, Integer>(items.size()); mItems.clear(); addAll(items); if (oldPositionMap.size() > mItems.size() ){ Iterator<Map.Entry<String,Integer>> iterator = oldPositionMap.entrySet().iterator(); while (iterator.hasNext()){ Map.Entry<String,Integer> entry = iterator.next(); if (mItemsPositionMap.containsKey(entry.getKey())){ iterator.remove(); } } mHandler.post(new Runnable() { @Override public void run() { for (Map.Entry<String, Integer> entry : oldPositionMap.entrySet()){ notifyItemRemoved(entry.getValue()); } notifyItemRangeChanged(0, mItems.size()); } }); } else { notifyChange(0, mItems.size()); } }

Target:
public synchronized void updateTo(ArrayList<BoxItem> items){ final HashMap<String, Integer> oldPositionMap = mItemsPositionMap; mItemsPositionMap = new HashMap<String, Integer>(items.size()); mItems.clear(); addAll(items); if (oldPositionMap.size() > mItems.size() ){ Iterator<Map.Entry<String,Integer>> iterator = oldPositionMap.entrySet().iterator(); while (iterator.hasNext()){ Map.Entry<String,Integer> entry = iterator.next(); if (mItemsPositionMap.containsKey(entry.getKey())){ iterator.remove(); } } mHandler.post(new Runnable() { @Override public void run() { for (Map.Entry<String, Integer> entry : oldPositionMap.entrySet()){ notifyItemRemoved(entry.getValue()); } notifyItemRangeChanged(0, mItems.size()); } }); } else { notifyChange(0, mItems.size()); } }
Source:
public void onInteractItem(PlayerInteractEvent.RightClickItem event) { if (!event.getEntityPlayer().isSneaking()) return; if (event.getItemStack().func_190926_b()) return; if (event.getItemStack().getItem() != Items.STICK) return; if (event.getItemStack().hasCapability(TEST_CAP, null)) { IExampleCapability cap = event.getItemStack().getCapability(TEST_CAP, null); cap.toggleVal(); System.out.println("Test value is now: " + (cap.getVal() ? "TRUE" : "FALSE")); } }

Target:
public void onInteractItem(PlayerInteractEvent.RightClickItem event) { if (!event.getEntityPlayer().isSneaking()) return; if (event.getItemStack().getItem() != Items.STICK) return; if (event.getItemStack().hasCapability(TEST_CAP, null)) { IExampleCapability cap = event.getItemStack().getCapability(TEST_CAP, null); cap.toggleVal(); System.out.println("Test value is now: " + (cap.getVal() ? "TRUE" : "FALSE")); } }
Source:
public void binaryExcludedFalse() throws SQLException { boolean original = P6LogOptions.getActiveInstance().getExcludebinary(); try { P6LogOptions.getActiveInstance().setExcludebinary(false); String paramValName = "param_val"; String paramIntName = "param_id"; String resultParamName = "result_param"; if( "HSQLDB".equals(db) ) { paramValName = "@p1"; paramIntName = "@p2"; resultParamName = "@p3"; } String query = "{call TEST_PROC_BINARY(?,?,?)}"; CallableStatement call = connection.prepareCall(query); call.setBytes(paramValName, "foo".getBytes(StandardCharsets.UTF_8)); call.setInt(paramIntName, TEST_IMG_ID); call.registerOutParameter(resultParamName, Types.BLOB); call.execute(); call.close(); assertTrue(getLastLogEntry().contains("{call TEST_PROC_BINARY(?,?,?)} @p2:2000, @p1:'666F6F'")); } finally { P6LogOptions.getActiveInstance().setExcludebinary(original); } }

Target:
public void binaryExcludedFalse() throws SQLException { P6LogOptions.getActiveInstance().setExcludebinary(false); String paramValName = "param_val"; String paramIntName = "param_id"; String resultParamName = "result_param"; if( "HSQLDB".equals(db) ) { paramValName = "@p1"; paramIntName = "@p2"; resultParamName = "@p3"; } String query = "{call test_proc_binary(?,?,?)}"; CallableStatement call = connection.prepareCall(query); call.setBytes(paramValName, "foo".getBytes(StandardCharsets.UTF_8)); call.setInt(paramIntName, TEST_IMG_ID); call.registerOutParameter(resultParamName, Types.INTEGER); call.execute(); call.close(); assertTrue( getLastLogEntry().contains("{call test_proc_binary(?,?,?)} " + paramIntName + ":2000, " + paramValName + ":'666F6F'") || getLastLogEntry().contains("{call test_proc_binary(?,?,?)} " + paramValName + ":'666F6F', " + paramIntName + ":2000")); }
Source:
public Property getProperty(String name) { Property reservedProperty = getReservedProperty(name); if (reservedProperty != null) { return reservedProperty; } Iterator<Property> propertiesWithName = getProperties(name).iterator(); if (propertiesWithName.hasNext()) { return propertiesWithName.next(); } return null; }

Target:
public Property getProperty(String name) { Iterator<Property> propertiesWithName = getProperties(name).iterator(); if (propertiesWithName.hasNext()) { return propertiesWithName.next(); } return null; }