auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void upload(UploadRequest request, String senderReference) { BrokerServiceExternalBasicStreamedSF brokerServiceExternalBasicStreamedSF; brokerServiceExternalBasicStreamedSF = new BrokerServiceExternalBasicStreamedSF(configuration.getStreamingServiceUrl()); IBrokerServiceExternalBasicStreamed streamingService = brokerServiceExternalBasicStreamedSF.getBasicHttpBindingIBrokerServiceExternalBasicStreamed(); BindingProvider bp = (BindingProvider) streamingService; bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, configuration.getStreamingServiceUrl().toString()); try { StreamedPayloadBasicBE parameters = new StreamedPayloadBasicBE(); AltinnPackage altinnPackage = AltinnPackage.from(request); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); altinnPackage.write(outputStream); parameters.setDataStream(outputStream.toByteArray()); ReceiptExternalStreamedBE receiptExternal = streamingService.uploadFileStreamedBasic(parameters, FILE_NAME, senderReference, request.getSender(), configuration.getPassword(), configuration.getUsername()); } catch (IBrokerServiceExternalBasicStreamedUploadFileStreamedBasicAltinnFaultFaultFaultMessage e) { <START> throw new AltinnWsException(FAILED_TO_UPLOAD_A_MESSAGE_TO_ALTINN_BROKER_SERVICE, AltinnReason.from(e), e); <END> } catch (IOException e) { throw new AltinnWsException(FAILED_TO_UPLOAD_A_MESSAGE_TO_ALTINN_BROKER_SERVICE, e); } }</code><technical_language>Savner test med expected AltinnWsException</technical_language>

Target:
private void upload(UploadRequest request, String senderReference) { BrokerServiceExternalBasicStreamedSF brokerServiceExternalBasicStreamedSF = new BrokerServiceExternalBasicStreamedSF(configuration.getStreamingServiceUrl()); IBrokerServiceExternalBasicStreamed streamingService = brokerServiceExternalBasicStreamedSF.getBasicHttpBindingIBrokerServiceExternalBasicStreamed(); BindingProvider bp = (BindingProvider) streamingService; bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, configuration.getStreamingServiceUrl().toString()); try { StreamedPayloadBasicBE parameters = new StreamedPayloadBasicBE(); AltinnPackage altinnPackage = AltinnPackage.from(request); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); altinnPackage.write(outputStream); parameters.setDataStream(outputStream.toByteArray()); streamingService.uploadFileStreamedBasic(parameters, FILE_NAME, senderReference, request.getSender(), configuration.getPassword(), configuration.getUsername()); } catch (IBrokerServiceExternalBasicStreamedUploadFileStreamedBasicAltinnFaultFaultFaultMessage e) { throw new AltinnWsException(FAILED_TO_UPLOAD_A_MESSAGE_TO_ALTINN_BROKER_SERVICE, AltinnReasonFactory.from(e), e); } catch (IOException e) { throw new AltinnWsException(FAILED_TO_UPLOAD_A_MESSAGE_TO_ALTINN_BROKER_SERVICE, e); } }
Source:
<code>void testGetCoordinatesOfElement() { WebElement element = mock(WebElement.class); int x = 1; int y = 2; int height = 3; int width = 4; when(element.getLocation()).thenReturn(new Point(x, y)); <START> when(element.getSize()).thenReturn(new Dimension(4, 3)); <END> Coords coords = webDriverCoordsProvider.ofElement(null, element); assertAll( () -> assertEquals(x, coords.x), () -> assertEquals(y, coords.y), () -> assertEquals(height, coords.height), () -> assertEquals(width, coords.width) ); }</code><technical_language>please variables height width</technical_language>

Target:
void testGetCoordinatesOfElement() { WebElement element = mock(WebElement.class); int x = 1; int y = 2; int height = 3; int width = 4; when(element.getLocation()).thenReturn(new Point(x, y)); when(element.getSize()).thenReturn(new Dimension(width, height)); Coords coords = webDriverCoordsProvider.ofElement(null, element); assertAll( () -> assertEquals(x, coords.x), () -> assertEquals(y, coords.y), () -> assertEquals(height, coords.height), () -> assertEquals(width, coords.width) ); }
Source:
<code>public void render(Context context, LunModel value, SafeHtmlBuilder sb, String id) { ImageResourceCell imageCell = new ImageResourceCell(); imageCell.setStyle("text-align: center;"); if (value.getIsIncluded() || value.isRemoveLunSelected()) { <START> if (value.isRemoveLunSelected()) { <END> imageCell.setStyle("text-align: center; opacity: 0.2; filter: alpha(opacity=20);"); } imageCell.render(context, resources.okSmallImage(), sb, id); } else if (!value.getIsAccessible()) { imageCell.render(context, resources.logWarningImage(), sb, id); } else if (!multiSelection){ boolean checked = value.getIsSelected(); boolean disabled = value.getIsGrayedOut(); String inputId = id + "_input"; String type = "radio"; SafeHtml input; if (checked && !disabled) { input = templates.inputChecked(inputId, type); } else if (checked && disabled) { input = templates.inputCheckedDisabled(inputId, type); } else if (!checked && !disabled) { input = templates.inputUnchecked(inputId, type); } else { input = templates.inputUncheckedDisabled(inputId, type); } sb.append(templates.span(id, input)); } }</code><technical_language>try removing this if out line 53, remove 'value.isRemoveLunSelected()' line 54.</technical_language>

