auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void testModerateResponsesButton() { resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Open Session"); resultsPage.displayByQuestion(); clickAjaxLoadedPanelAndWaitForExpansion("panelHeading-2", "ajax_auto"); clickAjaxLoadedPanelAndWaitForExpansion("panelHeading-4", "ajax_auto"); ______TS("Typical case: test moderate responses button for individual response (including no response)"); ThreadHelper.waitFor(1000); verifyModerateResponsesButton(2, "CFResultsUiT.alice.b@gmail.tmt", "CFResultsUiT.benny.c@gmail.tmt", "CFResultsUiT.fred.g@gmail.tmt", "CFResultsUiT.charlie.d@gmail.tmt", "CFResultsUiT.danny.e@gmail.tmt", "drop.out@gmail.tmt", "extra.guy@gmail.tmt", "CFResultsUiT.emily.f@gmail.tmt"); ______TS("Typical case: test moderate responses button for team response"); verifyModerateResponsesButton(4, "Team 1</td></div>'\""); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Session with Instructors as Givers"); resultsPage.displayByQuestion(); clickAjaxLoadedPanelAndWaitForExpansion("panelHeading-1", "ajax_auto"); ______TS("Typical case: test moderate responses button for instructors as givers"); verifyModerateResponsesButton(1, "CFResultsUiT.instr@gmail.tmt", "CFResultsUiT.instr@gmail.tmt", "CFResultsUiT.instr@gmail.tmt"); }

Target:
private void testModerateResponsesButton() { resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Open Session"); resultsPage.displayByQuestion(); clickAjaxLoadedPanelAndWaitForExpansion("panelHeading-2", "ajax_auto"); clickAjaxLoadedPanelAndWaitForExpansion("panelHeading-4", "ajax_auto"); ______TS("Typical case: test moderate responses button for individual response (including no response)"); verifyModerateResponsesButton(2, "CFResultsUiT.alice.b@gmail.tmt", "CFResultsUiT.benny.c@gmail.tmt", "CFResultsUiT.fred.g@gmail.tmt", "CFResultsUiT.charlie.d@gmail.tmt", "CFResultsUiT.danny.e@gmail.tmt", "drop.out@gmail.tmt", "extra.guy@gmail.tmt", "CFResultsUiT.emily.f@gmail.tmt"); ______TS("Typical case: test moderate responses button for team response"); verifyModerateResponsesButton(4, "Team 1</td></div>'\""); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Session with Instructors as Givers"); resultsPage.displayByQuestion(); clickAjaxLoadedPanelAndWaitForExpansion("panelHeading-1", "ajax_auto"); ______TS("Typical case: test moderate responses button for instructors as givers"); verifyModerateResponsesButton(1, "CFResultsUiT.instr@gmail.tmt", "CFResultsUiT.instr@gmail.tmt", "CFResultsUiT.instr@gmail.tmt"); }
Source:
public static MessageViewInfo createWithErrorState(Message message) { return new MessageViewInfo(message, null, null, null, null, null, null); }

Target:
public static MessageViewInfo createWithErrorState(Message message) { return new MessageViewInfo(message, null, null, null, null, null, null, null); }
Source:
public Stream<RoleDTO> getUserRoles(@PathParam("username") @Verify(User.class) String username) { UserInfo user = this.fetchUserByUsername(username); Collection<? extends RoleInfo> roles = user.getRoles(); if (roles != null) { UserDTO udto = this.modelTranslator.translate(user, UserDTO.class); Set<UserDTO> users = Collections.singleton(udto); return roles.stream() .map(this.modelTranslator.getStreamMapper(RoleInfo.class, RoleDTO.class)) .peek(e -> e.setUsers(users.stream().collect(Collectors.toList()))); } return Stream.<RoleDTO>empty(); }

Target:
public Stream<RoleDTO> getUserRoles(@PathParam("username") @Verify(User.class) String username) { UserInfo user = this.fetchUserByUsername(username); Collection<? extends RoleInfo> roles = user.getRoles(); if (roles != null) { UserDTO udto = this.modelTranslator.translate(user, UserDTO.class); Set<UserDTO> users = Collections.singleton(udto); return roles.stream() .map(this.modelTranslator.getStreamMapper(RoleInfo.class, RoleDTO.class)) .map(e -> e.users(new HashSet<>(users))); } return Stream.<RoleDTO>empty(); }
Source:
private void hideResponsesGiverRecipient() { for (FeedbackResponseAttributes response : responses) { String name = emailNameTable.get(response.recipient); FeedbackQuestionAttributes question = questions.get(response.feedbackQuestionId); FeedbackParticipantType participantType = question.recipientType; if (participantType == FeedbackParticipantType.SELF) { participantType = question.giverType; } if (!isRecipientVisible(response)) { String anonEmail = getAnonEmail(participantType, name); name = getAnonName(participantType, name); emailNameTable.put(anonEmail, name); emailTeamNameTable.put(anonEmail, name + Const.TEAM_OF_EMAIL_OWNER); response.recipient = anonEmail; } name = emailNameTable.get(response.giver); participantType = question.giverType; if (!isGiverVisible(response)) { String anonEmail = getAnonEmail(participantType, name); name = getAnonName(participantType, name); emailNameTable.put(anonEmail, name); emailTeamNameTable.put(anonEmail, name + Const.TEAM_OF_EMAIL_OWNER); if (participantType == FeedbackParticipantType.TEAMS) { emailTeamNameTable.put(anonEmail, name); } response.giver = anonEmail; response.giverEmail = Const.DISPLAYED_NAME_FOR_ANONYMOUS_PARTICIPANT; } } }

Target:
private void hideResponsesGiverRecipient() { for (FeedbackResponseAttributes response : responses) { String name = emailNameTable.get(response.recipient); FeedbackQuestionAttributes question = questions.get(response.feedbackQuestionId); FeedbackParticipantType participantType = question.recipientType; if (participantType == FeedbackParticipantType.SELF) { participantType = question.giverType; } if (!isRecipientVisible(response)) { String anonEmail = getAnonEmail(participantType, name); name = getAnonName(participantType, name); emailNameTable.put(anonEmail, name); emailTeamNameTable.put(anonEmail, name + Const.TEAM_OF_EMAIL_OWNER); response.recipient = anonEmail; } name = emailNameTable.get(response.giver); participantType = question.giverType; if (!isGiverVisible(response)) { String anonEmail = getAnonEmail(participantType, name); name = getAnonName(participantType, name); emailNameTable.put(anonEmail, name); emailTeamNameTable.put(anonEmail, name + Const.TEAM_OF_EMAIL_OWNER); if (participantType == FeedbackParticipantType.TEAMS) { emailTeamNameTable.put(anonEmail, name); } response.giver = anonEmail; } } }
Source:
public static Double quantileAtValueDouble(@SqlType("tdigest(double)") Slice input, @SqlType(StandardTypes.DOUBLE) double value) { return new TDigest(input).getCdf(value); }

Target:
public static double quantileAtValueDouble(@SqlType("tdigest(double)") Slice input, @SqlType(StandardTypes.DOUBLE) double value) { return createTDigest(input).getCdf(value); }
Source:
public void update() { fboId = frameBuffersManager.getFBO(this.getValue()).fboId; task.setFboToBind(fboId); }

Target:
public void update() { fboId = frameBuffersManager.getFBO(fboName).fboId; task.setFboId(fboId); }
Source:
public void onSaveClick() { editView.setSaveState(true); WikidataDescriptionEditDataClient client = new WikidataDescriptionEditDataClient(); client.submitDescription(pageTitle, editView.getDescription(), new WikidataDescriptionEditDataClient.Callback() { @Override public void success() { editView.setSaveState(false); L.i("WD description edit successful"); } @Override public void failure(@NonNull Throwable caught) { editView.setSaveState(false); L.e("WD description edit failed: ", caught); } }); }

Target:
public void onSaveClick() { editView.setSaveState(true); if (client == null) { client = new WikidataDescriptionEditDataClient(); } client.request(pageTitle, editView.getDescription(), new WikidataDescriptionEditDataClient.Callback() { @Override public void success() { editView.setSaveState(false); L.i("WD description edit successful"); } @Override public void failure(@NonNull Throwable caught) { editView.setSaveState(false); L.e("WD description edit failed: ", caught); } }); }
Source:
@Test public void definedAsField() throws IOException { ClassWriter classWriter = ClassWriter.forClassName(className); FieldWriter threadField = classWriter.addField(threadName, "thread"); AnonymousClassWriter threadWriter = AnonymousClassWriter.forClassName(threadName); MethodWriter threadStartMethod = threadWriter.addMethod(void.class, "start"); threadStartMethod.annotate(Override.class); threadStartMethod.addModifiers(PUBLIC); threadStartMethod.body().addSnippet("System.out.println(\"Hello World!\");"); threadField.setInitializer("%s", threadWriter); StringBuilder stringBuilder = new StringBuilder(); assertThat(classWriter.writeTypeToAppendable(stringBuilder).toString()).isEqualTo("" + "package com.foo;\n" + "\n" + "class Bar {\n" + " Thread thread = new Thread() {\n" + " @Override\n" + " public void start() {\n" + " System.out.println(\"Hello World!\");\n" + " }\n" + " };\n" + "}\n"); }

Target:
@Test public void definedAsField() throws IOException { ClassWriter classWriter = ClassWriter.forClassName(className); FieldWriter threadField = classWriter.addField(threadName, "thread"); AnonymousClassWriter threadWriter = AnonymousClassWriter.forClassName(threadName); MethodWriter threadStartMethod = threadWriter.addMethod(void.class, "start"); threadStartMethod.annotate(Override.class); threadStartMethod.addModifiers(PUBLIC); threadStartMethod.body().addSnippet("System.out.println(\"Hello World!\");"); threadField.setInitializer("%s", threadWriter); assertThat(classWriter.toString()).isEqualTo("" + "package com.foo;\n" + "\n" + "class Bar {\n" + " Thread thread = new Thread() {\n" + " @Override\n" + " public void start() {\n" + " System.out.println(\"Hello World!\");\n" + " }\n" + " };\n" + "}\n"); }
Source:
public ProcessInstance execute(CommandContext commandContext) { if (processDefinitionId == null && processDefinitionKey == null) { throw new ActivitiIllegalArgumentException("processDefinitionKey and processDefinitionId are null"); } DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager(); ProcessDefinition processDefinition = this.getProcessDefinitionByProcessDefinitionId(processDefinitionId, deploymentCache); if(processDefinition == null) { processDefinition = (processDefinitionKey != null && hasNoTenant(tenantId)) ? this.getProcessDefinitionByProcessDefinitionKey(processDefinitionKey, tenantId, deploymentCache): this.getProcessDefinitionByProcessDefinitionKeyAndTenantId(processDefinitionKey, tenantId, deploymentCache); if (processDefinition == null) { throw new ActivitiObjectNotFoundException("No process definition found for key '" + processDefinitionKey + "' for tenant identifier " + tenantId, ProcessDefinition.class); } } processInstanceHelper = commandContext.getProcessEngineConfiguration().getProcessInstanceHelper(); return processInstanceHelper.createProcessInstance(processDefinition, businessKey, processInstanceName, variables, transientVariables); }

Target:
public ProcessInstance execute(CommandContext commandContext) { if (processDefinitionId == null && processDefinitionKey == null) { throw new ActivitiIllegalArgumentException("processDefinitionKey and processDefinitionId are null"); } DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager(); ProcessDefinition processDefinition = this.getProcessDefinitionByProcessDefinitionId(processDefinitionId, deploymentCache); if(processDefinition == null) { processDefinition = (processDefinitionKey != null && hasNoTenant(tenantId)) ? this.getProcessDefinitionByProcessDefinitionKey(processDefinitionKey, deploymentCache): this.getProcessDefinitionByProcessDefinitionKeyAndTenantId(processDefinitionKey, tenantId, deploymentCache); if (processDefinition == null) { throw new ActivitiObjectNotFoundException("No process definition found for key '" + processDefinitionKey + "' for tenant identifier " + tenantId, ProcessDefinition.class); } } processInstanceHelper = commandContext.getProcessEngineConfiguration().getProcessInstanceHelper(); return processInstanceHelper.createProcessInstance(processDefinition, businessKey, processInstanceName, variables, transientVariables); }
Source:
public void testOpenTrace() { assertNotNull(fixture); final TmfTraceElement traceElement = fixture.getTracesFolder().getTraces().get(0); try { traceElement.getTrace(); fail("There should be an exception because of thread access"); } catch (RuntimeException e) { assertTrue(true); } Thread thread = new Thread() { @Override public void run() { ITmfTrace trace = traceElement.getTrace(); assertNull(trace); } }; thread.start(); ITmfTrace trace = traceElement.instantiateTrace(); try { trace.initTrace(traceElement.getResource(), traceElement.getLocation().getPath(), TmfEvent.class); TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, trace, null)); ITmfTrace trace2 = traceElement.getTrace(); assertTrue(trace2 == trace); TmfSignalManager.dispatchSignal(new TmfTraceClosedSignal(this, trace)); } catch (TmfTraceException e) { fail("Could not initialize trace"); } try { Thread.sleep(15000); } catch (InterruptedException e) { fail(e.getMessage()); } }

