auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Group createAuthenticationGroup(final Composite parent) { final Group g = createGroup(parent, UIText.RepositorySelectionPage_groupAuthentication); newLabel(g, UIText.RepositorySelectionPage_promptUser + ":"); userText = new Text(g, SWT.BORDER); userText.setLayoutData(createFieldGridData()); userText.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { setURI(uri.setUser(nullString(userText.getText()))); user = userText.getText(); } }); newLabel(g, UIText.RepositorySelectionPage_promptPassword + ":"); passText = new Text(g, SWT.BORDER | SWT.PASSWORD); passText.setLayoutData(createFieldGridData()); passText.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { setURI(uri.setPass(null)); password = passText.getText(); } }); newLabel(g, "Store in Secure Store"); storeCheckbox = new Button(g, SWT.CHECK); storeCheckbox.setSelection(storeInSecureStore); storeCheckbox.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { storeInSecureStore = storeCheckbox.getSelection(); } public void widgetDefaultSelected(SelectionEvent e) { storeInSecureStore = storeCheckbox.getSelection(); } }); return g; }

Target:
private Group createAuthenticationGroup(final Composite parent) { final Group g = createGroup(parent, UIText.RepositorySelectionPage_groupAuthentication); newLabel(g, UIText.RepositorySelectionPage_promptUser + ":"); userText = new Text(g, SWT.BORDER); userText.setLayoutData(createFieldGridData()); userText.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { setURI(uri.setUser(nullString(userText.getText()))); user = userText.getText(); } }); newLabel(g, UIText.RepositorySelectionPage_promptPassword + ":"); passText = new Text(g, SWT.BORDER | SWT.PASSWORD); passText.setLayoutData(createFieldGridData()); passText.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { setURI(uri.setPass(null)); password = passText.getText(); } }); newLabel(g, UIText.RepositorySelectionPage_storeInSecureStore); storeCheckbox = new Button(g, SWT.CHECK); storeCheckbox.setSelection(storeInSecureStore); storeCheckbox.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { storeInSecureStore = storeCheckbox.getSelection(); } public void widgetDefaultSelected(SelectionEvent e) { storeInSecureStore = storeCheckbox.getSelection(); } }); return g; }
Source:
public boolean start() { for (int i = 0; i < memberCount; i++) { Task task = this.getTask(); TaskDescription taskDescription = new TaskDescription(); taskDescription.setName(TASK_PREFIX + name + i); taskDescription.setTaskGroup(MessageProcessorConstants.SCHEDULED_MESSAGE_PROCESSOR_GROUP); if (interval < MessageProcessorConstants.THRESHOULD_INTERVAL) { taskDescription.setInterval(MessageProcessorConstants.THRESHOULD_INTERVAL); } else { taskDescription.setInterval(interval); } taskDescription.setIntervalInMs(true); taskDescription.addResource(TaskDescription.INSTANCE, task); taskDescription.addResource(TaskDescription.CLASSNAME, task.getClass().getName()); if (cronExpression != null) { taskDescription.setCronExpression(cronExpression); } taskManager.schedule(taskDescription); } logger.info("Started message processor. [" + getName() + "]."); return true; }

Target:
public boolean start() { for (int i = 0; i < memberCount; i++) { Task task = this.getTask(); TaskDescription taskDescription = new TaskDescription(); taskDescription.setName(TASK_PREFIX + name + i); taskDescription.setTaskGroup(MessageProcessorConstants.SCHEDULED_MESSAGE_PROCESSOR_GROUP); if (interval < MessageProcessorConstants.THRESHOULD_INTERVAL) { taskDescription.setInterval(MessageProcessorConstants.THRESHOULD_INTERVAL); } else { taskDescription.setInterval(interval); } taskDescription.setIntervalInMs(true); taskDescription.addResource(TaskDescription.INSTANCE, task); taskDescription.addResource(TaskDescription.CLASSNAME, task.getClass().getName()); if (cronExpression != null) { taskDescription.setCronExpression(cronExpression); } taskManager.schedule(taskDescription); } logger.info("Started message processor: [" + getName() + "]."); return true; }
Source:
public void testHardwareFlavourToHardware() { server.enqueue( new MockResponse().setBody(stringFromResource("/compute/hardware.json")) ); org.apache.jclouds.oneandone.rest.domain.HardwareFlavour hardware = api.serverApi().getHardwareFlavour("some-id"); Hardware actual = fnHardware.apply(hardware); int MinRamSize = (int) hardware.hardware().ram(); if (hardware.hardware().ram() < 1) { MinRamSize = 1; } List<Volume> volumes = new ArrayList<Volume>(); for (HardwareFlavour.Hardware.Hdd hdd : hardware.hardware().hdds()) { Volume vol = new VolumeBuilder() .bootDevice(hdd.isMain()) .device("hdd") .type(Volume.Type.LOCAL) .size((float) hdd.size()) .build(); volumes.add(vol); } List<Processor> processors = new ArrayList<Processor>(); for (int i = 0; i < hardware.hardware().vcore(); i++) { Processor proc = new Processor(hardware.hardware().coresPerProcessor(), 1); processors.add(proc); } Hardware expected = new HardwareBuilder() .ids(hardware.id()) .name(hardware.name()) .ram(MinRamSize) .volumes(volumes) .processors(ImmutableList.copyOf(processors)).build(); assertEquals(actual, expected); }

Target:
public void testHardwareFlavourToHardware() { List<Hdd> sourceHdds = new ArrayList<Hdd>(); Hdd sourceHdd = Hdd.create("GB", 40, true); sourceHdds.add(sourceHdd); org.apache.jclouds.oneandone.rest.domain.HardwareFlavour.Hardware hrdware = org.apache.jclouds.oneandone.rest.domain.HardwareFlavour.Hardware.create(null, 1, 1, 1, sourceHdds); org.apache.jclouds.oneandone.rest.domain.HardwareFlavour hardware = HardwareFlavour.create("65929629F35BBFBA63022008F773F3EB", "name", hrdware); Hardware actual = fnHardware.apply(hardware); int MinRamSize = (int) hardware.hardware().ram(); if (hardware.hardware().ram() < 1) { MinRamSize = 1; } List<Volume> volumes = new ArrayList<Volume>(); for (HardwareFlavour.Hardware.Hdd hdd : hardware.hardware().hdds()) { Volume vol = new VolumeBuilder() .bootDevice(hdd.isMain()) .device("hdd") .type(Volume.Type.LOCAL) .size((float) hdd.size()) .build(); volumes.add(vol); } List<Processor> processors = new ArrayList<Processor>(); for (int i = 0; i < hardware.hardware().vcore(); i++) { Processor proc = new Processor(hardware.hardware().coresPerProcessor(), 1); processors.add(proc); } Hardware expected = new HardwareBuilder() .ids(hardware.id()) .name(hardware.name()) .ram(MinRamSize) .volumes(volumes) .processors(ImmutableList.copyOf(processors)).build(); assertEquals(actual, expected); }
Source:
public HttpRequestIntent httpRequestIntent() { final JsonNode variables = getVariables(); final String variablesPart = variables == null ? null : String.format("\"variables\": %s", variables); final String queryPart = String.format("\"query\": \"%s\"", getQuery().replace("\n", "\\n").replace("\"", "\\\"")); final String body = Stream.of(queryPart, variablesPart) .filter(Objects::nonNull) .collect(joining(",", "{", "}")); return HttpRequestIntent.of(HttpMethod.POST, "/graphql", body); }