Target:
public void render(Context context, LunModel value, SafeHtmlBuilder sb, String id) { ImageResourceCell imageCell = new ImageResourceCell(); imageCell.setStyle("text-align: center;"); if (value.isRemoveLunSelected()) { imageCell.setStyle("text-align: center; opacity: 0.2; filter: alpha(opacity=20);"); } if (value.getIsIncluded()) { imageCell.render(context, resources.okSmallImage(), sb, id); } else if (!value.getIsAccessible()) { imageCell.render(context, resources.logWarningImage(), sb, id); } else if (!multiSelection){ boolean checked = value.getIsSelected(); boolean disabled = value.getIsGrayedOut(); String inputId = id + "_input"; String type = "radio"; SafeHtml input; if (checked && !disabled) { input = templates.inputChecked(inputId, type); } else if (checked && disabled) { input = templates.inputCheckedDisabled(inputId, type); } else if (!checked && !disabled) { input = templates.inputUnchecked(inputId, type); } else { input = templates.inputUncheckedDisabled(inputId, type); } sb.append(templates.span(id, input)); } }
Source:
<code>public void testProbeVideo() throws IOException { FFmpegProbeResult info = ffprobe.probe(Samples.big_buck_bunny_720p_1mb); assertFalse(info.hasError()); assertThat(info.getStreams(), hasSize(2)); assertThat(info.getStreams().get(0).codec_type, is(FFmpegStream.CodecType.VIDEO)); assertThat(info.getStreams().get(1).codec_type, is(FFmpegStream.CodecType.AUDIO)); assertThat(info.getStreams().get(1).channels, is(6)); assertThat(info.getStreams().get(1).sample_rate, is(48_000)); <START> assertTrue(info.getChapters().isEmpty()); <END> }</code><technical_language>assertThat(..) syntax</technical_language>

Target:
public void testProbeVideo() throws IOException { FFmpegProbeResult info = ffprobe.probe(Samples.big_buck_bunny_720p_1mb); assertFalse(info.hasError()); assertThat(info.getStreams(), hasSize(2)); assertThat(info.getStreams().get(0).codec_type, is(FFmpegStream.CodecType.VIDEO)); assertThat(info.getStreams().get(1).codec_type, is(FFmpegStream.CodecType.AUDIO)); assertThat(info.getStreams().get(1).channels, is(6)); assertThat(info.getStreams().get(1).sample_rate, is(48_000)); assertThat(info.getChapters().isEmpty(), is(true)); }
Source:
<code>public boolean equals(Object obj) { if (obj != null && obj instanceof AssignSensorType) { <START> return this.toString().equals(obj.toString()); <END> } return false; }</code><technical_language>Instead of comparing types toString() sense Eclipse IDE generate hashCode() equals() methods</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AssignSensorType)) { return false; } AssignSensorType other = (AssignSensorType) obj; if (dsuid == null) { if (other.dsuid != null) { return false; } } else if (!dsuid.equals(other.dsuid)) { return false; } if (sensorType != other.sensorType) { return false; } return true; }
Source:
<code>public void addResult(DistributedMember memberID, T resultOfSingleExecution) { <START> result = resultOfSingleExecution; <END> }</code><technical_language>this check if result != null throw IllegalStateException? If accidently this multiple results exception more helpful win</technical_language>

Target:
public void addResult(DistributedMember memberID, T resultOfSingleExecution) { if (result != null) { String s = String.format( "This function should only return a single result. Received a second result[%s] from member[%s].", resultOfSingleExecution, memberID); throw new IllegalStateException(s); } result = resultOfSingleExecution; }
Source:
<code>private void validate() { boolean isZkAddressSet = zkAddress != null && !zkAddress.isEmpty(); if (realmMode == RealmAwareZkClient.RealmMode.SINGLE_REALM && !isZkAddressSet) { throw new HelixException( "ConfigAccessor: RealmMode cannot be single-realm without a valid ZkAddress set!"); } if (realmMode == null) { realmMode = isZkAddressSet ? RealmAwareZkClient.RealmMode.SINGLE_REALM : RealmAwareZkClient.RealmMode.MULTI_REALM; } boolean isZkClientConfigSet = realmAwareZkClientConfig != null; <START> realmAwareZkClientConfig = isZkClientConfigSet ? realmAwareZkClientConfig.createHelixZkClientConfig() : new HelixZkClient.ZkClientConfig().setZkSerializer(new ZNRecordSerializer()); <END> if (realmAwareZkConnectionConfig == null) { realmAwareZkConnectionConfig = new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(); } }</code><technical_language>This simplified // Resolve RealmAwareZkClientConfig if (_realmAwareZkClientConfig == null) { _realmAwareZkClientConfig = new RealmAwareZkClient.RealmAwareZkClientConfig(); }</technical_language>

Target:
private void validate() { boolean isZkAddressSet = zkAddress != null && !zkAddress.isEmpty(); if (realmMode == RealmAwareZkClient.RealmMode.SINGLE_REALM && !isZkAddressSet) { throw new HelixException( "RealmMode cannot be single-realm without a valid ZkAddress set!"); } if (realmMode == RealmAwareZkClient.RealmMode.MULTI_REALM && isZkAddressSet) { throw new HelixException( "ZkAddress cannot be set on multi-realm mode!"); } if (realmMode == null) { realmMode = isZkAddressSet ? RealmAwareZkClient.RealmMode.SINGLE_REALM : RealmAwareZkClient.RealmMode.MULTI_REALM; } if (realmAwareZkClientConfig == null) { realmAwareZkClientConfig = new RealmAwareZkClient.RealmAwareZkClientConfig(); } if (realmAwareZkConnectionConfig == null) { realmAwareZkConnectionConfig = new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(); } }
Source:
<code>private void createContext() { if ( vc != null ) { if (g == null) { jContext = new VariantJEXLContext(vc); } else { jContext = new GenotypeJEXLContext(vc, g); } } else { <START> jContext = new MapContext(new HashMap<String, Object>()); <END> } }</code><technical_language>Collections.emptyMap</technical_language>