Target:
public void testOpenTrace() { assertNotNull(fixture); final TmfTraceElement traceElement = fixture.getTracesFolder().getTraces().get(0); ITmfTrace trace = traceElement.getTrace(); assertNull(trace); TmfOpenTraceHelper.openTraceFromElement(traceElement); ProjectModelTestData.delayThread(5000); trace = traceElement.getTrace(); assertNotNull(trace); TmfOpenTraceHelper.openTraceFromElement(traceElement); ProjectModelTestData.delayThread(5000); ITmfTrace trace2 = TmfTraceManager.getInstance().getActiveTrace(); assertFalse(trace2 == trace); trace = traceElement.getTrace(); assertTrue(trace2 == trace); }
Source:
public void ensureSavingAfterInitialUser() { r.addStep(new Statement() { @Override public void evaluate() throws Throwable { r.j.jenkins.setSecurityRealm(new HudsonPrivateSecurityRealm(true)); r.j.jenkins.setAuthorizationStrategy(new GlobalMatrixAuthorizationStrategy()); r.j.jenkins.save(); JenkinsRule.WebClient wc = r.j.createWebClient(); SignupPage signup = new SignupPage(wc.goTo("signup")); signup.enterUsername("alice"); signup.enterPassword("alice"); signup.enterFullName("Alice User"); HtmlPage success = signup.submit(r.j); try (ACLContext _ = ACL.as(User.get("alice"))) { Assert.assertTrue(r.j.jenkins.getACL().hasPermission(Jenkins.ADMINISTER)); } } }); r.addStep(new Statement() { @Override public void evaluate() throws Throwable { try (ACLContext _ = ACL.as(User.get("alice"))) { Assert.assertTrue(r.j.jenkins.getACL().hasPermission(Jenkins.ADMINISTER)); } } }); }