Target:
public HttpRequestIntent httpRequestIntent() { final JsonNode variables = getVariables(); final String variablesPart = variables == null ? null : String.format("\"variables\": %s", Json.stringify(variables)); final String queryPart = String.format("\"query\": \"%s\"", getQuery().replace("\n", "\\n").replace("\"", "\\\"")); final String body = Stream.of(queryPart, variablesPart) .filter(Objects::nonNull) .collect(joining(",", "{", "}")); return HttpRequestIntent.of(HttpMethod.POST, "/graphql", body); }
Source:
public static String writeImageDataToGcs(String googleId, byte[] imageData) throws IOException { GcsFilename gcsFilename = new GcsFilename(Config.GCS_BUCKETNAME, googleId); GcsOutputChannel outputChannel = GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance()) .createOrReplace(gcsFilename, new GcsFileOptions.Builder().mimeType("image/png").build()); outputChannel.write(ByteBuffer.wrap(imageData)); outputChannel.close(); return BlobstoreServiceFactory.getBlobstoreService() .createGsBlobKey("/gs/" + Config.GCS_BUCKETNAME + "/" + googleId).getKeyString(); }

Target:
public static String writeImageDataToGcs(String googleId, byte[] imageData) throws IOException { GcsFilename gcsFilename = new GcsFilename(Config.GCS_BUCKETNAME, googleId); try (GcsOutputChannel outputChannel = GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance()) .createOrReplace(gcsFilename, new GcsFileOptions.Builder().mimeType("image/png").build())) { outputChannel.write(ByteBuffer.wrap(imageData)); } return BlobstoreServiceFactory.getBlobstoreService() .createGsBlobKey("/gs/" + Config.GCS_BUCKETNAME + "/" + googleId).getKeyString(); }
Source:
public void setAnyTextAttributes(List<String> anyTextAttributes) { this.anyTextAttributes.clear(); if (CollectionUtils.isNotEmpty(anyTextAttributes)) { this.anyTextAttributes.addAll(anyTextAttributes); } if (metacardClient instanceof CacheSolrMetacardClient) { ((CacheSolrMetacardClient) metacardClient).setAnyTextAttributes(anyTextAttributes); } }

Target:
public void setAnyTextAttributes(List<String> anyTextAttributes) { this.anyTextAttributes.clear(); if (CollectionUtils.isNotEmpty(anyTextAttributes)) { this.anyTextAttributes.addAll(anyTextAttributes); } metacardClient.setAnyTextAttributes(anyTextAttributes); }
Source:
public TaskBatchExecutionListenerFactoryBean taskBatchExecutionListener(TaskExplorer taskExplorer) { if(!CollectionUtils.isEmpty(dataSources) && dataSources.size() == 1) { return new TaskBatchExecutionListenerFactoryBean( dataSources.iterator().next(), taskExplorer, taskProperties.getTablePrefix()); } else if(CollectionUtils.isEmpty(dataSources)) { return new TaskBatchExecutionListenerFactoryBean(null, taskExplorer); } else { throw new IllegalStateException("Expected one datasource and found " + dataSources.size()); } }

Target:
public TaskBatchExecutionListenerFactoryBean taskBatchExecutionListener(TaskExplorer taskExplorer) { TaskConfigurer taskConfigurer = null; if(!context.getBeansOfType(TaskConfigurer.class).isEmpty()) { taskConfigurer = context.getBean(TaskConfigurer.class); } if(taskConfigurer != null && taskConfigurer.getTaskDataSource() != null) { return new TaskBatchExecutionListenerFactoryBean( taskConfigurer.getTaskDataSource(), taskExplorer); } else { return new TaskBatchExecutionListenerFactoryBean(null, taskExplorer); } }
Source:
public Func1<ManualInput, ManualInput> createAnomalyFunc(final Anomaly an) { return new Func1<ManualInput, ManualInput>() { int cellsPerColumn = connections.getCellsPerColumn(); @Override public ManualInput call(ManualInput t1) { int[] ffActiveCols = t1.getFeedForwardSparseActives(); int[] prevPredictedCols = SDR.cellsAsColumnIndices(t1.getPreviousPredictiveCells(), cellsPerColumn); if(ffActiveCols == null || t1.getPreviousPredictiveCells() == null) { return t1.anomalyScore(1.0); } return t1.anomalyScore(an.compute(ffActiveCols, prevPredictedCols, 0, 0)); } }; }

Target:
public Func1<ManualInput, ManualInput> createAnomalyFunc(final Anomaly an) { return new Func1<ManualInput, ManualInput>() { @Override public ManualInput call(ManualInput mi) { int[] ffActiveCols = mi.getFeedForwardSparseActives(); if(ffActiveCols == null || mi.getPreviousPredictiveCells() == null) { return mi.anomalyScore(1.0); } int[] prevPredictedCols = Cell.asColumnList(mi.getPreviousPredictiveCells()); return mi.anomalyScore(anomalyComputer.compute(ffActiveCols, prevPredictedCols, 0, 0)); } }; }
Source:
private static ArrayList<String> getDatadogTags(String datadogTags) { ArrayList<String> tags = new ArrayList<>(); for (String tag : datadogTags.split(",")) { tags.add(tag); } return tags; }