Target:
private void createContext() { if ( vc == null ) { jContext = new MapContext(Collections.emptyMap()); } else if (g == null) { jContext = new VariantJEXLContext(vc); } else { jContext = new GenotypeJEXLContext(vc, g); } }
Source:
<code>public static void updateFromLdapUser(User target, UserDetails ldapUserDetails) { final List<String> roles = new ArrayList<>(); for (final GrantedAuthority ga : ldapUserDetails.getAuthorities()) { roles.add(removePrefix(ga.toString(), LimsSecurityUtils.rolePrefix)); } target.setRoles(roles.toArray(new String[0])); target.setActive(ldapUserDetails.isAccountNonExpired()); target.setAdmin(roles.contains(MisoAuthority.ROLE_ADMIN.name())); target.setInternal(roles.contains(MisoAuthority.ROLE_INTERNAL.name())); target.setPassword(ldapUserDetails.getPassword()); <START> if(ldapUserDetails instanceof InetOrgPerson) { InetOrgPerson person = (InetOrgPerson) ldapUserDetails; target.setFullName(person.getDisplayName()); target.setEmail(person.getMail()); } <END> }</code><technical_language>fail save fullname nullable. Email is nullable in DB, intentional required Edit User page previously a for null. check call hierarchy if null email problems. username fullname too, get email</technical_language>

Target:
public static void updateFromLdapUser(User target, UserDetails ldapUserDetails) { final List<String> roles = new ArrayList<>(); for (final GrantedAuthority ga : ldapUserDetails.getAuthorities()) { roles.add(removePrefix(ga.toString(), LimsSecurityUtils.rolePrefix)); } target.setRoles(roles.toArray(new String[0])); target.setActive(ldapUserDetails.isAccountNonExpired()); target.setAdmin(roles.contains(MisoAuthority.ROLE_ADMIN.name())); target.setInternal(roles.contains(MisoAuthority.ROLE_INTERNAL.name())); target.setPassword(ldapUserDetails.getPassword()); if(ldapUserDetails instanceof InetOrgPerson) { InetOrgPerson person = (InetOrgPerson) ldapUserDetails; target.setFullName(person.getDisplayName()); target.setEmail(person.getMail()); } else { target.setFullName(ldapUserDetails.getUsername()); } }
Source:
<code>private void onPermissionsGranted() { if (BuildConfig.FEATURE_APK_GENERATOR_ENABLED) { setContentView(R.layout.activity_main_menu_splashscreen); prepareStandaloneProject(); return; } getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_container, new MainMenuFragment(), MainMenuFragment.TAG) .commit(); showContentView(FRAGMENT); if (SettingsFragment.isCastSharedPreferenceEnabled(this)) { CastManager.getInstance().initializeCast(this); } <START> new ImportProjectsFromExternalStorage(this).showImportProjectsDialog(); <END> }</code><technical_language>please move check if this displayed out in this class</technical_language>

Target:
private void onPermissionsGranted() { if (BuildConfig.FEATURE_APK_GENERATOR_ENABLED) { setContentView(R.layout.activity_main_menu_splashscreen); prepareStandaloneProject(); return; } getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_container, new MainMenuFragment(), MainMenuFragment.TAG) .commit(); showContentView(FRAGMENT); if (SettingsFragment.isCastSharedPreferenceEnabled(this)) { CastManager.getInstance().initializeCast(this); } if (EXTERNAL_STORAGE_ROOT_DIRECTORY.exists()) { new ImportProjectsFromExternalStorage(this).showImportProjectsDialog(); } }
Source:
<code><START> MessagingTemplate getMessagingTemplate() { <END> return this.messagingTemplate; }</code><technical_language>curious: add this method? if is protected</technical_language>

Target:
protected MessagingTemplate getMessagingTemplate() { return this.messagingTemplate; }
Source:
<code>protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Credentials credentials = SSOUtils.getUserCredentialsFromHeader(request); if (credentials == null) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { AuthenticationUtils.handleCredentials( request.getSession(true), credentials.getUsername(), credentials.getPassword(), credentials.getProfile()); try (OutputStream os = response.getOutputStream()) { os.write(SSOUtils.issueTicket(request.getSession(true), request).getBytes("UTF-8")); } } <START> } catch (Exception e) { <END> log.debug("Unable to authenticate", e); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }</code><technical_language>log.error("xxxx {}", e.getMessage())</technical_language>

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Credentials credentials = SSOUtils.getUserCredentialsFromHeader(request); if (credentials == null) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { AuthenticationUtils.handleCredentials( request.getSession(true), credentials.getUsername(), credentials.getPassword(), credentials.getProfile()); try (OutputStream os = response.getOutputStream()) { os.write(SSOUtils.issueTicket(request.getSession(true), request).getBytes("UTF-8")); } } } catch (Exception e) { log.error("Unable to authenticate {}", e.getMessage()); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }
Source:
<code>private void runFixVcfHeader(final int checkFirstNRecords, final File replacementHeader, final boolean enforceSampleSamples) { final FixVcfHeader program = new FixVcfHeader(); <START> final File outputVcf = new File(OUTPUT_DATA_PATH, "output.vcf"); <END> outputVcf.deleteOnExit(); final File outputVcfIndex = new File(OUTPUT_DATA_PATH, "output.vcf.idx"); outputVcfIndex.deleteOnExit(); program.INPUT = INPUT_VCF; program.OUTPUT = outputVcf; if (replacementHeader == null) { program.CHECK_FIRST_N_RECORDS = checkFirstNRecords; } else { program.HEADER = replacementHeader; program.ENFORCE_SAME_SAMPLES = enforceSampleSamples; } Assert.assertEquals(program.instanceMain(new String[0]), 0); IOUtil.assertFilesEqual(OUTPUT_VCF, outputVcf); }</code><technical_language>createTempVcfFIleAndDeleteItAndItsIndex well</technical_language>