Target:
public void ensureSavingAfterInitialUser() { r.addStep(new Statement() { @Override public void evaluate() throws Throwable { r.j.jenkins.setSecurityRealm(new HudsonPrivateSecurityRealm(true)); r.j.jenkins.setAuthorizationStrategy(new GlobalMatrixAuthorizationStrategy()); r.j.jenkins.save(); JenkinsRule.WebClient wc = r.j.createWebClient(); SignupPage signup = new SignupPage(wc.goTo("signup")); signup.enterUsername("alice"); signup.enterPassword("alice"); signup.enterFullName("Alice User"); HtmlPage success = signup.submit(r.j); Assert.assertTrue(r.j.jenkins.getACL().hasPermission(User.get("alice").impersonate(), Jenkins.ADMINISTER)); } }); r.addStep(new Statement() { @Override public void evaluate() throws Throwable { Assert.assertTrue(r.j.jenkins.getACL().hasPermission(User.get("alice").impersonate(), Jenkins.ADMINISTER)); } }); }
Source:
public void onNameDeclarationSelected(NameDeclaration declaration) { sourceEditorController.clearNameOccurences(); Optional.ofNullable(declaration.getNode().getScope().getDeclarations().get(declaration)) .ifPresent(sourceEditorController::highlightNameOccurrences); Platform.runLater(() -> onNodeItemSelected(declaration.getNode())); }

Target:
public void onNameDeclarationSelected(NameDeclaration declaration) { sourceEditorController.clearNameOccurences(); List<NameOccurrence> occurrences = declaration.getNode().getScope().getDeclarations().get(declaration); if (occurrences != null) { sourceEditorController.highlightNameOccurrences(occurrences); } Platform.runLater(() -> onNodeItemSelected(declaration.getNode())); }
Source:
public void onStart() { super.onStart(); if (Config.FabricBranchConfig.isBranchEnabled(config.getFabricConfig())) { Branch.getInstance().initSession((referringParams, error) -> { if (error == null) { if (referringParams.optBoolean(DeeplinkManager.KEY_CLICKED_BRANCH_LINK)) { try { DeeplinkManager.parseAndReact(SplashActivity.this, referringParams); } catch (JSONException e) { logger.error(e, true); } } } else { if (NetworkUtil.isConnected(getApplicationContext())) { logger.error(new Exception("Branch not configured properly, error:\n" + error.getMessage()), true); } } }, this.getIntent().getData(), this); finish(); } }

Target:
public void onStart() { super.onStart(); if (Config.FabricBranchConfig.isBranchEnabled(config.getFabricConfig())) { Branch.getInstance().initSession((referringParams, error) -> { if (error == null) { if (referringParams.optBoolean(DeepLinkManager.KEY_CLICKED_BRANCH_LINK)) { try { DeepLinkManager.parseAndReact(SplashActivity.this, referringParams); } catch (JSONException e) { logger.error(e, true); } } } else { if (NetworkUtil.isConnected(getApplicationContext())) { logger.error(new Exception("Branch not configured properly, error:\n" + error.getMessage()), true); } } }, this.getIntent().getData(), this); finish(); } }
Source:
private void setHttpHeader(final HttpMethodBase m) { m.setRequestHeader(CONTENT_TYPE, CONTENT_JSON); m.setRequestHeader(ACCEPT, CONTENT_JSON); m.setRequestHeader(HTTP_HEADER_INSTANCE_ID, CLOUDSTACK_INSTANCE_ID + "-" + zoneId); if (! "".equals(hash)) { m.setRequestHeader(HASH_MATCH, hash); } String authString = username + ":" + password; String encodedAuthString = "Basic " + Base64.encodeBase64String(authString.getBytes(Charset.forName("UTF-8"))); m.setRequestHeader("Authorization", encodedAuthString); }