Target:
private static ArrayList<String> getDatadogTags(String datadogTags) { ArrayList<String> tags = new ArrayList<>(); for (String tag : datadogTags.split(",")) { if (!StringUtils.isEmpty(tag)) { tags.add(tag); } } return tags; }
Source:
private void selectRepresentationElements(ISelection selection, DialectEditor dialectEditor) { List<DRepresentationElement> representationElements = getRepresentationElements(dialectEditor.getRepresentation(), ((IStructuredSelection) selection).toList()); if (!representationElements.isEmpty()) { DialectUIManager.INSTANCE.selectAndReveal(dialectEditor, representationElements); } }

Target:
private void selectRepresentationElements(ISelection selection, DialectEditor dialectEditor) { List<DRepresentationElement> representationElements = getRepresentationElements(dialectEditor.getRepresentation(), ((IStructuredSelection) selection).toList()); DialectUIManager.INSTANCE.selectAndReveal(dialectEditor, representationElements); }
Source:
public Response killPendingSegments( @PathParam("dataSource") String dataSource, @QueryParam("interval") String deleteIntervalString, @Context HttpServletRequest request ) { final Interval deleteInterval = Intervals.of(deleteIntervalString); final Access authResult = AuthorizationUtils.authorizeAllResourceActions( request, ImmutableList.of( new ResourceAction(new Resource(dataSource, ResourceType.DATASOURCE), Action.READ), new ResourceAction(new Resource(dataSource, ResourceType.DATASOURCE), Action.WRITE) ), authorizerMapper ); if (!authResult.isAllowed()) { throw new ForbiddenException(authResult.toString()); } if (taskMaster.isLeader()) { final int numDeleted = indexerMetadataStorageAdapter.deletePendingSegments(dataSource, deleteInterval); return Response.ok().entity(ImmutableMap.of("numDeleted", numDeleted)).build(); } else { return Response.status(Status.SERVICE_UNAVAILABLE).build(); } }

Target:
public Response killPendingSegments( @PathParam("dataSource") String dataSource, @QueryParam("interval") String deleteIntervalString, @Context HttpServletRequest request ) { final Interval deleteInterval = Intervals.of(deleteIntervalString); final Access authResult = AuthorizationUtils.authorizeAllResourceActions( request, ImmutableList.of( new ResourceAction(new Resource(dataSource, ResourceType.DATASOURCE), Action.READ), new ResourceAction(new Resource(dataSource, ResourceType.DATASOURCE), Action.WRITE) ), authorizerMapper ); if (!authResult.isAllowed()) { throw new ForbiddenException(authResult.getMessage()); } if (taskMaster.isLeader()) { final int numDeleted = indexerMetadataStorageAdapter.deletePendingSegments(dataSource, deleteInterval); return Response.ok().entity(ImmutableMap.of("numDeleted", numDeleted)).build(); } else { return Response.status(Status.SERVICE_UNAVAILABLE).build(); } }
Source:
public void writeGuestbookAndStartDownload(GuestbookResponse guestbookResponse){ if (guestbookResponse.getDataFile() != null) logger.info("FDL File: " + guestbookResponse.getDataFile().getId()); if (guestbookResponse.getSelectedFileIds() != null) { logger.info("FDL File Ids: " + guestbookResponse.getSelectedFileIds()); String[] fileIds = guestbookResponse.getSelectedFileIds().split(","); if (fileIds.length == 1) { logger.info("FDL: id: " + fileIds[0]); DataFile df = datafileService.findCheapAndEasy(Long.parseLong(fileIds[0])); if (df != null) logger.info("FDL: Have df"); guestbookResponse.setDataFile(df); } } if (guestbookResponse != null && guestbookResponse.getDataFile() != null ){ writeGuestbookResponseRecord(guestbookResponse); callDownloadServlet(guestbookResponse.getFileFormat(), guestbookResponse.getDataFile().getId(), true); } if (guestbookResponse != null && guestbookResponse.getDataFile() == null && guestbookResponse.getSelectedFileIds() != null ){ List<String> list = new ArrayList<>(Arrays.asList(guestbookResponse.getSelectedFileIds().split(","))); for (String idAsString : list) { DataFile df = datafileService.findCheapAndEasy(new Long(idAsString)) ; if (df != null) { guestbookResponse.setDataFile(df); writeGuestbookResponseRecord(guestbookResponse); } } callDownloadServlet(guestbookResponse.getSelectedFileIds(), true); } }

Target:
public void writeGuestbookAndStartDownload(GuestbookResponse guestbookResponse){ if (guestbookResponse.getSelectedFileIds() != null) { String[] fileIds = guestbookResponse.getSelectedFileIds().split(","); if (fileIds.length == 1) { DataFile df = datafileService.findCheapAndEasy(Long.parseLong(fileIds[0])); guestbookResponse.setDataFile(df); } } if (guestbookResponse != null && guestbookResponse.getDataFile() != null ){ writeGuestbookResponseRecord(guestbookResponse); callDownloadServlet(guestbookResponse.getFileFormat(), guestbookResponse.getDataFile().getId(), true); } if (guestbookResponse != null && guestbookResponse.getDataFile() == null && guestbookResponse.getSelectedFileIds() != null ){ List<String> list = new ArrayList<>(Arrays.asList(guestbookResponse.getSelectedFileIds().split(","))); for (String idAsString : list) { DataFile df = datafileService.findCheapAndEasy(new Long(idAsString)) ; if (df != null) { guestbookResponse.setDataFile(df); writeGuestbookResponseRecord(guestbookResponse); } } callDownloadServlet(guestbookResponse.getSelectedFileIds(), true); } }
Source:
private KeyValueCollectionPermission isPermitted( CollectionPermission subject, KeyValueCollectionPermission match, KeyValueCollectionPermission allPerms) { List<KeyValuePermission> permissions = getPermissions(allPerms); Map<String, Set<String>> grouped = groupPermissionsByKey(permissions); if (Collections.disjoint(grouped.keySet(), SHARED_PERMISSIONS_IMPLIED)) { return match; } boolean isSystem = system(subject); boolean isOwner = owner(subject, grouped); boolean hasAccessIndividuals = individuals(subject, grouped); boolean hasAccessGroups = groups(subject, grouped); Supplier<Set<String>> impliedPermissions = () -> { if (isSystem || isOwner) { return grouped.keySet(); } else if (hasAccessIndividuals || hasAccessGroups) { return SHARED_PERMISSIONS_IMPLIED; } else { return Constants.SHAREABLE_TAGS; } }; Function<Set<String>, KeyValueCollectionPermission> filterPermissions = (impliedKeys) -> { KeyValueCollectionPermission implied = new KeyValueCollectionPermission( match.getAction(), impliedKeys .stream() .map(key -> new KeyValuePermission(key, grouped.get(key))) .collect(Collectors.toList())); List<Permission> remaining = allPerms .<Permission>getKeyValuePermissionList() .stream() .filter(p -> !implied.implies(p)) .collect(Collectors.toList()); KeyValueCollectionPermission collection = new KeyValueCollectionPermission(match.getAction()); collection.addAll(remaining); return collection; }; return filterPermissions.apply(impliedPermissions.get()); }