Target:
private void runFixVcfHeader(final int checkFirstNRecords, final File replacementHeader, final boolean enforceSampleSamples) throws IOException { final FixVcfHeader program = new FixVcfHeader(); final File outputVcf = VcfTestUtils.createTemporaryIndexedVcfFile("output.", ".vcf"); program.INPUT = INPUT_VCF; program.OUTPUT = outputVcf; if (replacementHeader == null) { program.CHECK_FIRST_N_RECORDS = checkFirstNRecords; } else { program.HEADER = replacementHeader; program.ENFORCE_SAME_SAMPLES = enforceSampleSamples; } Assert.assertEquals(program.instanceMain(new String[0]), 0); IOUtil.assertFilesEqual(OUTPUT_VCF, outputVcf); }
Source:
<code>public void onStart(ISuite suite) { isCleanUpCompleted.set(false); runningTests.clear(); <START> Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown)); <END> Injector injector = createInjector(getParentModules()); injector.injectMembers(this); suite.setParentInjector(injector); }</code><technical_language>hook registered</technical_language>

Target:
public void onStart(ISuite suite) { isCleanUpCompleted.set(false); runningTests.clear(); Injector injector = createInjector(getParentModules()); injector.injectMembers(this); suite.setParentInjector(injector); }
Source:
<code>public boolean stop() { backgroundSyncExecutor.shutdown(); <START> outOfBandManagementDao.expireOutOfBandManagementOwnershipByServer(getId()); <END> return true; }</code><technical_language>host handoff occur if management server loses database connection</technical_language>