Target:
private void setHttpHeader(final HttpMethodBase m) { m.setRequestHeader(CONTENT_TYPE, CONTENT_JSON); m.setRequestHeader(ACCEPT, CONTENT_JSON); m.setRequestHeader(HTTP_HEADER_INSTANCE_ID, CLOUDSTACK_INSTANCE_ID + "-" + zoneId); if (StringUtils.isNotEmpty(hash)) { m.setRequestHeader(HASH_MATCH, hash); } String authString = username + ":" + password; String encodedAuthString = "Basic " + Base64.encodeBase64String(authString.getBytes(Charset.forName("UTF-8"))); m.setRequestHeader("Authorization", encodedAuthString); }
Source:
public void whenCreateNewEventTypePersistItInTheDatabase() throws Exception { EventType eventType = buildEventType(); repository.saveEventType(eventType); final int rows = template.queryForObject("SELECT count(*) FROM event_type", Integer.class); assertThat("Number of rows should encrease", rows, equalTo(1)); final PreparedStatement ps = connection.prepareStatement("SELECT et_name, et_event_type_object FROM event_type"); ps.setMaxRows(1); final ResultSet rs = ps.executeQuery(); rs.next(); assertThat("Name is persisted", rs.getString(1), equalTo("event-name")); assertThat("Schema is persisted", rs.getString(2), equalTo("{\"name\": \"event-name\", \"type\": null, \"schema\": {\"type\": null, \"schema\": {\"price\": 1000}}, \"owning_application\": null}")); }

Target:
public void whenCreateNewEventTypePersistItInTheDatabase() throws Exception { EventType eventType = buildEventType(); repository.saveEventType(eventType); final int rows = template.queryForObject("SELECT count(*) FROM zn_data.event_type", Integer.class); assertThat("Number of rows should encrease", rows, equalTo(1)); SqlRowSet rs = template.queryForRowSet("SELECT et_name, et_event_type_object FROM zn_data.event_type"); rs.next(); assertThat("Name is persisted", rs.getString(1), equalTo("event-name")); ObjectMapper mapper = (new NakadiConfig()).jacksonObjectMapper(); EventType persisted = mapper.readValue(rs.getString(2), EventType.class); assertThat(persisted.getCategory(), equalTo(eventType.getCategory())); assertThat(persisted.getName(), equalTo(eventType.getName())); assertThat(persisted.getEventTypeSchema().getType(), equalTo(eventType.getEventTypeSchema().getType())); assertThat(persisted.getEventTypeSchema().getSchema(), equalTo(eventType.getEventTypeSchema().getSchema())); }
Source:
private static DetailAST getNextNode(DetailAST node) { final DetailAST nextNode; if (node.getNextSibling() == null) { nextNode = node.getParent().getNextSibling(); } else { nextNode = node.getNextSibling(); } return nextNode; }

Target:
private static DetailAST getNextNode(DetailAST node) { DetailAST nextNode = node.getNextSibling(); if (nextNode == null) { nextNode = node.getParent().getNextSibling(); } return nextNode; }
Source:
public void internalMapFailure() { Async<Integer> failure = Asyncs.failure(new Throwable()); Async<Integer> mapped = Asyncs.map(failure, new Function<Integer, Integer>() { @Override public Integer apply(Integer input) { return input + 1; } }, new SimpleAsync<Integer>()); assertThat(mapped, AsyncMatchers.<Integer>failed()); }

Target:
public void internalMapFailure() { Async<Integer> failure = Asyncs.failure(new Throwable()); Async<Integer> mapped = Asyncs.map(failure, new Function<Integer, Integer>() { @Override public Integer apply(Integer input) { return input + 1; } }, new SimpleAsync<Integer>()); assertThat(mapped, failed()); }
Source:
private void listFilesInsideAcidDirectory(Path acidDir, FileSystem srcFs, List<Path> newFiles) throws HiveException { FileStatus[] acidFiles; try { acidFiles = srcFs.listStatus(acidDir); } catch (IOException e) { LOG.error("Error listing files", e); throw new HiveException(e); } if (acidFiles == null) { LOG.debug("No files added by this query in: " + acidDir); return; } for (FileStatus acidFile : acidFiles) { if (!acidFile.isDirectory()) { newFiles.add(acidFile.getPath()); } else { listFilesInsideAcidDirectory(acidFile.getPath(), srcFs, newFiles); } } }

Target:
private void listFilesInsideAcidDirectory(Path acidDir, FileSystem srcFs, List<Path> newFiles) throws IOException { FileStatus[] acidFiles; acidFiles = srcFs.listStatus(acidDir); if (acidFiles == null) { LOG.debug("No files added by this query in: " + acidDir); return; } for (FileStatus acidFile : acidFiles) { if (!acidFile.isDirectory()) { newFiles.add(acidFile.getPath()); } else { listFilesInsideAcidDirectory(acidFile.getPath(), srcFs, newFiles); } } }
Source:
public void wakeupExisting() throws InterruptedException { final ConstantTimeBackoff backoff = new ConstantTimeBackoff(); backoff.setTimeToWait(1000); Thread thread = new Thread(new Runnable() { @Override public void run() { LOG.debug("before"); backoff.waitBeforeRetry(); LOG.debug("after"); } }); thread.start(); LOG.debug("thread started"); Thread.sleep(100); LOG.debug("testing wakeup"); Assert.assertTrue(backoff.wakeup(thread.getName())); }

Target:
public void wakeupExisting() throws InterruptedException { final ConstantTimeBackoff backoff = new ConstantTimeBackoff(); backoff.setTimeToWait(10); Thread thread = new Thread(new Runnable() { @Override public void run() { LOG.debug("before"); backoff.waitBeforeRetry(); LOG.debug("after"); } }); thread.start(); LOG.debug("thread started"); Thread.sleep(100); LOG.debug("testing wakeup"); Assert.assertTrue(backoff.wakeup(thread.getName())); }
Source:
protected void connect() { if (getEntity() != null) { getLogger().debug("Connecting to RDP console..."); boolean haveFqdn = false; if( getUseFqdnIfAvailable() ) { getLogger().debug("RDP connection is using FQDN if available"); if(!StringHelper.isNullOrEmpty(getEntity().getVmFQDN())) { getLogger().debug("RDP connection is using FQDN because it is available"); getrdp().setAddress(getEntity().getVmFQDN()); } } if( !haveFqdn ) { getLogger().debug("RDP connection is not using FQDN"); getrdp().setAddress(getEntity().getVmHost().split("[ ]", -1)[0]); } getrdp().setGuestID(getEntity().getId().toString()); try { getrdp().connect(); updateActionAvailability(); } catch (RuntimeException ex) { getLogger().error("Exception on RDP connect", ex); } } }