Target:
private KeyValueCollectionPermission isPermitted( CollectionPermission subject, KeyValueCollectionPermission match, KeyValueCollectionPermission allPerms) { List<KeyValuePermission> permissions = getPermissions(match); Map<String, Set<String>> grouped = groupPermissionsByKey(permissions); if (Collections.disjoint(grouped.keySet(), SHARED_PERMISSIONS_IMPLIED)) { return match; } boolean isSystem = systemImplied(subject); boolean isOwner = ownerImplied(subject, grouped); boolean hasAccessIndividuals = individualsImplied(subject, grouped); boolean hasAccessGroups = groupsImplied(subject, grouped); Set<String> impliedKeys = Constants.SHAREABLE_TAGS; if (hasAccessIndividuals || hasAccessGroups) { impliedKeys = SHARED_PERMISSIONS_IMPLIED; } if (isSystem || isOwner) { impliedKeys = grouped.keySet(); } KeyValueCollectionPermission implied = new KeyValueCollectionPermission( match.getAction(), impliedKeys .stream() .map(key -> new KeyValuePermission(key, grouped.get(key))) .collect(Collectors.toList())); List<Permission> remaining = match .<Permission>getKeyValuePermissionList() .stream() .filter(p -> !implied.implies(p)) .collect(Collectors.toList()); KeyValueCollectionPermission collection = new KeyValueCollectionPermission(match.getAction()); collection.addAll(remaining); return collection; }
Source:
public Object combine(Object lhs, Object rhs) { return ((Number) lhs).longValue() + ((Number) rhs).longValue(); }

Target:
public Object combine(Object lhs, Object rhs) { if (lhs == null && rhs == null) { return 0L; } if (rhs == null) { return ((Number) lhs).longValue(); } if (lhs == null) { return ((Number) rhs).longValue(); } return ((Number) lhs).longValue() + ((Number) rhs).longValue(); }
Source:
public void onDrawerSpecialItemClick(MenuItem item) { final ArrayList<TaggedEventSeries> currentEventSeries = App.getInstance().currentTaggedEventSeries(); for (TaggedEventSeries taggedEventSeries : currentEventSeries) { if (getString(taggedEventSeries.getTitleResId()) == item.getTitle()) { Bundle special = new Bundle(); special.putString(Const.EXTRA_TAGGED_EVENT_CACHEKEY, taggedEventSeries.getTag()); special.putParcelable(Const.EXTRA_TAGGED_EVENT, taggedEventSeries); navigateTo(TaggedEventSeriesActivity.class, special); break; } } }

Target:
public void onDrawerSpecialItemClick(MenuItem item) { final ArrayList<TaggedEventSeries> currentEventSeries = App.getInstance().currentTaggedEventSeries(); for (TaggedEventSeries taggedEventSeries : currentEventSeries) { if (getString(taggedEventSeries.getTitleResId()).equals(item.getTitle())) { Bundle special = new Bundle(); special.putString(Const.EXTRA_TAGGED_EVENT_CACHEKEY, taggedEventSeries.getTag()); special.putParcelable(Const.EXTRA_TAGGED_EVENT, taggedEventSeries); navigateTo(TaggedEventSeriesActivity.class, special); break; } } }
Source:
public void testCheck() throws Exception { final DefaultConfiguration config = createModuleConfig(AnnotationOnSameLineCheck.class); final String[] expected = { "9: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), "10: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SomeClass"), }; verify(config, getPath("InputAnnotationOnSameLineCheck.java"), expected); }

Target:
public void testCheck() throws Exception { final DefaultConfiguration config = createModuleConfig(AnnotationOnSameLineCheck.class); final String[] expected = { "9: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), "10: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), "11: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Deprecated"), }; verify(config, getPath("InputAnnotationOnSameLineCheck.java"), expected); }
Source:
public static List<ProtoGrade> gradingRequestHandler(final Institution institution, final ItemRequest request, final String authId) throws DatabaseAccessException, InvalidProtocolBufferException, AuthenticationException { final GradingQuery query = GradingQuery.parseFrom(request.getAdvanceQuery()); final boolean instructor = query.getPermissionLevel() == GradingQuery.PermissionLevel.INSTRUCTOR; final boolean student = query.getPermissionLevel() == GradingQuery.PermissionLevel.STUDENT; final boolean allGrades = query.getSearchType() == GradingQuery.SearchType.ALL_GRADES; final boolean singleGrade = query.getSearchType() == GradingQuery.SearchType.SINGLE_GRADE; LOG.debug("Query State instructor: {}, student: {}, allGrades: {}, singleGrade: {}", instructor, student, allGrades, singleGrade); List<ProtoGrade> returnList = new ArrayList<>(); if (instructor && allGrades) { returnList = institution.getAllAssignmentGradesInstructor(request.getItemId(COURSE_INDEX), authId); } else if (student && allGrades) { returnList = institution.getAllAssignmentGradesStudent(request.getItemId(COURSE_INDEX), authId); } else { final ProtoGrade gradeData = ProtoGrade.newBuilder() .setUserId(request.getItemId(USER_INDEX)) .setCourseId(request.getItemId(COURSE_INDEX)) .setAssignmentId(request.getItemId(ASSIGNMENT_INDEX)) .setProblemId(request.getItemId(PROBLEM_INDEX)) .build(); if (instructor && singleGrade) { returnList.add(institution.getGrade(authId, gradeData)); } else if (student && singleGrade) { returnList.add(institution.getGrade(authId, gradeData)); } } return returnList; }