Target:
public boolean stop() { backgroundSyncBlockingExecutor.shutdown(); outOfBandManagementDao.expireOutOfBandManagementOwnershipByServer(getId()); return true; }
Source:
<code>public DirectoryAsyncClient buildAsyncClient() { <START> Objects.requireNonNull(endpoint); <END> if (pipeline != null) { return new DirectoryAsyncClient(endpoint, pipeline, shareName, directoryName, shareSnapshot); } if (sasTokenCredential == null && sharedKeyCredential == null) { throw new IllegalArgumentException("Credentials are required for authorization"); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(FileConfiguration.NAME, FileConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = HttpPipeline.builder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new DirectoryAsyncClient(endpoint, pipeline, shareName, directoryName, shareSnapshot); }</code><technical_language>shareName directoryName need exist here</technical_language>

Target:
public DirectoryAsyncClient buildAsyncClient() { Objects.requireNonNull(shareName); Objects.requireNonNull(directoryPath); if (pipeline != null) { return new DirectoryAsyncClient(endpoint, pipeline, shareName, directoryPath, snapshot); } if (sasTokenCredential == null && sharedKeyCredential == null) { throw new IllegalArgumentException("Credentials are required for authorization"); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(FileConfiguration.NAME, FileConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = HttpPipeline.builder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new DirectoryAsyncClient(endpoint, pipeline, shareName, directoryPath, snapshot); }
Source:
<code><START> public boolean canExecute() { <END> boolean canExecute = false; Object model = edgeEditPart.getModel(); if (model instanceof Edge && sourceEditPart != null && targetEditPart != null) { Edge edge = (Edge) model; EdgeQuery edgeQuery = new EdgeQuery(edge); canExecute = !edgeQuery.isEdgeWithTreeRoutingStyle(); if (canExecute) { isSourceABorderNode = sourceEditPart instanceof AbstractDiagramBorderNodeEditPart; isTargetABorderNode = targetEditPart instanceof AbstractDiagramBorderNodeEditPart; int axis = getSourceAndTargetSameAxis(); canExecute = axis != PositionConstants.NONE; if (canExecute) { if ((axis == PositionConstants.HORIZONTAL && (straightenType == StraightenToAction.TO_TOP || straightenType == StraightenToAction.TO_BOTTOM)) || (axis == PositionConstants.VERTICAL && (straightenType == StraightenToAction.TO_LEFT || straightenType == StraightenToAction.TO_RIGHT))) { moveSource = isSourceWillBeMoved(); } else { canExecute = false; } } } if (canExecute) { canExecute = !isMovedNodeABorderNodeWithSeveralConnections(); } if (canExecute) { canExecute = !isCentered(); } if (canExecute) { canExecute = isNewLocationInParentBounds(); } if (canExecute) { canExecute = !isOverlapped(); } } return canExecute; }</code><technical_language>completed checks edge edge node, edge is source/target of another edge</technical_language>

Target:
public boolean canExecute() { boolean canExecute = false; Object model = edgeEditPart.getModel(); if (model instanceof Edge && sourceEditPart != null && targetEditPart != null) { Edge edge = (Edge) model; EdgeQuery edgeQuery = new EdgeQuery(edge); canExecute = !edgeQuery.isEdgeWithTreeRoutingStyle(); if (canExecute) { canExecute = !(sourceEditPart instanceof ConnectionEditPart || targetEditPart instanceof ConnectionEditPart); } if (canExecute) { isSourceABorderNode = sourceEditPart instanceof AbstractDiagramBorderNodeEditPart; isTargetABorderNode = targetEditPart instanceof AbstractDiagramBorderNodeEditPart; int axis = getSourceAndTargetSameAxis(); canExecute = axis != PositionConstants.NONE; if (canExecute) { if ((axis == PositionConstants.HORIZONTAL && (straightenType == StraightenToAction.TO_TOP || straightenType == StraightenToAction.TO_BOTTOM)) || (axis == PositionConstants.VERTICAL && (straightenType == StraightenToAction.TO_LEFT || straightenType == StraightenToAction.TO_RIGHT))) { moveSource = isSourceWillBeMoved(); } else { canExecute = false; } } } if (canExecute) { canExecute = !isMovedNodeABorderNodeWithSeveralConnections(); } if (canExecute) { canExecute = !isCentered(); } if (canExecute) { canExecute = isNewLocationInParentBounds(); } if (canExecute) { canExecute = !isOverlapped(); } } return canExecute; }
Source:
<code>public void executionWithLocalizedDescription() throws Exception { final CurrencyUnit currencyUnit = USD; final TaxRateDraft taxRate = TaxRateDraft.of("x20", 0.20, true, COUNTRY_CODE); withZone(client(), zone -> { withTaxCategory(client(), TaxCategoryDraft.of("taxcat", asList(taxRate)), taxCategory -> { final ZoneRateDraft zoneRate = ZoneRateDraftBuilder.of(zone.toResourceIdentifier(), asList(ShippingRate.of(MoneyImpl.of(30, currencyUnit)))).build(); final ShippingMethodDraft draft = ShippingMethodDraft.of("standard shipping", LocalizedString.of(ENGLISH, "description"), taxCategory, asList(zoneRate)); <START> final ShippingMethod shippingMethod = client().executeBlocking(ShippingMethodCreateCommand.of(draft)); <END> client().executeBlocking(ShippingMethodDeleteCommand.of(shippingMethod)); }); }, COUNTRY_CODE); }</code><technical_language>add assert is set correctly</technical_language>

Target:
public void executionWithLocalizedDescription() throws Exception { final CurrencyUnit currencyUnit = USD; final TaxRateDraft taxRate = TaxRateDraft.of("x20", 0.20, true, COUNTRY_CODE); withZone(client(), zone -> { withTaxCategory(client(), TaxCategoryDraft.of("taxcat", asList(taxRate)), taxCategory -> { LocalizedString localizedDescription = LocalizedString.of(ENGLISH, "description"); final ZoneRateDraft zoneRate = ZoneRateDraftBuilder.of(zone.toResourceIdentifier(), asList(ShippingRate.of(MoneyImpl.of(30, currencyUnit)))).build(); final ShippingMethodDraft draft = ShippingMethodDraft.of("standard shipping", localizedDescription, taxCategory, asList(zoneRate)); final ShippingMethod shippingMethod = client().executeBlocking(ShippingMethodCreateCommand.of(draft)); assertThat(shippingMethod.getLocalizedDescription()).isEqualTo(localizedDescription); client().executeBlocking(ShippingMethodDeleteCommand.of(shippingMethod)); }); }, COUNTRY_CODE); }
Source:
<code>public ResponseEntity<String> countPhenotypes(@PathVariable final String crop, @PathVariable final Integer studyId, @PathVariable final Integer datasetId, @RequestParam(value = "variableIds", required = true) final Integer[] variableIds) { <START> if (!this.studyDatasetService.datasetExists(studyId, datasetId)) { <END> return new ResponseEntity<>("", HttpStatus.NOT_FOUND); } final long count = this.studyDatasetService.countPhenotypesForDataset(datasetId, Arrays.asList(variableIds)); final HttpHeaders respHeaders = new HttpHeaders(); respHeaders.add("X-Total-Count", String.valueOf(count)); return new ResponseEntity<>("", respHeaders, HttpStatus.OK); }</code><technical_language>I guess is discrimination Dataset exist Study exist. I thinking creating a StudyValidator checks if study exists not. try work today reuse</technical_language>

Target:
public ResponseEntity<String> countPhenotypes(@PathVariable final String crop, @PathVariable final Integer studyId, @PathVariable final Integer datasetId, @RequestParam(value = "variableIds", required = true) final Integer[] variableIds) { final long count = this.studyDatasetService.countPhenotypes(studyId, datasetId, Arrays.asList(variableIds)); final HttpHeaders respHeaders = new HttpHeaders(); respHeaders.add("X-Total-Count", String.valueOf(count)); return new ResponseEntity<>("", respHeaders, HttpStatus.OK); }
Source:
<code>private void applyInput(SolGame game) { boolean d = controlDown.isOn(); <START> boolean u = controlUp.isOn(); <END> boolean l = controlLeft.isOn(); boolean r = controlRight.isOn(); Vector2 v = SolMath.getVec(); if (l != r) { v.x = SolMath.toInt(r); } if (d != u) { v.y = SolMath.toInt(d); } v.scl(MOVE_SPD * game.getTimeStep()); SolMath.rotate(v, myAngle); myPos.add(v); SolMath.free(v); }</code><technical_language>Primarily concerned moving s's controls, own, for reasons mentioned above</technical_language>

Target:
private void applyInput(SolGame game) { MainScreen screen = game.getScreens().mainScreen; boolean d = screen.isCameraDown(); boolean u = screen.isCameraUp(); boolean l = screen.isCameraLeft(); boolean r = screen.isCameraRight(); Vector2 v = SolMath.getVec(); if (l != r) { v.x = SolMath.toInt(r); } if (d != u) { v.y = SolMath.toInt(d); } v.scl(MOVE_SPD * game.getTimeStep()); SolMath.rotate(v, myAngle); myPos.add(v); SolMath.free(v); }
Source:
<code>public void testNormalFlow() throws Exception { InputStream inputStream = getBlobInputStream(blobSize); CloudBlobMetadata cloudBlobMetadata = new CloudBlobMetadata(blobId, 0, blobSize); assertTrue("Expected upload to return true", azureDest.uploadBlob(blobId, blobSize, cloudBlobMetadata, inputStream)); assertTrue("Expected update to return true", azureDest.updateBlobExpiration(blobId, Utils.Infinite_Time)); <START> assertTrue("Expected deletion to return true", azureDest.deleteBlob(blobId, System.currentTimeMillis())); <END> }</code><technical_language>Verify deletion doesBlobExist() call</technical_language>

Target:
public void testNormalFlow() throws Exception { PartitionId partitionId = new MockPartitionId(); BlobId blobId = new BlobId(BLOB_ID_V6, BlobIdType.NATIVE, dataCenterId, accountId, containerId, partitionId, false, BlobDataType.DATACHUNK); InputStream inputStream = getBlobInputStream(blobSize); CloudBlobMetadata cloudBlobMetadata = new CloudBlobMetadata(blobId, System.currentTimeMillis(), Utils.Infinite_Time, blobSize); assertTrue("Expected upload to return true", azureDest.uploadBlob(blobId, blobSize, cloudBlobMetadata, inputStream)); assertFalse("Expected duplicate upload to return false", azureDest.uploadBlob(blobId, blobSize, cloudBlobMetadata, inputStream)); long expirationTime = Utils.Infinite_Time; assertTrue("Expected update to return true", azureDest.updateBlobExpiration(blobId, expirationTime)); CloudBlobMetadata metadata = azureDest.getBlobMetadata(Collections.singletonList(blobId)).get(blobId.getID()); assertEquals(expirationTime, metadata.getExpirationTime()); long deletionTime = System.currentTimeMillis() + 1000; assertTrue("Expected deletion to return true", azureDest.deleteBlob(blobId, deletionTime)); metadata = azureDest.getBlobMetadata(Collections.singletonList(blobId)).get(blobId.getID()); assertEquals(deletionTime, metadata.getDeletionTime()); }
Source:
<code>protected List<Protos.CommandInfo.URI> getUris() { List<Protos.CommandInfo.URI> uris = new ArrayList<>(); if (myriadExecutorConfiguration.getJvmUri().isPresent()) { final String jvmRemoteUri = myriadExecutorConfiguration.getJvmUri().get(); LOGGER.info("Getting JRE distribution from:" + jvmRemoteUri); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(jvmRemoteUri).build()); } if (myriadExecutorConfiguration.getConfigUri().isPresent()) { String configURI = myriadExecutorConfiguration.getConfigUri().get(); LOGGER.info("Getting Hadoop distribution from: {}", configURI); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(configURI).build()); } <START> if (myriadExecutorConfiguration.getNodeManagerUri().isPresent()) { <END> if (!(myriadConfiguration.getFrameworkUser().isPresent() && myriadConfiguration.getFrameworkSuperUser().isPresent())) { LOGGER.warn("Trying to use remote distribution, but frameworkUser and/or frameworkSuperUser not set!" + "Some features may not work"); } String nodeManagerUri = myriadExecutorConfiguration.getNodeManagerUri().get(); LOGGER.info("Getting Hadoop distribution from: {}", nodeManagerUri); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(nodeManagerUri).setExtract(false).build()); } return uris; }</code><technical_language>NodeManager URI a required field? should, I missing something</technical_language>

Target:
protected List<Protos.CommandInfo.URI> getUris() { List<Protos.CommandInfo.URI> uris = new ArrayList<>(); if (myriadExecutorConfiguration.getJvmUri().isPresent()) { final String jvmRemoteUri = myriadExecutorConfiguration.getJvmUri().get(); LOGGER.info("Getting JRE distribution from:" + jvmRemoteUri); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(jvmRemoteUri).build()); } if (myriadExecutorConfiguration.getConfigUri().isPresent()) { String configURI = myriadExecutorConfiguration.getConfigUri().get(); LOGGER.info("Getting Hadoop configuration from: {}", configURI); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(configURI).build()); } else if (myriadExecutorConfiguration.getNodeManagerUri().isPresent()) { String configURI = getConfigurationUrl(); LOGGER.info("Getting Hadoop configuration from: {}", configURI); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(configURI).build()); } if (myriadExecutorConfiguration.getNodeManagerUri().isPresent()) { if (!(myriadConfiguration.getFrameworkUser().isPresent() && myriadConfiguration.getFrameworkSuperUser().isPresent())) { LOGGER.warn("Trying to use remote distribution, but frameworkUser and/or frameworkSuperUser not set!" + "Some features may not work"); } String nodeManagerUri = myriadExecutorConfiguration.getNodeManagerUri().get(); LOGGER.info("Getting Hadoop distribution from: {}", nodeManagerUri); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(nodeManagerUri).setExtract(false).build()); } return uris; }
Source:
<code>public List<Order> getAllByProduct(Product product){ List<Order> orders = new ArrayList<>(); <START> for ( OrderProduct orderProduct :orderProductRepository.findAllByProduct(product)){ <END> orders.addAll(orderRepository.findAllByOrderProducts(orderProduct)); } return orders; }</code><technical_language>Fix formatting</technical_language>