Target:
protected void connect() { if (getEntity() != null) { getLogger().debug("Connecting to RDP console..."); boolean haveFqdn = false; if (getUseFqdnIfAvailable()) { getLogger().debug("RDP connection is using FQDN if available"); if (!StringHelper.isNullOrEmpty(getEntity().getVmFQDN())) { getLogger().debug("RDP connection is using FQDN because it is available"); haveFqdn = true; getrdp().setAddress(getEntity().getVmFQDN()); } } if (!haveFqdn) { getLogger().debug("RDP connection is not using FQDN"); getrdp().setAddress(getEntity().getVmHost().split("[ ]", -1)[0]); } getrdp().setGuestID(getEntity().getId().toString()); try { getrdp().connect(); updateActionAvailability(); } catch (RuntimeException ex) { getLogger().error("Exception on RDP connect", ex); } } }
Source:
protected void onHandleIntent(Intent intent) { String catName = intent.getStringExtra(KEY_CATEGORY_NAME); Account curAccount = intent.getParcelableExtra(KEY_ACCOUNT); int parentId = intent.getIntExtra(KEY_PARENT_CATEGORY_ID, 0); RestService restService = restServiceFactory.createForAccount(curAccount); Call<AddCategoryResponse> call = restService.addCategory(catName, parentId, null, null, null, null); call.enqueue(new Callback<AddCategoryResponse>() { @Override public void onResponse(Call<AddCategoryResponse> call, Response<AddCategoryResponse> response) { if (response.raw().code() == 200) { if (response.body().stat.equals("ok")) Toast.makeText(getApplicationContext(), R.string.create_album_success, Toast.LENGTH_LONG).show(); else Toast.makeText(getApplicationContext(), R.string.create_album_error, Toast.LENGTH_LONG).show(); } else Toast.makeText(getApplicationContext(), R.string.create_album_error, Toast.LENGTH_LONG).show(); } @Override public void onFailure(Call<AddCategoryResponse> call, Throwable t) { t.printStackTrace(); } }); }

Target:
protected void onHandleIntent(Intent intent) { String catName = intent.getStringExtra(KEY_CATEGORY_NAME); Account curAccount = intent.getParcelableExtra(KEY_ACCOUNT); int parentId = intent.getIntExtra(KEY_PARENT_CATEGORY_ID, 0); RestService restService = restServiceFactory.createForAccount(curAccount); Call<AddCategoryResponse> call = restService.addCategory(catName, parentId, null, null, null, null); call.enqueue(new Callback<AddCategoryResponse>() { @Override public void onResponse(Call<AddCategoryResponse> call, Response<AddCategoryResponse> response) { if (response.raw().code() == 200 && response.body().stat.equals("ok")) Toast.makeText(getApplicationContext(), R.string.create_album_success, Toast.LENGTH_LONG).show(); else Toast.makeText(getApplicationContext(), R.string.create_album_error, Toast.LENGTH_LONG).show(); } @Override public void onFailure(Call<AddCategoryResponse> call, Throwable t) { Toast.makeText(getApplicationContext(), R.string.create_album_error, Toast.LENGTH_LONG).show(); Log.e("AlbumService", "Unable to create a new album:", t); } }); }
Source:
public void testSetBuffer() { SampleTester.test((Sample sample) -> { Buffer buffer = sample.getBuffer(); int refCount = buffer.getRefCount(); if (Gst.getVersion().checkSatisfies(new Version(1, 16))) { assertEquals(2, sample.getRefCount()); Natives.unref(sample); sample.setBuffer(null); Natives.ref(sample); assertEquals(2, sample.getRefCount()); assertEquals(refCount-1, buffer.getRefCount()); } }); }

Target:
public void testSetBuffer() { TestAssumptions.requireGstVersion(1, 16); SampleTester.test((Sample sample) -> { Buffer buffer = sample.getBuffer(); int refCount = buffer.getRefCount(); assertEquals(2, sample.getRefCount()); Natives.unref(sample); sample.setBuffer(null); Natives.ref(sample); assertEquals(2, sample.getRefCount()); assertEquals(refCount-1, buffer.getRefCount()); }); }
Source:
public boolean isPdfValid(@NonNull File file) { PdfPDImageXFactory factory = new PdfPDImageXFactoryFactory(context, new PDDocument(), file).get(); try { factory.open(); return factory.nextPage(); } catch (IOException e) { e.printStackTrace(); return false; } finally { IOUtils.closeQuietly(factory); } }

Target:
public boolean isPdfValid(@NonNull File file) { PdfPDImageXFactory factory = new PdfPDImageXFactoryFactory(context, new PDDocument(), file).get(); try { factory.open(); return factory.nextPage(); } catch (IOException e) { Logger.error(this, "Invalid PDF File", e); return false; } finally { IOUtils.closeQuietly(factory); } }
Source:
public void start() { if (stepClassWithSpringContext != null) { testContextManager = new CucumberTestContextManager(stepClassWithSpringContext); } else { if (beanFactory == null) { beanFactory = createFallbackContext(); } } notifyContextManagerAboutTestClassStarted(); if (beanFactory == null || isNewContextCreated()) { beanFactory = testContextManager.getBeanFactory(); synchronized (beanFactory) { for (Class<?> stepClass : stepClasses) { registerStepClassBeanDefinition(beanFactory, stepClass); } } } GlueCodeContext.getInstance().start(); }

Target:
public void start() { synchronized (monitor) { if (stepClassWithSpringContext != null) { testContextManager = new CucumberTestContextManager(stepClassWithSpringContext); } else { if (beanFactory == null) { beanFactory = createFallbackContext(); } } notifyContextManagerAboutTestClassStarted(); if (beanFactory == null || isNewContextCreated()) { beanFactory = testContextManager.getBeanFactory(); for (Class<?> stepClass : stepClasses) { registerStepClassBeanDefinition(beanFactory, stepClass); } } GlueCodeContext.getInstance().start(); } }
Source:
JarFileUtils(IPostProcessor processor, String xmlPathInJar, List<String> testNames) { this.processor = processor; this.xmlPathInJar = xmlPathInJar; this.testNames = (testNames == null ? null : new ArrayList<>(testNames)); }

Target:
JarFileUtils(IPostProcessor processor, String xmlPathInJar, List<String> testNames) { this.processor = processor; this.xmlPathInJar = xmlPathInJar; this.testNames = testNames; }
Source:
public boolean charTyped(char p_charTyped_1_, int p_charTyped_2_) { if (super.charTyped(p_charTyped_1_, p_charTyped_2_) || !canEdit) { return true; } else if (SharedConstants.isAllowedCharacter(p_charTyped_1_)) { this.insertTextIntoPage(Character.toString(p_charTyped_1_)); return true; } else { return false; } }