Target:
public static List<ProtoGrade> gradingRequestHandler(final Institution institution, final ItemRequest request, final String authId) throws DatabaseAccessException, InvalidProtocolBufferException, AuthenticationException { final GradingQuery query = GradingQuery.parseFrom(request.getAdvanceQuery()); final boolean instructor = query.getPermissionLevel() == GradingQuery.PermissionLevel.INSTRUCTOR; final boolean student = query.getPermissionLevel() == GradingQuery.PermissionLevel.STUDENT; final boolean allGrades = query.getSearchType() == GradingQuery.SearchType.ALL_GRADES; final boolean singleGrade = query.getSearchType() == GradingQuery.SearchType.SINGLE_GRADE; LOG.debug("Query State instructor: {}, student: {}, allGrades: {}, singleGrade: {}", instructor, student, allGrades, singleGrade); List<ProtoGrade> returnList = new ArrayList<>(); if (instructor && allGrades) { returnList = institution.getAllAssignmentGradesInstructor(request.getItemId(COURSE_INDEX), authId); } else if (student && allGrades) { returnList = institution.getAllAssignmentGradesStudent(request.getItemId(COURSE_INDEX), authId); } else { final ProtoGrade gradeData = ProtoGrade.newBuilder() .setUserId(request.getItemId(USER_INDEX)) .setCourseId(request.getItemId(COURSE_INDEX)) .setAssignmentId(request.getItemId(ASSIGNMENT_INDEX)) .setProblemId(request.getItemId(PROBLEM_INDEX)) .build(); returnList.add(institution.getGrade(authId, gradeData)); } return returnList; }
Source:
private void applyIncludes(Node source, final Properties variablesContext) { if (source.getNodeName().equals("include")) { Properties fullContext; String refid = getStringAttribute(source, "refid"); refid = PropertyParser.parse(refid, variablesContext); Node toInclude = findSqlFragment(refid); Properties newVariablesContext = getVariablesContext(source); if (!newVariablesContext.isEmpty()) { for (Object name : newVariablesContext.keySet()) { newVariablesContext.put(name, PropertyParser.parse(newVariablesContext.get(name).toString(), variablesContext)); } applyInheritedContext(newVariablesContext, variablesContext); fullContext = newVariablesContext; } else { fullContext = variablesContext; } applyIncludes(toInclude, fullContext); if (toInclude.getOwnerDocument() != source.getOwnerDocument()) { toInclude = source.getOwnerDocument().importNode(toInclude, true); } source.getParentNode().replaceChild(toInclude, source); while (toInclude.hasChildNodes()) { toInclude.getParentNode().insertBefore(toInclude.getFirstChild(), toInclude); } toInclude.getParentNode().removeChild(toInclude); } else if (source.getNodeType() == Node.ELEMENT_NODE) { NodeList children = source.getChildNodes(); for (int i=0; i<children.getLength(); i++) { applyIncludes(children.item(i), variablesContext); } } else if (source.getNodeType() == Node.ATTRIBUTE_NODE && !variablesContext.isEmpty()) { source.setNodeValue(PropertyParser.parse(source.getNodeValue(), variablesContext)); } else if (source.getNodeType() == Node.TEXT_NODE && !variablesContext.isEmpty()) { source.setNodeValue(PropertyParser.parse(source.getNodeValue(), variablesContext)); } }

Target:
private void applyIncludes(Node source, final Properties variablesContext) { if (source.getNodeName().equals("include")) { Properties fullContext; String refid = getStringAttribute(source, "refid"); refid = PropertyParser.parse(refid, variablesContext); Node toInclude = findSqlFragment(refid); Properties newVariablesContext = getVariablesContext(source, variablesContext); if (!newVariablesContext.isEmpty()) { fullContext = new Properties(); fullContext.putAll(variablesContext); fullContext.putAll(newVariablesContext); } else { fullContext = variablesContext; } applyIncludes(toInclude, fullContext); if (toInclude.getOwnerDocument() != source.getOwnerDocument()) { toInclude = source.getOwnerDocument().importNode(toInclude, true); } source.getParentNode().replaceChild(toInclude, source); while (toInclude.hasChildNodes()) { toInclude.getParentNode().insertBefore(toInclude.getFirstChild(), toInclude); } toInclude.getParentNode().removeChild(toInclude); } else if (source.getNodeType() == Node.ELEMENT_NODE) { NodeList children = source.getChildNodes(); for (int i=0; i<children.getLength(); i++) { applyIncludes(children.item(i), variablesContext); } } else if (source.getNodeType() == Node.ATTRIBUTE_NODE && !variablesContext.isEmpty()) { source.setNodeValue(PropertyParser.parse(source.getNodeValue(), variablesContext)); } else if (source.getNodeType() == Node.TEXT_NODE && !variablesContext.isEmpty()) { source.setNodeValue(PropertyParser.parse(source.getNodeValue(), variablesContext)); } }
Source:
public void selectFileByName(String nameOfFile) { WebElement webElement = new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC) .until( visibilityOfElementLocated( By.xpath(format(Locators.FILE_NAME_LIST_SELECT, nameOfFile)))); webElement.click(); WaitUtils.sleepQuietly(500, MILLISECONDS); actionsFactory.createAction(seleniumWebDriver).doubleClick(webElement).perform(); }

Target:
public void selectFileByName(String nameOfFile) { WebElement webElement = new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC) .until( visibilityOfElementLocated( By.xpath(format(Locators.FILE_NAME_LIST_SELECT, nameOfFile)))); webElement.click(); testWebElementRenderChecker.waitElementIsRendered(webElement); actionsFactory.createAction(seleniumWebDriver).doubleClick(webElement).perform(); }
Source:
private Geometry onlyLines(Geometry result) { if ((result instanceof LineString) || (result instanceof MultiLineString)) return result; List lines = com.vividsolutions.jts.geom.util.LineStringExtracter.getLines(result); if (lines.size() == 0) return null; if (lines.size() == 1) return (LineString) lines.get(0); return new MultiLineString((LineString[]) lines.toArray(new LineString[lines.size()]), result.getFactory()); }

Target:
private Geometry onlyLines(Geometry result) { if ((result instanceof LineString) || (result instanceof MultiLineString)) { return result; } List lines = com.vividsolutions.jts.geom.util.LineStringExtracter.getLines(result); if (lines.size() == 0) { return null; } if (lines.size() == 1) { return (LineString) lines.get(0); } return new MultiLineString((LineString[]) lines.toArray(new LineString[lines.size()]), result.getFactory()); }
Source:
public static <T> Stream<T> getStream(Iterator<T> iterator) { Iterable<T> iterable = () -> iterator; return getStream(iterable); }