Target:
public List<Order> getAllByProduct(Product product) { return orderProductRepository.findAllByProduct(product).stream() .map(orderRepository::findAllByOrderProducts) .flatMap(List::stream) .collect(Collectors.toList()); }
Source:
<code>public boolean equals(Object obj) { if (obj instanceof GridProfileId) { final GridProfileId other = (GridProfileId) obj; if (this.gp.getPort() == other.gp.getPort()) { final String thisHost = this.gp.getHost(); final String otherHost = other.gp.getHost(); if (thisHost != null) { if (thisHost.equals(otherHost)) { <START> return this.getMemberId().equals(other.getMemberId()); <END> } } else { return (otherHost == null); } } } return false; }</code><technical_language>getMemberId().getUniqueId() instead of getMemberId(), calculate hashCode?</technical_language>

Target:
public boolean equals(Object obj) { if (obj instanceof GridProfileId) { final GridProfileId other = (GridProfileId) obj; if (this.gp.getPort() == other.gp.getPort()) { final String thisHost = this.gp.getHost(); final String otherHost = other.gp.getHost(); if (thisHost != null) { if (thisHost.equals(otherHost)) { if (this.getMemberId() != null) { return this.getMemberId().getUniqueId().equals(other.getMemberId().getUniqueId()); } else { return other.getMemberId() == null; } } } else { return (otherHost == null); } } } return false; }
Source:
<code>public void run() { try { LogLevelAdjuster.register(); <START> final Injector injector = Initialization.makeInjectorWithModules( <END> getBaseInjector(), getModules() ); final Lifecycle lifecycle = injector.getInstance(Lifecycle.class); final HadoopDruidIndexerJob job = injector.getInstance(HadoopDruidIndexerJob.class); try { lifecycle.start(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } job.run(); try { lifecycle.stop(); } catch (Throwable t) { log.error(t, "Error when stopping. Failing."); System.exit(1); } } catch (Exception e) { throw com.google.common.base.Throwables.propagate(e); } }</code><technical_language>created a method in base class do this for you, it</technical_language>

Target:
public void run() { try { Injector injector = makeInjector(); final HadoopDruidIndexerJob job = injector.getInstance(HadoopDruidIndexerJob.class); Lifecycle lifecycle = initLifecycle(injector); job.run(); try { lifecycle.stop(); } catch (Throwable t) { log.error(t, "Error when stopping. Failing."); System.exit(1); } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code>private List<ReportSender> getSenderInstances(@NonNull CoreConfiguration config) { List<Class<? extends ReportSenderFactory>> factoryClasses = config.reportSenderFactoryClasses(); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "config#reportSenderFactoryClasses : " + factoryClasses); final List<ReportSenderFactory> factories; if (factoryClasses.isEmpty()) { <START> if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "No reportSenderFactoryClasses - loading using PluginLoader to find ReportSenders"); <END> final PluginLoader loader = config.pluginLoader(); factories = loader.loadEnabled(config, ReportSenderFactory.class); } else { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Creating reportSenderFactories for reportSenderFactory config"); factories = new InstanceCreator().create(factoryClasses); } if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "reportSenderFactories : " + factories); final List<ReportSender> reportSenders = new ArrayList<>(); for (ReportSenderFactory factory : factories) { final ReportSender sender = factory.create(this.getApplication(), config); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Adding reportSender : " + sender); reportSenders.add(sender); } if (reportSenders.isEmpty()) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "No ReportSenders configured - adding NullSender"); reportSenders.add(new NullSender()); } return reportSenders; }</code><technical_language>This sounds a warning. plugin loader is default, I warn if is</technical_language>