Target:
public boolean charTyped(char p_charTyped_1_, int p_charTyped_2_) { if (super.charTyped(p_charTyped_1_, p_charTyped_2_) || !canEdit) return true; else if (SharedConstants.isAllowedCharacter(p_charTyped_1_)) { this.insertTextIntoPage(Character.toString(p_charTyped_1_)); return true; } else return false; }
Source:
public void shouldIncrementTransactionMonitorBeforeCheckingDatabaseAvailability() throws Exception { AvailabilityGuard availabilityGuard = spy( new AvailabilityGuard( Clock.systemUTC(), NullLog.getInstance() ) ); TransactionMonitor transactionMonitor = mock( TransactionMonitor.class ); Dependencies dependencies = new Dependencies(); dependencies.satisfyDependencies( availabilityGuard, transactionMonitor ); NeoStoreDataSource dataSource = neoStoreRule.getDataSource( pageCacheRule.directory().absolutePath(), pageCacheRule.fileSystem(), pageCacheRule.pageCache(), dependencies ); dataSource.start(); KernelAPI kernel = dataSource.getKernel(); try ( KernelTransaction tx = kernel.newTransaction( explicit, AUTH_DISABLED ) ) { InOrder order = inOrder( transactionMonitor, availabilityGuard ); order.verify( transactionMonitor, times( 1 ) ).transactionStarted(); } }

Target:
public void shouldIncrementTransactionMonitorBeforeCheckingDatabaseAvailability() throws Exception { AvailabilityGuard availabilityGuard = spy( new AvailabilityGuard( Clock.systemUTC(), NullLog.getInstance() ) ); TransactionMonitor transactionMonitor = mock( TransactionMonitor.class ); Dependencies dependencies = new Dependencies(); dependencies.satisfyDependencies( availabilityGuard, transactionMonitor ); NeoStoreDataSource dataSource = neoStoreRule.getDataSource( pageCacheRule.directory().absolutePath(), pageCacheRule.fileSystem(), pageCacheRule.pageCache(), dependencies ); dataSource.start(); KernelAPI kernel = dataSource.getKernel(); try ( KernelTransaction tx = kernel.newTransaction( explicit, AUTH_DISABLED ) ) { InOrder order = inOrder( transactionMonitor, availabilityGuard ); order.verify( transactionMonitor, times( 1 ) ).transactionStarted(); order.verify( availabilityGuard, times( 1 ) ).await( anyLong() ); } }
Source:
private void scheduleLocalBackup(BackupPRequest request) { mLocalBackupFuture = mExecutorService.submit(() -> { try (LockResource stateLockResource = new LockResource(mStatePauseLock, mStateLockTimeout, TimeUnit.MILLISECONDS)) { mBackupTracker.updateState(BackupState.Running); AlluxioURI backupUri = takeBackup(request, mBackupTracker.getEntryCounter()); mBackupTracker.updateBackupUri(backupUri); mBackupTracker.updateState(BackupState.Completed); } catch (Exception e) { mBackupTracker.updateError( new BackupException(String.format("Local backup failed: %s", e.getMessage()), e)); } }); }

Target:
private void scheduleLocalBackup(BackupPRequest request) { mLocalBackupFuture = mExecutorService.submit(() -> { try (LockResource stateLockResource = new LockResource(mStatePauseLock, request.getOptions().getStateLockTryDurationMs(), request.getOptions().getStateLockSleepDurationMs(), request.getOptions().getStateLockTimeoutMs())) { mBackupTracker.updateState(BackupState.Running); AlluxioURI backupUri = takeBackup(request, mBackupTracker.getEntryCounter()); mBackupTracker.updateBackupUri(backupUri); mBackupTracker.updateState(BackupState.Completed); } catch (Exception e) { mBackupTracker.updateError( new BackupException(String.format("Local backup failed: %s", e.getMessage()), e)); } }); }
Source:
public static Period fromString(final String sleepPeriodName) { if (sleepPeriodName != null) { for (final Period period : Period.values()) { if (sleepPeriodName.equalsIgnoreCase(period.toString())) { return period; } } } throw new IllegalArgumentException(); }

Target:
public static Period fromString(final String sleepPeriodName) { if (sleepPeriodName != null) { for (final Period period : Period.values()) { if (sleepPeriodName.equalsIgnoreCase(period.toString())) { return period; } } } throw new IllegalArgumentException("invalid sleep period: " + sleepPeriodName); }
Source:
protected String getScanStatus(int contextId) { AccessControlScannerThread scannerThread = threadManager.getScannerThread(contextId); String result = null; if (scannerThread.isRunning()) { result = "RUNNING"; } else if (scannerThread.isPaused()) { result = "PAUSED"; } else if (scannerThread.isInterrupted()) { result = "INTERRUPTED"; } else { result = "SCAN NOT RUNNING"; } return result; }

Target:
protected String getScanStatus(int contextId) { AccessControlScannerThread scannerThread = threadManager.getScannerThread(contextId); String result = null; if (scannerThread.isRunning()) { result = "RUNNING"; } else if (scannerThread.isPaused()) { result = "PAUSED"; } else if (scannerThread.isInterrupted()) { result = "INTERRUPTED"; } else { result = "NOT RUNNING"; } return result; }
Source:
private void writeOffset64() throws IOException { for (final PackedObjectInfo oe : entries) { final long o = oe.getOffset(); if (o >= Integer.MAX_VALUE) { NB.encodeInt64(tmp, 0, o); out.write(tmp, 0, 8); } } }

Target:
private void writeOffset64() throws IOException { for (final PackedObjectInfo oe : entries) { final long o = oe.getOffset(); if (OFFSET_64 <= o) { NB.encodeInt64(tmp, 0, o); out.write(tmp, 0, 8); } } }
Source:
public final void endVisit(final SuperMethodInvocation node) { final IMethodBinding superBinding= node.resolveMethodBinding(); if (superBinding != null) { endVisit(node.arguments(), superBinding); ASTNode methodOrLambda= fCurrentMethodsAndLambdas.peek(); if (methodOrLambda instanceof MethodDeclaration){ MethodDeclaration declaration= (MethodDeclaration) methodOrLambda; final IMethodBinding subBinding= declaration.resolveBinding(); if (subBinding != null) { final ConstraintVariable2 ancestor= fModel.createReturnTypeVariable(superBinding); if (ancestor != null) { node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, ancestor); final ConstraintVariable2 descendant= fModel.createReturnTypeVariable(subBinding); if (descendant != null) fModel.createEqualityConstraint(descendant, ancestor); } } } } }