Target:
public static <T> Stream<T> getStream(Iterator<T> iterator) { Spliterator<T> spliterator = Spliterators.spliteratorUnknownSize(iterator, 0); return StreamSupport.stream(spliterator, false); }
Source:
public void write(T objectToWrite) throws IOException { if (objectsSorted && prevObject != null && strategy.compare(prevObject, objectToWrite) >= 0) { objectsSorted = false; } byte[] bytesToWrite = strategy.toBytes(objectToWrite); ++numWritten; valuesOut.write(Ints.toByteArray(bytesToWrite.length)); valuesOut.write(bytesToWrite); headerOut.write(Ints.toByteArray((int) valuesOut.getCount())); headerOutLong.write(Longs.toByteArray(valuesOut.getCount())); if (getSerializedSize() > fileSizeLimit) { requireMultipleFiles = true; } prevObject = objectToWrite; }

Target:
public void write(T objectToWrite) throws IOException { if (objectsSorted && prevObject != null && strategy.compare(prevObject, objectToWrite) >= 0) { objectsSorted = false; } byte[] bytesToWrite = strategy.toBytes(objectToWrite); ++numWritten; valuesOut.write(Ints.toByteArray(bytesToWrite.length)); valuesOut.write(bytesToWrite); if (!requireMultipleFiles) { writeIntValueToOutputStream(buf, Ints.checkedCast(valuesOut.getCount()), headerOut); } else { writeLongValueToOutputStream(buf, valuesOut.getCount(), headerOutLong); } if (!requireMultipleFiles && getSerializedSize() > fileSizeLimit) { requireMultipleFiles = true; initializeHeaderOutLong(); buf = ByteBuffer.allocate(Longs.BYTES).order(ByteOrder.nativeOrder()); } prevObject = objectToWrite; }
Source:
private boolean toggleChild(TableRow row, Question rowQuestion, Question childQuestion) { if (childQuestion.getId_question().equals(rowQuestion.getId_question())) { Survey survey = SurveyFragmentStrategy.getSessionSurveyByQuestion(rowQuestion); if (rowQuestion.isHiddenBySurveyAndHeader(survey)) { row.clearFocus(); row.setVisibility(View.GONE); ((CommonQuestionView) row.getChildAt(0)).setActive(false); Object inputView = ((AKeyboardQuestionView) row.getChildAt(0)).getInputView(); Validation.getInstance().removeInputError(inputView); hideDefaultValue(rowQuestion); } else { row.setVisibility(View.VISIBLE); ((CommonQuestionView) row.getChildAt(0)).setActive(true); Object inputView = ((AKeyboardQuestionView) row.getChildAt(0)).getInputView(); Validation.getInstance().addInput(inputView); showDefaultValue(row, rowQuestion); } return true; } return false; }

Target:
private boolean toggleChild(TableRow row, Question rowQuestion, Question childQuestion) { if (childQuestion.getId_question().equals(rowQuestion.getId_question())) { Survey survey = SurveyFragmentStrategy.getSessionSurveyByQuestion(rowQuestion); if (rowQuestion.isHiddenBySurveyAndHeader(survey)) { row.clearFocus(); row.setVisibility(View.GONE); ((CommonQuestionView) row.getChildAt(0)).deactivateQuestion(); hideDefaultValue(rowQuestion); } else { row.setVisibility(View.VISIBLE); ((CommonQuestionView) row.getChildAt(0)).activateQuestion(); showDefaultValue(row, rowQuestion); } return true; } return false; }
Source:
public void receiveHeader(PacketLineIn pckIn) throws IOException { try { String s = pckIn.readStringRaw(); if (!s.startsWith(VERSION)) throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "expected push certificate version")); String version = s.substring(VERSION.length()); if (!version.equals("0.1\n")) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "version not supported")); } pusher = parseNextLine(pckIn, PUSHER, "expected pusher"); pushee = parseNextLine(pckIn, PUSHEE, "expected pushee"); receivedNonce = parseNextLine(pckIn, NONCE, "expected nonce"); parseNextLine(pckIn, "\n", "expected new line"); } catch (EOFException eof) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "broken push certificate Header")); } nonceStatus = nonceGenerator.verify(receivedNonce, sentNonce, seed, db, nonceSlopLimit); }

Target:
public void receiveHeader(PacketLineIn pckIn) throws IOException { try { String s = pckIn.readString(); String version = parseNextLine(pckIn, VERSION); if (!version.equals("0.1")) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "version not supported")); } pusher = parseNextLine(pckIn, PUSHER); pushee = parseNextLine(pckIn, PUSHEE); receivedNonce = parseNextLine(pckIn, NONCE); if (pckIn.readString() != "") { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "expected empty line after header")); } } catch (EOFException eof) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "broken push certificate Header")); } nonceStatus = nonceGenerator.verify(receivedNonce, sentNonce, seed, db, nonceSlopLimit); }
Source:
public void shouldFailUpdatePasswordContainsOnlyDigits() throws Exception { final User user = createUser(); final String newPassword = "12345678"; final Map<String, List<String>> headers = new HashMap<>(); headers.put("Content-Type", singletonList("application/x-www-form-urlencoded")); final ContainerResponse response = launcher.service("POST", SERVICE_PATH + "/password", BASE_URI, headers, ("password=" + newPassword).getBytes(), null, environmentContext); assertEquals(response.getStatus(), CONFLICT.getStatusCode()); verify(userDao, times(0)).update(user.withPassword(newPassword)); }

Target:
public void shouldFailUpdatePasswordContainsOnlyDigits() throws Exception { final User user = createUser(); final String newPassword = "12345678"; final Map<String, List<String>> headers = new HashMap<>(); headers.put("Content-Type", singletonList("application/x-www-form-urlencoded")); final ContainerResponse response = launcher.service("POST", SERVICE_PATH + "/password", BASE_URI, headers, ("password=" + newPassword).getBytes(), null, environmentContext); assertEquals(response.getStatus(), CONFLICT.getStatusCode()); verify(userDao, never()).update(user.withPassword(newPassword)); }
Source:
public PlanNode visitUnion(UnionNode node, RewriteContext<Void> context) { return new UnionNode(node.getId(), rewriteSources(node, context).build(), fromListMultimap(canonicalizeSetOperationVariableMap(toListMultimap(node.getVariableMapping())))); }