Target:
private List<ReportSender> getSenderInstances(@NonNull CoreConfiguration config) { List<Class<? extends ReportSenderFactory>> factoryClasses = config.reportSenderFactoryClasses(); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "config#reportSenderFactoryClasses : " + factoryClasses); final List<ReportSenderFactory> factories; if (factoryClasses.isEmpty()) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Using PluginLoader to find ReportSender factories"); final PluginLoader loader = config.pluginLoader(); factories = loader.loadEnabled(config, ReportSenderFactory.class); } else { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Creating reportSenderFactories for reportSenderFactory config"); factories = new InstanceCreator().create(factoryClasses); } if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "reportSenderFactories : " + factories); final List<ReportSender> reportSenders = new ArrayList<>(); for (ReportSenderFactory factory : factories) { final ReportSender sender = factory.create(this.getApplication(), config); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Adding reportSender : " + sender); reportSenders.add(sender); } if (reportSenders.isEmpty()) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "No ReportSenders configured - adding NullSender"); reportSenders.add(new NullSender()); } return reportSenders; }
Source:
<code>public String getValue() { <START> return name().toLowerCase(); <END> }</code><technical_language>preferred store of type in case instead of creating time this method invoked</technical_language>

Target:
public String getValue() { return value; }
Source:
<code>public void initShouldRaiseMessagingExceptionWhenInvalidClassName() throws MessagingException { FakeMatcherConfig mci = FakeMatcherConfig.builder() .matcherName("HasException") .condition("java.lang.InvalidClassName") .build(); <START> boolean exceptionRaised = false; <END> try { matcher.init(mci); } catch (MessagingException e) { exceptionRaised = true; } assertThat(exceptionRaised).isTrue(); }</code><technical_language>assertThatThrownBy(() -> matcher.init(mci)) .isInstanceOf(MessagingException.class);</technical_language>

Target:
public void initShouldRaiseMessagingExceptionWhenInvalidClassName() throws MessagingException { FakeMatcherConfig matcherConfig = FakeMatcherConfig.builder() .matcherName("HasException") .condition("java.lang.InvalidClassName") .build(); assertThatThrownBy(() -> testee.init(matcherConfig)).isInstanceOf(MessagingException.class); }
Source:
<code>public static String getString(String key) { String value = System.getProperty(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (system): {0} => {1}", new Object[] {key, value}); } return value; } value = tryGetValueFromContext(key); if (value != null) { <START> LOGGER.log(Level.CONFIG, "Property (context): {0} => {1}", new Object[]{key, value}); <END> return value; } if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (not found): {0} => {1}", new Object[] {key, value}); } return null; }</code><technical_language>check for log level, other cases (similar below)</technical_language>

Target:
public static String getString(String key) { String value = System.getProperty(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (system): {0} => {1}", new Object[] {key, value}); } return value; } value = tryGetValueFromContext(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (context): {0} => {1}", new Object[]{key, value}); } return value; } if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (not found): {0} => {1}", new Object[] {key, value}); } return null; }
Source:
<code>public void testCacheLockingConcurrency() throws Exception { System.setProperty(DataSpaceNodeConfigurationAgent.NODE_DATASPACE_CACHE_CLEANING_PERIOD, "100"); DataSpaceNodeConfigurationAgent nodeConfigurationAgent = (DataSpaceNodeConfigurationAgent) PAActiveObject .newActive(DataSpaceNodeConfigurationAgent.class.getName(), null); boolean result = nodeConfigurationAgent.configureNode(); PAActiveObject.terminateActiveObject(nodeConfigurationAgent, false); Future future = executor.submit(new Runnable() { @Override public void run() { <START> lockAndWait(40000); <END> } }); Thread.sleep(5000); Future[] futures = new Future[NB_TASKS - 1]; for (int i = 0; i < NB_TASKS - 1; i++) { futures[i] = executor.submit(new Runnable() { @Override public void run() { lockAndWait(1000); } }); } future.get(); for (int i = 0; i < NB_TASKS - 1; i++) { Assert.assertTrue(futures[i].isDone()); } }</code><technical_language>divided 2 :)</technical_language>