Target:
public final void endVisit(final SuperMethodInvocation node) { final IMethodBinding superBinding= node.resolveMethodBinding(); if (superBinding != null) { endVisit(node.arguments(), superBinding); ASTNode methodOrLambda= fCurrentMethodsAndLambdas.peek(); if (methodOrLambda instanceof MethodDeclaration){ final IMethodBinding subBinding= ((MethodDeclaration) methodOrLambda).resolveBinding(); if (subBinding != null) { final ConstraintVariable2 ancestor= fModel.createReturnTypeVariable(superBinding); if (ancestor != null) { node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, ancestor); final ConstraintVariable2 descendant= fModel.createReturnTypeVariable(subBinding); if (descendant != null) fModel.createEqualityConstraint(descendant, ancestor); } } } } }
Source:
public JsonElement serialize(JoinBatchInformation batch, Type typeOfSrc, JsonSerializationContext context) { JsonObject result = new JsonObject(); result.add("class", new JsonPrimitive(batch.getClass().getName())); result.add("batchSize", new JsonPrimitive(batch.getBatchSize())); result.add("task", new JsonPrimitive(batch.getTask().name())); Column column = batch.getColumn(); result.add("column", new JsonPrimitive(column.getsFamily() + "\u0000" + column.getsQualifier())); Span span = batch.getSpan(); result.add("span", new JsonPrimitive(span.getStart().getsRow() + "\u0000" + span.getEnd().getsRow())); result.add("startInc", new JsonPrimitive(span.isStartInclusive())); result.add("endInc", new JsonPrimitive(span.isEndInclusive())); if(batch.getAggregationStateMeta().isPresent()) { CommonNodeMetadataImpl stateMeta = batch.getAggregationStateMeta().get(); result.add("aggStateMeta", new JsonPrimitive(stateMeta.getNodeId() + "\u0000" + stateMeta.getVariableOrder().toString())); } result.add("side", new JsonPrimitive(batch.getSide().name())); result.add("joinType", new JsonPrimitive(batch.getJoinType().name())); String updateVarOrderString = Joiner.on(";").join(batch.getBs().getBindingNames()); VariableOrder updateVarOrder = new VariableOrder(updateVarOrderString); result.add("bindingSet", new JsonPrimitive(converter.convert(batch.getBs(), updateVarOrder))); result.add("updateVarOrder", new JsonPrimitive(updateVarOrderString)); return result; }

Target:
public JsonElement serialize(JoinBatchInformation batch, Type typeOfSrc, JsonSerializationContext context) { JsonObject result = new JsonObject(); result.add("class", new JsonPrimitive(batch.getClass().getName())); result.add("batchSize", new JsonPrimitive(batch.getBatchSize())); result.add("task", new JsonPrimitive(batch.getTask().name())); Column column = batch.getColumn(); result.add("column", new JsonPrimitive(column.getsFamily() + DELIM + column.getsQualifier())); Span span = batch.getSpan(); result.add("span", new JsonPrimitive(span.getStart().getsRow() + DELIM + span.getEnd().getsRow())); result.add("startInc", new JsonPrimitive(span.isStartInclusive())); result.add("endInc", new JsonPrimitive(span.isEndInclusive())); if(batch.getAggregationStateMeta().isPresent()) { CommonNodeMetadataImpl stateMeta = batch.getAggregationStateMeta().get(); result.add("aggStateMeta", new JsonPrimitive(stateMeta.getNodeId() + DELIM + stateMeta.getVariableOrder().toString())); } result.add("side", new JsonPrimitive(batch.getSide().name())); result.add("joinType", new JsonPrimitive(batch.getJoinType().name())); String updateVarOrderString = Joiner.on(";").join(batch.getBs().getBindingNames()); VariableOrder updateVarOrder = new VariableOrder(updateVarOrderString); result.add("bindingSet", new JsonPrimitive(converter.convert(batch.getBs(), updateVarOrder))); result.add("updateVarOrder", new JsonPrimitive(updateVarOrderString)); return result; }
Source:
public int read(ByteBuffer dst) throws IOException { final int total = dst.remaining(); final byte[] tmp = getBuf(); int read = 0; int remaining = total; while (remaining > 0) { final int n = in.read(tmp, 0, Math.min(remaining, bufferSize)); if (n == -1) { if (read == 0) { read = -1; } break; } else if (n > 0) { dst.put(tmp, 0, n); read += n; remaining -= n; } } return read; }

Target:
public int read(ByteBuffer dst) throws IOException { int remaining = dst.remaining(); final byte[] tmp = getBuf(); int read = 0; while (remaining > 0) { final int n = in.read(tmp, 0, Math.min(remaining, bufferSize)); if (n == -1) { if (read == 0) { read = -1; } break; } else if (n > 0) { dst.put(tmp, 0, n); read += n; remaining -= n; } } return read; }
Source:
public Collection<Order> getOrder(String... orderIds) throws IOException { Collection<Order> orders = new ArrayList<>(orderIds.length); for (String orderId : orderIds) { try { final GDAXOrder order = super.getOrder(orderId); orders.add(GDAXAdapters.adaptOrder(order)); } catch (final ExchangeException e) { if ( e.getCause() instanceof HttpStatusExceptionSupport && ((HttpStatusExceptionSupport)e.getCause()).getHttpStatusCode() == 404) { orders.add(new Order(null, null, null, orderId, null, null, null, Order.OrderStatus.CANCELED) { }); } else { throw e; } } } return orders; }

Target:
public Collection<Order> getOrder(String... orderIds) throws IOException { Collection<Order> orders = new ArrayList<>(orderIds.length); for (String orderId : orderIds) { orders.add(GDAXAdapters.adaptOrder(super.getOrder(orderId))); } return orders; }
Source:
public T blockDevices(VirtualGuestBlockDevice... in) { return blockDevices(ImmutableSet.copyOf(in)); }

Target:
public T blockDevices(VirtualGuestBlockDevice... in) { return blockDevices(ImmutableSet.copyOf(checkNotNull(in, "blockDevices"))); }
Source:
abstract public void doRequest(HttpServletRequest req, HttpServletResponse res) throws IOException; private String getReqUrl(HttpServletRequest req) { String reqUrl = req.getRequestURL().toString(); if (req.getQueryString() != null) { reqUrl += "?" + req.getQueryString(); } return reqUrl; }