Target:
public PlanNode visitUnion(UnionNode node, RewriteContext<Void> context) { return new UnionNode(node.getId(), rewriteSources(node, context).build(), canonicalizeSetOperationOutputVariables(node.getOutputVariables()), canonicalizeSetOperationVariableMap(node.getVariableMapping())); }
Source:
public Element( final String name, final String type, final String componentType, final ImmutableList<Ds3Annotation> annotations) { this.name = name; this.type = type; this.componentType = componentType; this.annotations = annotations; }

Target:
public Element( final String name, final String type, final String componentType, final ImmutableList<Ds3Annotation> annotations) { this.name = name; this.type = type; this.componentType = componentType; this.annotations = annotations; this.elementHelper = ElementHelper.getInstance(); }
Source:
protected void ExecuteVdsBrokerCommand() { _result = null; if (getParameters().getStoragePoolId() != null) { HashSet<Version> hostVersions = null; VDS vds = DbFacade.getInstance().getVdsDao().get(getParameters().getVdsId()); Version clusterCompatibility = vds.getVdsGroupCompatibilityVersion(); hostVersions = vds.getSupportedClusterVersionsSet(); if (FeatureSupported.improvedGetAllTasks(clusterCompatibility) && (hostVersions != null) && hostVersions.contains(clusterCompatibility)) { _result = getBroker().getAllTasksInfo(getParameters().getStoragePoolId().toString()); } } if (_result == null) { _result = getBroker().getAllTasksInfo(); } ProceedProxyReturnValue(); setReturnValue(ParseTaskInfoList(_result.TaskInfoList)); }

Target:
protected void ExecuteVdsBrokerCommand() { _result = null; if (getParameters().getStoragePoolId() != null) { VDS vds = DbFacade.getInstance().getVdsDao().get(getParameters().getVdsId()); if (FeatureSupported.saferGetAllTasksRequest(vds.getVdsGroupCompatibilityVersion())) { _result = getBroker().getAllTasksInfo(getParameters().getStoragePoolId().toString()); } } if (_result == null) { _result = getBroker().getAllTasksInfo(); } ProceedProxyReturnValue(); setReturnValue(ParseTaskInfoList(_result.TaskInfoList)); }
Source:
public void processTimer(ComputationContext context, String key, long timestamp) { KeyValueStore kvStore = Framework.getService(KeyValueService.class).getKeyValueStore(BULK_KV_STORE_NAME); List<BulkStatus> statuses = new ArrayList<>(); counters.forEach((commandId, processedDocs) -> { BulkStatus status = BulkCodecs.getBulkStatusCodec().decode(kvStore.get(commandId + STATUS)); Long previousProcessedDocs = status.getProcessed(); if (previousProcessedDocs == null) { previousProcessedDocs = 0L; } Long currentProcessedDocs = previousProcessedDocs + processedDocs; if (status.getCount() != null && currentProcessedDocs.longValue() == status.getCount().longValue()) { status.setState(COMPLETED); } status.setProcessed(currentProcessedDocs); statuses.add(status); }); statuses.forEach(status -> context.produceRecord(KVWRITER_STREAM_NAME, key, BulkCodecs.getBulkStatusCodec().encode(status))); counters.clear(); context.askForCheckpoint(); context.setTimer("counter", System.currentTimeMillis() + counterThresholdMs); }

Target:
public void processTimer(ComputationContext context, String key, long timestamp) { if (!counters.isEmpty()) { KeyValueStore kvStore = Framework.getService(KeyValueService.class) .getKeyValueStore(BULK_KV_STORE_NAME); counters.entrySet() .stream() .map(entry -> getStatusAndUpdate(kvStore, entry.getKey(), entry.getValue())) .map(BulkCodecs.getBulkStatusCodec()::encode) .forEach(status -> context.produceRecord(KVWRITER_STREAM_NAME, key, status)); counters.clear(); context.askForCheckpoint(); } context.setTimer("counter", System.currentTimeMillis() + counterThresholdMs); }
Source:
public void safeExecute(Shell shell) { viewModel = new DeleteComponentsViewModel(SERVER.getDependenciesModel().getDependencies()); MultipleConfigsSelectionDialog dialog = new DeleteComponentsDialog(shell, SERVER.componentsInfo().getValue(), viewModel.getDependencies().keySet()); if (dialog.open() == Window.OK) { Map <String, Boolean> compNamesWithFlags = SERVER.compNamesWithFlags(); Collection<String> toDelete = dialog.selectedConfigs(); Map<String, Collection<String>> selectedDependencies = viewModel.filterSelected(toDelete); if (selectedDependencies.isEmpty()) { configService.uncheckedWrite(toDelete); } else { displayWarning(selectedDependencies, shell); safeExecute(shell); } try { if (!ManagerModeModel.getInstance().isInManagerMode()) { for (String item: dialog.selectedConfigs()) { if (compNamesWithFlags.get(item)) { dispalyError(shell); break; } } } } catch (ManagerModePvNotConnectedException e) { MessageDialog error = new MessageDialog(shell, "Error", null, e.getMessage(), MessageDialog.ERROR, new String[] {"OK"},0); error.open(); } } }

Target:
public void safeExecute(Shell shell) { viewModel = new DeleteComponentsViewModel(SERVER.getDependenciesModel().getDependencies()); Map <String, Boolean> compNamesWithFlags = SERVER.compNamesWithFlags(); MultipleConfigsSelectionDialog dialog = new DeleteComponentsDialog(shell, SERVER.componentsInfo().getValue(), viewModel.getDependencies().keySet(), compNamesWithFlags); if (dialog.open() == Window.OK) { Collection<String> toDelete = dialog.selectedConfigs(); Map<String, Collection<String>> selectedDependencies = viewModel.filterSelected(toDelete); try { if (selectedDependencies.isEmpty()) { configService.write(toDelete); } else { displayWarning(selectedDependencies, shell); safeExecute(shell); } if (!ManagerModeModel.getInstance().isInManagerMode()) { for (String item: dialog.selectedConfigs()) { if (compNamesWithFlags.get(item)) { displayError(shell); break; } } } } catch (ManagerModePvNotConnectedException|IOException e) { MessageDialog error = new MessageDialog(shell, "Error", null, e.getMessage(), MessageDialog.ERROR, new String[] {"OK"},0); error.open(); } } }
Source:
private Action getFindAction() { if (findAction == null) { findAction = new AbstractAction("findAction") { private static final long serialVersionUID = 8365172573382425660L; @Override public void actionPerformed(ActionEvent e) { Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (focusOwner instanceof JTextComponent) { FindDialog findDialog = new FindDialog(SwingUtilities.getWindowAncestor(focusOwner), false); findDialog.setLastInvoker((JTextComponent) focusOwner); findDialog.setVisible(true); } } }; } return findAction; }