Target:
public void testCacheLockingConcurrency() throws Exception { System.setProperty(DataSpaceNodeConfigurationAgent.NODE_DATASPACE_CACHE_CLEANING_PERIOD, "100"); DataSpaceNodeConfigurationAgent nodeConfigurationAgent = (DataSpaceNodeConfigurationAgent) PAActiveObject .newActive(DataSpaceNodeConfigurationAgent.class.getName(), null); boolean result = nodeConfigurationAgent.configureNode(); PAActiveObject.terminateActiveObject(nodeConfigurationAgent, false); Future future = executor.submit(new Runnable() { @Override public void run() { lockAndWait(20000); } }); Thread.sleep(2000); Future[] futures = new Future[NB_TASKS - 1]; for (int i = 0; i < NB_TASKS - 1; i++) { futures[i] = executor.submit(new Runnable() { @Override public void run() { lockAndWait(500); } }); } future.get(); for (int i = 0; i < NB_TASKS - 1; i++) { Assert.assertTrue(futures[i].isDone()); } }
Source:
<code>public void testAnnotation() { String[] variant = { "12:g.43130875C>G", "12:g.43130996C>G" }; <START> VariantAnnotation ann0 = this.fetchVariantAnnotationGET(variant[0]); <END> assertEquals(43130875, ann0.getStart().intValue()); VariantAnnotation[] anns = this.fetchVariantAnnotationPOST(Arrays.asList(variant)); assertEquals(anns[0].getStart().intValue(), ann0.getStart().intValue()); }</code><technical_language>..or configure integration tests mixins get correct mapping :)</technical_language>

Target:
public void testAnnotation() { String[] variants = { "12:g.43130875C>G", "12:g.43130996C>G", "INVALID" }; String variantAllele = ((HashMap)((ArrayList) this.fetchVariantAnnotationGET(variants[0]).get("intergenic_consequences")).get(0)).get("variantAllele").toString(); assertEquals("G", variantAllele); assertEquals(variants.length - 1, this.fetchVariantAnnotationPOST(variants).size()); String variantAllele0 = ((HashMap)((ArrayList) this.fetchVariantAnnotationPOST(variants).get(0).get("intergenic_consequences")).get(0)).get("variantAllele").toString(); assertEquals(variantAllele, variantAllele0); }
Source:
<code>public String render(ModelAndView modelAndView) { Template template = velocityEngine.getTemplate(provider.layout(), "utf-8"); Object model = modelAndView.getModel(); if (model == null) { model = Collections.emptyMap(); } if (model instanceof Map) { VelocityContext context = initialContextProvider.getVelocityContext((Map) model, controller, modelAndView.getViewName()); StringWriter writer = new StringWriter(); template.merge(context, writer); Object meta = context.get("meta"); <START> context.put("meta", new Gson().toJson(meta)); <END> return writer.toString(); } else { throw new IllegalArgumentException("modelAndView must be of type java.util.Map"); } }</code><technical_language>Gson instances slightly heavy object construct. Consider putting in a static variable</technical_language>

Target:
public String render(ModelAndView modelAndView) { Template template = velocityEngine.getTemplate(provider.layout(), "utf-8"); Object model = modelAndView.getModel(); if (model == null) { model = Collections.emptyMap(); } if (model instanceof Map) { VelocityContext context = initialContextProvider.getVelocityContext((Map) model, controller, modelAndView.getViewName()); StringWriter writer = new StringWriter(); template.merge(context, writer); Object meta = context.get("meta"); context.put("meta", GSON.toJson(meta)); return writer.toString(); } else { throw new IllegalArgumentException("modelAndView must be of type java.util.Map"); } }
Source:
<code>public List<Job<?, ?>> filterJobs(Collection<? extends Item> items) { List<Job<?, ?>> jobs = new ArrayList<Job<?, ?>>(); if (items == null) { return jobs; } <START> for (ItemGroup<?> folder : filter(items, abstractFolderClass)) { <END> List<Job> groupJobs = filter(folder.getItems(), Job.class); for (Job job : groupJobs) { String relativename = job.getRelativeNameFrom(folder); boolean shouldInclude = includePattern == null || includePattern.matcher(relativename).find(); boolean shouldExclude = excludePattern != null && excludePattern.matcher(relativename).find(); if (shouldInclude && !shouldExclude) { jobs.add(job); } } } for (Job job : filter(items, Job.class)) { jobs.add(job); } return jobs; }</code><technical_language>NPE if Folder plugin installed. acceptance tests give result</technical_language>

Target:
public List<Job<?, ?>> filterJobs(Collection<? extends Item> items) { List<Job<?, ?>> jobs = new ArrayList<Job<?, ?>>(); if (items == null) { return jobs; } if (abstractFolderClass != null) { for (ItemGroup<?> folder : filter(items, abstractFolderClass)) { Collection<?> folderItems = folder.getItems(); if (folderItems == null) { continue; } List<Job> groupJobs = filter(folderItems, Job.class); for (Job job : groupJobs) { String relativename = job.getRelativeNameFrom(folder); boolean shouldInclude = includePattern == null || includePattern.matcher(relativename).find(); boolean shouldExclude = excludePattern != null && excludePattern.matcher(relativename).find(); if (shouldInclude && !shouldExclude) { jobs.add(job); } } } } for (Job job : filter(items, Job.class)) { jobs.add(job); } return jobs; }
Source:
<code>public ScheduleInfoResource getSchedule( @PathVariable("name") String scheduleName) { <START> return taskAssembler.toResource(schedulerService.getSchedule(scheduleName)); <END> }</code><technical_language>this.schedulerService</technical_language>

Target:
public ScheduleInfoResource getSchedule( @PathVariable("name") String scheduleName) { return taskAssembler.toResource(this.schedulerService.getSchedule(scheduleName)); }