Target:
protected abstract void doRequest(HttpServletRequest req, HttpServletResponse res) throws IOException; private static String getReqUrl(HttpServletRequest req) { StringBuffer url = req.getRequestURL(); if (req.getQueryString() != null) { url.append('?').append(req.getQueryString()); } return url.toString(); }
Source:
protected boolean canDoAction() { boolean returnValue = true; final VmStatic vmStatic = DbFacade.getInstance().getVmStaticDao().get(getParameters().getVmId()); if (vmStatic != null) { setComputerName(vmStatic.getName()); returnValue = ((Boolean) LdapFactory .getInstance(getParameters().getDomain()) .RunAdAction(AdActionType.IsComputerWithTheSameNameExists, new LdapIsComputerWithSameNameExistsParameters(getActualDomain(), getActualUser(), getActualPassword(), getComputerName())) .getReturnValue()).booleanValue(); if (returnValue) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED); } } else { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CREATE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__COMPUTER_ACCOUNT); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } return !returnValue; }

Target:
protected boolean canDoAction() { boolean returnValue = true; final VmStatic vmStatic = DbFacade.getInstance().getVmStaticDao().get(getParameters().getVmId()); if (vmStatic != null) { setComputerName(vmStatic.getName()); returnValue = ((Boolean) LdapFactory .getInstance(getParameters().getDomain()) .RunAdAction(AdActionType.IsComputerWithTheSameNameExists, new LdapIsComputerWithSameNameExistsParameters(getActualDomain(), getActualUser(), getActualPassword(), getComputerName())) .getReturnValue()).booleanValue(); if (returnValue) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED); } } else { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CREATE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__COMPUTER_ACCOUNT); return !returnValue; }
Source:
Observable createRequestObservable(final Callable<ResponseWrapper> request) { return Observable.create(new Observable.OnSubscribe<Object>() { @Override public void call(Subscriber<? super Object> subscriber) { if (subscriber.isUnsubscribed()) { return; } try { ResponseWrapper wrapper = request.call(); if (subscriber.isUnsubscribed()) { return; } subscriber.onNext(wrapper.responseBody); subscriber.onCompleted(); } catch (RetrofitError e) { subscriber.onError(errorHandler.handleError(e)); } catch (Exception e) { throw new RuntimeException(e); } } }).subscribeOn(scheduler); }

Target:
Observable createRequestObservable(final Callable<ResponseWrapper> request) { return Observable.create(new Observable.OnSubscribe<Object>() { @Override public void call(Subscriber<? super Object> subscriber) { if (subscriber.isUnsubscribed()) { return; } final FutureTask<Void> task = new FutureTask<Void>(getRunnable(subscriber, request), null); final Subscription s = Subscriptions.from(task); subscriber.add(s); executor.execute(task); } }); }
Source:
private static IBinding createLabelReferenceBinding(IASTName name, IASTUnaryExpression expression) { IBinding binding = null; IScope scope = getContainingScope(name); IASTInternalScope s = (IASTInternalScope) scope; IASTNode node = s.getPhysicalNode(); while (node != null && !(node instanceof IASTFunctionDefinition)) { node = node.getParent(); } if (node != null) { IASTFunctionDefinition definition = (IASTFunctionDefinition) node; CPPASTFunctionDeclarator declarator = (CPPASTFunctionDeclarator) definition.getDeclarator(); scope = declarator.getFunctionScope(); if (scope != null) { binding = scope.getBinding(name, false); if (binding == null || !(binding instanceof ILabel)) { binding = new CPPLabel(name); ASTInternal.addName(scope, name); } } } if (binding == null) { binding = new CPPScope.CPPScopeProblem(expression, IProblemBinding.SEMANTIC_BAD_SCOPE, expression.getRawSignature().toCharArray()); } return binding; }

Target:
private static IBinding createLabelReferenceBinding(IASTName name, IASTUnaryExpression expression) { IBinding binding = null; IScope scope = getContainingScope(name); IASTInternalScope s = (IASTInternalScope) scope; IASTNode node = s.getPhysicalNode(); while (node != null && !(node instanceof IASTFunctionDefinition)) { node = node.getParent(); } if (node != null) { IASTFunctionDefinition definition = (IASTFunctionDefinition) node; CPPASTFunctionDeclarator declarator = (CPPASTFunctionDeclarator) definition.getDeclarator(); scope = declarator.getFunctionScope(); if (scope != null) { binding = scope.getBinding(name, false); if (!(binding instanceof ILabel)) { binding = new CPPLabel(name); ASTInternal.addName(scope, name); } } } if (binding == null) { binding = new CPPScope.CPPScopeProblem(expression, IProblemBinding.SEMANTIC_BAD_SCOPE, expression.getRawSignature().toCharArray()); } return binding; }
Source:
private Reference newInfo(Integer position, ColumnIdent column, DataType type, @Nullable String formattedDefaultExpression, ColumnPolicy columnPolicy, Reference.IndexType indexType, boolean nullable, boolean columnStoreEnabled) { Symbol defaultExpression = null; if (formattedDefaultExpression != null) { ExpressionAnalyzer expressionAnalyzer = new ExpressionAnalyzer(functions, CoordinatorTxnCtx.systemTransactionContext(), ParamTypeHints.EMPTY, FieldProvider.UNSUPPORTED, null); Expression expression = SqlParser.createExpression(formattedDefaultExpression); defaultExpression = expressionAnalyzer.convert(expression, new ExpressionAnalysisContext()); } return new Reference( refIdent(column), granularity(column), type, columnPolicy, indexType, nullable, columnStoreEnabled, position, defaultExpression ); }

Target:
private Reference newInfo(Integer position, ColumnIdent column, DataType type, @Nullable String formattedDefaultExpression, ColumnPolicy columnPolicy, Reference.IndexType indexType, boolean nullable, boolean columnStoreEnabled) { Symbol defaultExpression = null; if (formattedDefaultExpression != null) { Expression expression = SqlParser.createExpression(formattedDefaultExpression); defaultExpression = expressionAnalyzer.convert(expression, new ExpressionAnalysisContext()); } return new Reference( refIdent(column), granularity(column), type, columnPolicy, indexType, nullable, columnStoreEnabled, position, defaultExpression ); }