Target:
private static Action getFindAction() { if (findAction == null) { findAction = new AbstractAction("findAction") { private static final long serialVersionUID = 8365172573382425660L; @Override public void actionPerformed(ActionEvent e) { Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (focusOwner instanceof JTextComponent) { FindDialog findDialog = new FindDialog(SwingUtilities.getWindowAncestor(focusOwner), false); findDialog.setLastInvoker((JTextComponent) focusOwner); findDialog.setVisible(true); } } }; } return findAction; }
Source:
public GrillSessionImpl getSession(GrillSessionHandle sessionHandle) { try { return ((GrillSessionImpl)getSessionManager().getSession(getHiveSessionHandle(sessionHandle))); } catch (HiveSQLException exc) { LOG.warn("Session not found", exc); throw new NotFoundException("Session not found " + sessionHandle); } }

Target:
public GrillSessionImpl getSession(GrillSessionHandle sessionHandle) { try { return ((GrillSessionImpl)getSessionManager().getSession(getHiveSessionHandle(sessionHandle))); } catch (HiveSQLException exc) { LOG.warn("Session " + sessionHandle.getPublicId() + " not found", exc); throw new NotFoundException("Session " + sessionHandle.getPublicId() + " not found " + sessionHandle); } }
Source:
private void registerMetrics(GenericObjectPool<CassandraClient> pool) { registerPoolMetric("meanActiveTimeMillis", pool::getMeanActiveTimeMillis); registerPoolMetric("meanIdleTimeMillis", pool::getMeanIdleTimeMillis); registerPoolMetric("meanBorrowWaitTimeMillis", pool::getMeanBorrowWaitTimeMillis); registerPoolMetric("numIdle", pool::getNumIdle); registerPoolMetric("numActive", pool::getNumActive); registerPoolMetric("created", pool::getCreatedCount); registerPoolMetric("destroyedByEvictor", pool::getDestroyedByEvictorCount); }

Target:
private void registerMetrics(GenericObjectPool<CassandraClient> pool) { registerPoolMetric("meanActiveTimeMillis", pool::getMeanActiveTimeMillis); registerPoolMetric("numIdle", pool::getNumIdle); registerPoolMetric("numActive", pool::getNumActive); registerPoolMetric("created", pool::getCreatedCount); registerPoolMetric("destroyedByEvictor", pool::getDestroyedByEvictorCount); }
Source:
public void testRenameTable() { assertUpdate("CREATE TABLE test_rename (a BIGINT)"); assertQueryFails("ALTER TABLE test_rename RENAME TO memory.rename.test_rename", "Schema rename not found"); assertUpdate("ALTER TABLE test_rename RENAME TO test_renamed"); assertQueryResult("SELECT count(*) FROM test_renamed", 0L); assertUpdate("CREATE SCHEMA rename"); assertUpdate("ALTER TABLE test_renamed RENAME TO rename.test_renamed"); assertQueryResult("SELECT count(*) FROM rename.test_renamed", 0L); }

Target:
public void testRenameTable() { assertUpdate("CREATE TABLE test_table_to_be_renamed (a BIGINT)"); assertQueryFails("ALTER TABLE test_table_to_be_renamed RENAME TO memory.test_schema_not_exist.test_table_renamed", "Schema test_schema_not_exist not found"); assertUpdate("ALTER TABLE test_table_to_be_renamed RENAME TO test_table_renamed"); assertQueryResult("SELECT count(*) FROM test_table_renamed", 0L); assertUpdate("CREATE SCHEMA test_different_schema"); assertUpdate("ALTER TABLE test_table_renamed RENAME TO test_different_schema.test_table_renamed"); assertQueryResult("SELECT count(*) FROM test_different_schema.test_table_renamed", 0L); }
Source:
public void onComplete(final AsyncEvent event) { FlowIdUtils.push(this.flowId); writeToAccessLogAndEventType(requestLogInfo, response); }

Target:
public void onComplete(final AsyncEvent event) { logOnEvent(); }
Source:
private void loadMetadataIfNotExist(RpcContext rpcContext, AlluxioURI path, LoadMetadataContext context, boolean isGetFileInfo) throws InvalidPathException, AccessControlException { LockingScheme scheme = new LockingScheme(path, LockPattern.READ, false); boolean lm; try (LockedInodePath inodePath = mInodeTree.lockInodePath(scheme)) { lm = shouldLoadMetadataIfNotExists(inodePath, context); } if (lm) { DescendantType syncDescendantType = GrpcUtils.fromProto(context.getOptions().getLoadDescendantType()); FileSystemMasterCommonPOptions commonOptions = context.getOptions().getCommonOptions(); InodeSyncStream sync = new InodeSyncStream(new LockingScheme(path, LockPattern.READ, false), this, rpcContext, syncDescendantType, commonOptions, isGetFileInfo, true, true); if (!sync.sync()) { LOG.debug("Failed to load metadata for path from UFS: {}", path); } } }

Target:
private void loadMetadataIfNotExist(RpcContext rpcContext, AlluxioURI path, LoadMetadataContext context, boolean isGetFileInfo) throws InvalidPathException, AccessControlException { DescendantType syncDescendantType = GrpcUtils.fromProto(context.getOptions().getLoadDescendantType()); FileSystemMasterCommonPOptions commonOptions = context.getOptions().getCommonOptions(); InodeSyncStream sync = new InodeSyncStream(new LockingScheme(path, LockPattern.READ, false), this, rpcContext, syncDescendantType, commonOptions, isGetFileInfo, true, true); if (!sync.sync()) { LOG.debug("Failed to load metadata for path from UFS: {}", path); } }
Source:
private List<PartP2PFluids> getOutputs( final Fluid input ) { final List<PartP2PFluids> outs = new LinkedList<PartP2PFluids>(); try { for( final PartP2PFluids l : this.getOutputs() ) { final IFluidHandler handler = l.getTarget(); if( handler != null ) { outs.add( l ); } } } catch( final GridAccessException e ) { } return outs; }

Target:
private List<PartP2PFluids> getOutputs( final Fluid input ) { final List<PartP2PFluids> outs = new LinkedList<>(); try { for( final PartP2PFluids l : this.getOutputs() ) { final IFluidHandler handler = l.getTarget(); if( handler != null ) { outs.add( l ); } } } catch( final GridAccessException e ) { } return outs; }