auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<Contentlet> filterRelatedContent(Contentlet contentlet, Relationship rel, User user, boolean respectFrontendRoles, Boolean pullByParent, int limit, int offset, String sortBy) throws DotDataException, DotSecurityException { return filterRelatedContent(contentlet, rel, user, respectFrontendRoles, pullByParent, limit, offset); }

Target:
public List<Contentlet> filterRelatedContent(Contentlet contentlet, Relationship rel, User user, boolean respectFrontendRoles, Boolean pullByParent, int limit, int offset, String sortBy) throws DotDataException, DotSecurityException { Logger.warn(this, "This implementation of ContentletAPI.filterRelatedContent is deprecated and no longer respects the sort. " + "Please, use any of the getRelatedContent implementations existing in the ContentletAPI instead "); return filterRelatedContent(contentlet, rel, user, respectFrontendRoles, pullByParent, limit, offset); }
Source:
void display(final PrintWriter out) throws NoSuchGroupException { final ColumnFormatter formatter = new ColumnFormatter(out, '\t'); for (final GroupInfo info : get()) { formatter.addColumn(info.name != null ? info.name : "n/a"); if (verboseOutput) { AccountGroup o = info.ownerId != null ? groupCache.get(new AccountGroup.UUID(Url.decode(info.ownerId))) : null; formatter.addColumn(Url.decode(info.id)); formatter.addColumn(Strings.nullToEmpty(info.description)); formatter.addColumn(o != null ? o.getName() : "n/a"); formatter.addColumn(o != null ? o.getGroupUUID().get() : ""); formatter.addColumn(Boolean.toString( Objects.firstNonNull(info.visibleToAll, Boolean.FALSE))); } formatter.nextLine(); } formatter.finish(); }

Target:
void display(final PrintWriter out) throws NoSuchGroupException { final ColumnFormatter formatter = new ColumnFormatter(out, '\t'); for (final GroupInfo info : get()) { formatter.addColumn(Objects.firstNonNull(info.name, "n/a")); if (verboseOutput) { AccountGroup o = info.ownerId != null ? groupCache.get(new AccountGroup.UUID(Url.decode(info.ownerId))) : null; formatter.addColumn(Url.decode(info.id)); formatter.addColumn(Strings.nullToEmpty(info.description)); formatter.addColumn(o != null ? o.getName() : "n/a"); formatter.addColumn(o != null ? o.getGroupUUID().get() : ""); formatter.addColumn(Boolean.toString( Objects.firstNonNull(info.visibleToAll, Boolean.FALSE))); } formatter.nextLine(); } formatter.finish(); }
Source:
private static void makeAndroidParamsRequest(String appId, String userId) { if (getRemoteParams() != null) return; OneSignalRemoteParams.makeAndroidParamsRequest(appId, userId, new OneSignalRemoteParams.CallBack() { @Override public void complete(OneSignalRemoteParams.Params params) { if (params.googleProjectNumber != null) googleProjectNumber = params.googleProjectNumber; remoteParamController.saveRemoteParams(params, trackerFactory, preferences, logger); NotificationChannelManager.processChannelList( OneSignal.appContext, params.notificationChannels ); } }); }

Target:
private static void makeAndroidParamsRequest(String appId, String userId) { if (getRemoteParams() != null) return; OneSignalRemoteParams.makeAndroidParamsRequest(appId, userId, new OneSignalRemoteParams.Callback() { @Override public void complete(OneSignalRemoteParams.Params params) { if (params.googleProjectNumber != null) googleProjectNumber = params.googleProjectNumber; remoteParamController.saveRemoteParams(params, trackerFactory, preferences, logger); onRemoteParamSet(); NotificationChannelManager.processChannelList( OneSignal.appContext, params.notificationChannels ); } }); }
Source:
public void testImmutableOriginalsWithConfigProvidersProps() { Properties providers = new Properties(); providers.put("config.providers", "file"); providers.put("config.providers.file.class", "org.apache.kafka.common.config.provider.MockFileConfigProvider"); Properties props = new Properties(); props.put("sasl.kerberos.key", "${file:/usr/kerberos:key}"); final Map<String, ?> immutableMap = convertPropertiesToMap(providers); TestIndirectConfigResolution config = new TestIndirectConfigResolution(props, immutableMap); assertEquals(config.originals().get("sasl.kerberos.key"), "testKey"); }

Target:
public void testImmutableOriginalsWithConfigProvidersProps() { Properties providers = new Properties(); providers.put("config.providers", "file"); providers.put("config.providers.file.class", "org.apache.kafka.common.config.provider.MockFileConfigProvider"); Properties props = new Properties(); props.put("sasl.kerberos.key", "${file:/usr/kerberos:key}"); Map<?, ?> immutableMap = Collections.unmodifiableMap(props); Map<String, ?> provMap = convertPropertiesToMap(providers); TestIndirectConfigResolution config = new TestIndirectConfigResolution(immutableMap, provMap); assertEquals(config.originals().get("sasl.kerberos.key"), "testKey"); }
Source:
public final void messageLogged( BuildEvent event ) { String msg = event.getMessage(); switch ( event.getPriority() ) { case Project.MSG_ERR: if ( msg.indexOf( "ar: creating archive" ) >= 0 ) { log.debug( msg ); } else if ( msg.indexOf( "warning" ) >= 0 ) { log.warn( msg ); } else { log.error( msg ); } break; case Project.MSG_WARN: log.warn( msg ); break; case Project.MSG_INFO: if ( ( msg.indexOf( "files were compiled" ) >= 0 ) || ( msg.indexOf( "Linking..." ) >= 0 ) ) { log.info( msg ); } else if ( msg.indexOf( "error" ) >= 0 ) { log.error( msg ); } else if ( msg.indexOf( "warning" ) >= 0 ) { log.warn( msg ); } else { log.info( msg ); } break; case Project.MSG_VERBOSE: log.debug( msg ); break; default: case Project.MSG_DEBUG: log.debug( msg ); break; } }

Target:
public final void messageLogged( BuildEvent event ) { String msg = event.getMessage(); switch ( event.getPriority() ) { case Project.MSG_ERR: if ( msg.indexOf( "ar: creating archive" ) >= 0 ) { log.debug( msg ); } else if ( msg.indexOf( "warning" ) >= 0 ) { log.warn( msg ); } else { log.error( msg ); } break; case Project.MSG_WARN: log.warn( msg ); break; case Project.MSG_INFO: log.info( msg ); break; case Project.MSG_VERBOSE: log.debug( msg ); break; default: case Project.MSG_DEBUG: log.debug( msg ); break; } }
Source:
private void reloadDashboard() { Log.i(TAG, "reloadDashboard"); IProgramRepository programLocalDataSource = new ProgramLocalDataSource(); IMainExecutor mainExecutor = new UIThreadExecutor(); IAsyncExecutor asyncExecutor = new AsyncExecutor(); GetUserProgramUIDUseCase getUserProgramUIDUseCase = new GetUserProgramUIDUseCase( programLocalDataSource, mainExecutor, asyncExecutor); getUserProgramUIDUseCase.execute(new GetUserProgramUIDUseCase.Callback() { @Override public void onSuccess(String uid) { List<Survey> unsentSurveys = Survey.getAllUnsentMalariaSurveys(uid); List<Survey> sentSurveys = Survey.getAllSentMalariaSurveys(uid); Session.putServiceValue(ALL_UNSENT_SURVEYS_ACTION, unsentSurveys); Session.putServiceValue(ALL_SENT_SURVEYS_ACTION, sentSurveys); LocalBroadcastManager.getInstance(SurveyService.this).sendBroadcast( new Intent(ALL_UNSENT_SURVEYS_ACTION)); LocalBroadcastManager.getInstance(SurveyService.this).sendBroadcast( new Intent(ALL_SENT_SURVEYS_ACTION)); } @Override public void onError() { Log.e(TAG, "error getting user program"); } }); }

Target:
private void reloadDashboard() { Log.i(TAG, "reloadDashboard"); getProgramUID(new Callback() { @Override public void onSuccess(String uid) { List<Survey> unsentSurveys = Survey.getAllUnsentMalariaSurveys(uid); List<Survey> sentSurveys = Survey.getAllSentMalariaSurveys(uid); Session.putServiceValue(ALL_UNSENT_SURVEYS_ACTION, unsentSurveys); Session.putServiceValue(ALL_SENT_SURVEYS_ACTION, sentSurveys); LocalBroadcastManager.getInstance(SurveyService.this).sendBroadcast( new Intent(ALL_UNSENT_SURVEYS_ACTION)); LocalBroadcastManager.getInstance(SurveyService.this).sendBroadcast( new Intent(ALL_SENT_SURVEYS_ACTION)); } }); }
Source:
private void startBulkRegionOperation(boolean writeLockNeeded) throws NotServingRegionException, IOException { if (this.closing.get()) { throw new NotServingRegionException(getRegionInfo().getRegionNameAsString() + " is closing"); } if (writeLockNeeded) lock(lock.writeLock()); else lock(lock.readLock()); if (this.closed.get()) { if (writeLockNeeded) lock.writeLock().unlock(); else lock.readLock().unlock(); throw new NotServingRegionException(getRegionInfo().getRegionNameAsString() + " is closed"); } regionLockHolders.add(Thread.currentThread()); }

Target:
private void startBulkRegionOperation(boolean writeLockNeeded) throws IOException { if (this.closing.get()) { throw new NotServingRegionException(getRegionInfo().getRegionNameAsString() + " is closing"); } if (writeLockNeeded) lock(lock.writeLock()); else lock(lock.readLock()); if (this.closed.get()) { if (writeLockNeeded) lock.writeLock().unlock(); else lock.readLock().unlock(); throw new NotServingRegionException(getRegionInfo().getRegionNameAsString() + " is closed"); } regionLockHolders.put(Thread.currentThread(), true); }
Source:
private Dialog createDeleteDialog(){ return new AlertDialog.Builder(this, R.style.Theme_Syncthing_Dialog) .setMessage(R.string.remove_device_confirm) .setPositiveButton(android.R.string.yes, (dialogInterface, i) -> { getApi().removeDevice(mDevice.deviceID); finish(); }) .setNegativeButton(android.R.string.no, null) .create(); }

Target:
private Dialog createDeleteDialog(){ return Util.getAlertDialogBuilder(this) .setMessage(R.string.remove_device_confirm) .setPositiveButton(android.R.string.yes, (dialogInterface, i) -> { getApi().removeDevice(mDevice.deviceID); finish(); }) .setNegativeButton(android.R.string.no, null) .create(); }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { Set<PermissionSubject> permissionSet = new HashSet<>(); permissionSet.add(new PermissionSubject(getStorageDomainId(), VdcObjectType.Storage, getActionType().getActionGroup())); if (getClusterId() != null) { permissionSet.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.CREATE_VM)); } return new ArrayList<>(permissionSet); }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); permissionList.add(new PermissionSubject(getStorageDomainId(), VdcObjectType.Storage, getActionType().getActionGroup())); return permissionList; }
Source:
public Optional<Value<Entity>> getApiValueFromContainer(ValueContainer<?> container) { if (container instanceof net.minecraft.entity.Entity) { net.minecraft.entity.Entity currentEntity = (net.minecraft.entity.Entity) container; while (currentEntity != null && currentEntity.isRiding()) { currentEntity = currentEntity.ridingEntity; } final Entity baseVehicle = (Entity) currentEntity; return Optional.<Value<Entity>>of(new SpongeValue<Entity>(Keys.BASE_VEHICLE, baseVehicle)); } return Optional.absent(); }

Target:
public Optional<Value<Entity>> getApiValueFromContainer(ValueContainer<?> container) { if (container instanceof net.minecraft.entity.Entity) { net.minecraft.entity.Entity currentEntity = ((net.minecraft.entity.Entity) container).ridingEntity; while (currentEntity != null && currentEntity.isRiding()) { currentEntity = currentEntity.ridingEntity; } final Entity baseVehicle = (Entity) currentEntity; return Optional.<Value<Entity>>of(new SpongeValue<Entity>(Keys.BASE_VEHICLE, baseVehicle)); } return Optional.absent(); }
Source:
@Test public void requestConverterFactorySkippedNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingConverterFactory nonMatchingFactory1 = new NonMatchingConverterFactory(); NonMatchingConverterFactory nonMatchingFactory2 = new NonMatchingConverterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(nonMatchingFactory1) .addConverterFactory(nonMatchingFactory2) .build(); try { retrofit.nextRequestBodyConverter(nonMatchingFactory1, type, annotations); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("" + "Could not locate RequestBody converter for class java.lang.String.\n" + " Skipped:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory\n" + " Tried:\n" + " * retrofit2.helpers.NonMatchingConverterFactory"); } assertThat(nonMatchingFactory1.called).isFalse(); assertThat(nonMatchingFactory2.called).isTrue(); }

Target:
@Test public void requestConverterFactorySkippedNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingConverterFactory nonMatchingFactory1 = new NonMatchingConverterFactory(); NonMatchingConverterFactory nonMatchingFactory2 = new NonMatchingConverterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(nonMatchingFactory1) .addConverterFactory(nonMatchingFactory2) .build(); try { retrofit.nextRequestBodyConverter(nonMatchingFactory1, type, annotations); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("" + "Could not locate RequestBody converter for class java.lang.String.\n" + " Skipped:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory\n" + " Tried:\n" + " * retrofit2.helpers.NonMatchingConverterFactory"); } assertThat(nonMatchingFactory1.called).isFalse(); assertThat(nonMatchingFactory2.called).isTrue(); }
Source:
private void writeVGpu() { String mdevTypes = vmCustomProperties.remove("mdev_type"); if (mdevTypes != null) { String[] mdevDevices = mdevTypes.split(","); for (String mdevType : mdevDevices) { writer.writeStartElement("hostdev"); writer.writeAttributeString("mode", "subsystem"); writer.writeAttributeString("type", "mdev"); writer.writeAttributeString("model", "vfio-pci"); writer.writeStartElement("source"); String address = Guid.newGuid().toString(); writer.writeStartElement("address"); writer.writeAttributeString("uuid", address); writer.writeEndElement(); writer.writeEndElement(); writer.writeEndElement(); String mdevTypeMeta = mdevType; if (FeatureSupported.isVgpuPlacementSupported(vm.getCompatibilityVersion())) { VgpuPlacementEnum vgpuPlacement = hostVgpuPlacementSupplier.get(); String vgpuPlacementString; if (vgpuPlacement == VgpuPlacementEnum.COMPACT) { vgpuPlacementString = "compact"; } else if (vgpuPlacement == VgpuPlacementEnum.SEPARATE) { vgpuPlacementString = "separate"; } else { log.error("Unrecognized vGPU placement type (using `{}' instead): {}", VgpuPlacementEnum.COMPACT, vgpuPlacement); vgpuPlacementString = "compact"; } mdevTypeMeta = mdevTypeMeta + "|" + vgpuPlacementString; } mdevMetadata.put(address, Collections.singletonMap("mdevType", mdevTypeMeta)); } } }

Target:
private void writeVGpu() { String mdevTypes = vmCustomProperties.remove("mdev_type"); if (mdevTypes != null) { String[] mdevDevices = mdevTypes.split(","); for (String mdevType : mdevDevices) { writer.writeStartElement("hostdev"); writer.writeAttributeString("mode", "subsystem"); writer.writeAttributeString("type", "mdev"); writer.writeAttributeString("model", "vfio-pci"); writer.writeStartElement("source"); String address = Guid.newGuid().toString(); writer.writeStartElement("address"); writer.writeAttributeString("uuid", address); writer.writeEndElement(); writer.writeEndElement(); writer.writeEndElement(); String mdevTypeMeta = mdevType; if (FeatureSupported.isVgpuPlacementSupported(vm.getCompatibilityVersion())) { VgpuPlacementEnum vgpuPlacement = hostVgpuPlacementSupplier.get(); String vgpuPlacementString; if (vgpuPlacement == VgpuPlacementEnum.COMPACT) { vgpuPlacementString = "compact"; } else if (vgpuPlacement == VgpuPlacementEnum.SEPARATE) { vgpuPlacementString = "separate"; } else { log.warn("Unrecognized vGPU placement type (using `{}' instead): {}", VgpuPlacementEnum.COMPACT, vgpuPlacement); vgpuPlacementString = "compact"; } mdevTypeMeta = mdevTypeMeta + "|" + vgpuPlacementString; } mdevMetadata.put(address, Collections.singletonMap("mdevType", mdevTypeMeta)); } } }
Source:
public void updateUserWithEmailAsUsername() { switchRegistrationEmailAsUsername(true); String id = createUser(); UserResource user = realm.users().get(id); UserRepresentation userRep = user.toRepresentation(); assertEquals("user1@localhost", userRep.getEmail()); userRep.setEmail("user11@localhost"); updateUser(user, userRep); userRep = realm.users().get(id).toRepresentation(); assertEquals("user11@localhost", userRep.getEmail()); switchRegistrationEmailAsUsername(false); }

Target:
public void updateUserWithEmailAsUsername() { switchRegistrationEmailAsUsername(true); String id = createUser(); UserResource user = realm.users().get(id); UserRepresentation userRep = user.toRepresentation(); assertEquals("user1@localhost", userRep.getUsername()); userRep.setEmail("user11@localhost"); updateUser(user, userRep); userRep = realm.users().get(id).toRepresentation(); assertEquals("user11@localhost", userRep.getUsername()); switchRegistrationEmailAsUsername(false); }
Source:
public void testHttpIngestionInvalidPastCollectionTime() throws Exception { long time = System.currentTimeMillis() - 600000 - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); HttpPost post = new HttpPost(getMetricsURI()); HttpEntity entity = new StringEntity( JSONMetricsContainerTest.generateJSONMetricsData( time ) , ContentType.APPLICATION_JSON); post.setEntity(entity); HttpResponse response = client.execute(post); assertEquals( 400, response.getStatusLine().getStatusCode() ); String[] output = getBodyArray( response ); assertTrue( Pattern.matches( JSONMetricsContainerTest.PAST_COLLECTION_TIME_REGEX, output[ 1 ] ) ); assertTrue( Pattern.matches( JSONMetricsContainerTest.PAST_COLLECTION_TIME_REGEX, output[ 2 ] ) ); assertTrue( Pattern.matches( JSONMetricsContainerTest.PAST_COLLECTION_TIME_REGEX, output[ 3 ] ) ); EntityUtils.consume(response.getEntity()); }

Target:
public void testHttpIngestionInvalidPastCollectionTime() throws Exception { long time = System.currentTimeMillis() - 600000 - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); HttpPost post = new HttpPost(getMetricsURI()); HttpEntity entity = new StringEntity( JSONMetricsContainerTest.generateJSONMetricsData( time ) , ContentType.APPLICATION_JSON); post.setEntity(entity); HttpResponse response = client.execute(post); assertEquals( 400, response.getStatusLine().getStatusCode() ); String[] output = getBodyArray( response ); assertTrue( Pattern.matches( JSONMetricsContainerTest.PAST_COLLECTION_TIME_REGEX, output[ 1 ] ) ); assertTrue( Pattern.matches( JSONMetricsContainerTest.PAST_COLLECTION_TIME_REGEX, output[ 2 ] ) ); assertTrue( Pattern.matches( JSONMetricsContainerTest.PAST_COLLECTION_TIME_REGEX, output[ 3 ] ) ); }
Source:
public void setVmBackup(VmBackup value) { vmBackup = value; }

Target:
public void setVmBackup(VmBackup value) { this.vmBackup = value; }
Source:
public Predicate<String> create(final String resourceGroup, final URI vaultUri, final boolean shouldBePresent) { checkNotNull(resourceGroup, "resourceGroup cannot be null"); checkNotNull(vaultUri, "vaultUri cannot be null"); return retry(new Predicate<String>() { @Override public boolean apply(final String name) { boolean present = false; checkNotNull(name, "name cannot be null"); DeletedKeyBundle key = api.getVaultApi(resourceGroup).getDeletedKey(vaultUri, name); if (shouldBePresent) { return key != null; } else { return key == null; } } }, operationTimeout, initialPeriod, maxPeriod); }

Target:
public Predicate<String> create(final String resourceGroup, final URI vaultUri, final boolean shouldBePresent) { checkNotNull(resourceGroup, "resourceGroup cannot be null"); checkNotNull(vaultUri, "vaultUri cannot be null"); return retry(new Predicate<String>() { @Override public boolean apply(final String name) { checkNotNull(name, "name cannot be null"); boolean present = false; DeletedKeyBundle key = api.getVaultApi(resourceGroup).getDeletedKey(vaultUri, name); return shouldBePresent == (key != null); } }, operationTimeout, initialPeriod, maxPeriod); }
Source:
private String getStringFromIS(InputStream stream) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) { return reader.lines().collect(Collectors.joining("\n")); } catch (IOException e) { e.printStackTrace(); return null; } }

Target:
private String getStringFromIS(InputStream stream) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) { return reader.lines().collect(Collectors.joining("\n")); } catch (IOException e) { e.printStackTrace(); return ""; } }
Source:
protected List<PurApAccountingLine> getItemSourceAccountingLines(PurchaseOrderAmendmentDocument document) { return getAccountingLinesFromItems(document, (itemStream) -> itemStream.flatMap(this::getItemSourceAccountingLinesAsStream)); }

Target:
protected List<PurApAccountingLine> getItemSourceAccountingLines(PurchaseOrderAmendmentDocument document) { List<PurApItem> items = (List<PurApItem>) document.getItems(); return items.stream() .flatMap((item) -> item.getSourceAccountingLines().stream()) .collect(Collectors.toCollection(ArrayList::new)); }
Source:
private void showAttachmentDialog(final Receipt receipt) { highlightedReceipt = receipt; BetterDialogBuilder dialogBuilder = new BetterDialogBuilder(getActivity()); dialogBuilder.setTitle(receipt.getName()) .setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel()); LayoutInflater inflater = this.getLayoutInflater(); final View dialogView = inflater.inflate(R.layout.dialog_receipt_attachment, null); dialogBuilder.setView(dialogView); final AlertDialog dialog = dialogBuilder.create(); dialogView.findViewById(R.id.attach_photo).setOnClickListener(v -> { imageUri = receiptAttachmentManager.attachPhoto(ReceiptsListFragment.this); dialog.cancel(); }); dialogView.findViewById(R.id.attach_picture).setOnClickListener(v -> { if (!receiptAttachmentManager.attachPicture(ReceiptsListFragment.this)) { Toast.makeText(getContext(), getString(R.string.error_no_file_intent_dialog_title), Toast.LENGTH_SHORT).show(); } dialog.cancel(); }); dialogView.findViewById(R.id.attach_file).setOnClickListener(v -> { if (!receiptAttachmentManager.attachFile(this)) { Toast.makeText(getContext(), getString(R.string.error_no_file_intent_dialog_title), Toast.LENGTH_SHORT).show(); } dialog.cancel(); }); dialog.show(); }

Target:
private void showAttachmentDialog(final Receipt receipt) { highlightedReceipt = receipt; ReceiptAttachmentDialogFragment.newInstance(receipt).show(getChildFragmentManager(), ReceiptAttachmentDialogFragment.class.getSimpleName()); }
Source:
public boolean isValid(Integer value, ConstraintValidatorContext context) { boolean result = value == null ? true : value >= min && value <= max; if (!result) { context.buildConstraintViolationWithTemplate(rangeMessage); } return result; }

Target:
public boolean isValid(Integer value, ConstraintValidatorContext context) { boolean result = value == null ? true : value >= min && value <= max; if (!result) { context.buildConstraintViolationWithTemplate(rangeMessage).addConstraintViolation(); } return result; }
Source:
public void process(final KeyFilter filter, final CacheLoaderTask task, Executor executor, boolean fetchValue, boolean fetchMetadata) { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; try { String sql = tableManipulation.getLoadNonExpiredAllRowsSql(); if (log.isTraceEnabled()) { log.tracef("Running sql %s", sql); } conn = connectionFactory.getConnection(); ps = conn.prepareStatement(sql); ps.setLong(1, ctx.getTimeService().wallClockTime()); rs = ps.executeQuery(); rs.setFetchSize(tableManipulation.getFetchSize()); ExecutorAllCompletionService ecs = new ExecutorAllCompletionService(executor); final TaskContextImpl taskContext = new TaskContextImpl(); while (rs.next()) { InputStream binaryStream = rs.getBinaryStream(1); final Bucket bucket = unmarshallBucket(binaryStream); ecs.submit(new Callable<Void>() { @Override public Void call() throws Exception { try { for (MarshalledEntry me : bucket.getStoredEntries(filter, ctx.getTimeService()).values()) { if (!taskContext.isStopped()) { task.processEntry(me, taskContext); } } return null; } catch (Exception e) { log.errorExecutingParallelStoreTask(e); throw e; } } }); } ecs.waitUntilAllCompleted(); if (ecs.isExceptionThrown()) { throw new CacheLoaderException("Execution exception!"); } } catch (SQLException e) { log.sqlFailureFetchingAllStoredEntries(e); throw new CacheLoaderException("SQL error while fetching all StoredEntries", e); } finally { JdbcUtil.safeClose(rs); JdbcUtil.safeClose(ps); connectionFactory.releaseConnection(conn); } }

Target:
public void process(final KeyFilter filter, final CacheLoaderTask task, Executor executor, boolean fetchValue, boolean fetchMetadata) { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; try { String sql = tableManipulation.getLoadNonExpiredAllRowsSql(); if (log.isTraceEnabled()) { log.tracef("Running sql %s", sql); } conn = connectionFactory.getConnection(); ps = conn.prepareStatement(sql); ps.setLong(1, ctx.getTimeService().wallClockTime()); rs = ps.executeQuery(); rs.setFetchSize(tableManipulation.getFetchSize()); ExecutorAllCompletionService ecs = new ExecutorAllCompletionService(executor); final TaskContextImpl taskContext = new TaskContextImpl(); while (rs.next()) { InputStream binaryStream = rs.getBinaryStream(1); final Bucket bucket = unmarshallBucket(binaryStream); ecs.submit(new Callable<Void>() { @Override public Void call() throws Exception { try { for (MarshalledEntry me : bucket.getStoredEntries(filter, ctx.getTimeService()).values()) { if (!taskContext.isStopped()) { task.processEntry(me, taskContext); } } return null; } catch (Exception e) { log.errorExecutingParallelStoreTask(e); throw e; } } }); } ecs.waitUntilAllCompleted(); if (ecs.isExceptionThrown()) { throw new CacheLoaderException("Execution exception!", ecs.getFirstException()); } } catch (SQLException e) { log.sqlFailureFetchingAllStoredEntries(e); throw new CacheLoaderException("SQL error while fetching all StoredEntries", e); } finally { JdbcUtil.safeClose(rs); JdbcUtil.safeClose(ps); connectionFactory.releaseConnection(conn); } }
Source:
public void update(T data, Query query) { assertDatabaseOpen(); ContentValues contentValues = new ContentValues(); getContentValuesPopulator().populate(contentValues, data); int num = database.update(getName(), contentValues, query.getWhereClause(), query.getWhereClauseValues()); Log.d(getLoggerTag(), "Updated " + num + "number of cols"); }

Target:
public void update(T data, Query query) { assertDatabaseOpen(); ContentValues contentValues = new ContentValues(); getContentValuesPopulator().populate(contentValues, data); int num = database.update(getName(), contentValues, query.getWhereClause(), query.getWhereClauseValues()); logger.debug("Updated number of cols", num); }
Source:
public void destroy() { throw new NoSuchMethodError("Thread.destroy()"); }

Target:
public void destroy() { throw new UnsupportedOperationException(); }
Source:
public void patchNameTest() throws Exception { context.turnOffAuthorisationSystem(); String testGroupName = "Test group"; Group group = GroupBuilder.createGroup(context) .withName(testGroupName) .build(); String newName = "New test name"; List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/name", newName); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform( patch("/api/eperson/groups/" + group.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(jsonPath("$.name", Matchers.is(newName))) .andExpect(status().isOk()); }

Target:
public void patchNameTest() throws Exception { context.turnOffAuthorisationSystem(); String testGroupName = "Test group"; Group group = GroupBuilder.createGroup(context) .withName(testGroupName) .build(); context.restoreAuthSystemState(); String newName = "New test name"; List<Operation> ops = new ArrayList<>(); ReplaceOperation replaceOperation = new ReplaceOperation("/name", newName); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform( patch("/api/eperson/groups/" + group.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(jsonPath("$.name", Matchers.is(newName))) .andExpect(status().isOk()); }
Source:
public void userOnMobileCanNotSeeThatPostWasEditedByAdministratorOnPostsListPage() { final PostEntity.Data data = updatePostAsStaffRemotely(createPostAsUserRemotely()); final PostEntity post = new PostsListPage().open(data.getId()).getPost().findNewestPost(); Assertion.assertFalse(post.hasEditedBySection(), SHOULD_NOT_HAVE_EDITED_BY_SECTION_MESSAGE); }

Target:
public void userOnMobileCanNotSeeThatPostWasEditedByAdministratorOnPostsListPage() { final PostEntity.Data data = updatePostAsStaffRemotely(createPostAsUserRemotely()); final PostEntity post = new PostsListPage().open(data.getId()).getPost().findPostById(data.getId()); Assertion.assertFalse(post.hasEditedBySection(), SHOULD_NOT_HAVE_EDITED_BY_SECTION_MESSAGE); }
Source:
private static void output(HttpAction action, String contentType, String charset, OutputContent proc, CacheAction cacheAction) { try { setHttpResponse(action, contentType, charset) ; action.response.setStatus(HttpSC.OK_200) ; OutputStream outServlet = action.response.getOutputStream(); Cache cache = SPARQL_Query_Cache.getCache(); OutputStream out = null; try { ByteArrayOutputStream outCache; byte[] data; if(CacheAction.Type.WRITE_CACHE == cacheAction.type) { outCache = new ByteArrayOutputStream(); out = new ResponseOutputStream(outServlet, outCache); proc.output(out); data = outCache.toByteArray(); CacheEntry cacheEntry = (CacheEntry) cache.getIfPresent(cacheAction.getKey()); cacheEntry.setData(data); cacheEntry.initialized(); cache.put(cacheAction.getKey(), cacheEntry); action.log.info("Writing cache "+ new String(data)); out.flush(); }else{ CacheEntry cacheEntry = (CacheEntry)cache.getIfPresent(cacheAction.getKey()); data = cacheEntry.getData(); outServlet.write(data); action.log.info("Reading cache "+ new String(data)); outServlet.flush(); } } catch (QueryCancelledException ex) { action.log.info(format("[%d] Query Cancelled - results truncated (but 200 already sent)", action.id)) ; out.flush() ; } } catch (IOException ex) { ServletOps.errorOccurred(ex) ; } }

Target:
private static void output(HttpAction action, String contentType, String charset, OutputContent proc, CacheAction cacheAction) { try { setHttpResponse(action, contentType, charset) ; action.response.setStatus(HttpSC.OK_200) ; OutputStream outServlet = action.response.getOutputStream(); Cache cache = SPARQL_Query_Cache.getCache(SPARQL_Query_Cache.getDatasetUri(action)); OutputStream out = null; try { ByteArrayOutputStream outCache; byte[] data; if(CacheAction.Type.WRITE_CACHE == cacheAction.type) { outCache = new ByteArrayOutputStream(); out = new TeeOutputStream(outServlet,outCache); proc.output(out); data = outCache.toByteArray(); CacheEntry cacheEntry = (CacheEntry) cache.getIfPresent(cacheAction.getKey()); cacheEntry.setData(data); cacheEntry.initialized(); cache.put(cacheAction.getKey(), cacheEntry); action.log.debug("Writing cache "+ new String(data)); out.flush(); }else{ CacheEntry cacheEntry = (CacheEntry)cache.getIfPresent(cacheAction.getKey()); data = cacheEntry.getData(); outServlet.write(data); action.log.debug("Reading cache "+ new String(data)); outServlet.flush(); } } catch (QueryCancelledException ex) { action.log.info(format("[%d] Query Cancelled - results truncated (but 200 already sent)", action.id)) ; out.flush() ; } } catch (IOException ex) { ServletOps.errorOccurred(ex) ; } }
Source:
public static <K, V> Duration getExpiryForCreation(K key, V value, ExpiryPolicy<? super K, ? super V> expiry) { Duration duration; try { duration = expiry.getExpiryForCreation(key, value); } catch (RuntimeException e) { LOG.error("Expiry computation caused an exception - Expiry duration will be 0", e); return null; } try { if (Duration.ZERO.compareTo(duration) >= 0) { return null; } } catch(NullPointerException e) { LOG.error("Expiry for creation can't be null - Expiry duration will be 0", e); return null; } return duration; }

Target:
public static <K, V> Duration getExpiryForCreation(K key, V value, ExpiryPolicy<? super K, ? super V> expiry) { Duration duration; try { duration = expiry.getExpiryForCreation(key, value); } catch (RuntimeException e) { LOG.error("Expiry computation caused an exception - Expiry duration will be 0", e); return Duration.ZERO; } if (duration == null) { LOG.error("Expiry for creation can't be null - Expiry duration will be 0"); return Duration.ZERO; } if (Duration.ZERO.compareTo(duration) >= 0) { return Duration.ZERO; } return duration; }
Source:
public EList<org.eclipse.sirius.diagram.description.filter.FilterDescription> getFilters() { if (filters == null) { filters = new EObjectContainmentEList.Resolving<org.eclipse.sirius.diagram.description.filter.FilterDescription>(org.eclipse.sirius.diagram.description.filter.FilterDescription.class, this, DescriptionPackage.DIAGRAM_DESCRIPTION__FILTERS); } return filters; }

Target:
public EList<FilterDescription> getFilters() { if (filters == null) { filters = new EObjectContainmentEList.Resolving<FilterDescription>(FilterDescription.class, this, DescriptionPackage.DIAGRAM_DESCRIPTION__FILTERS); } return filters; }
Source:
public List<ConsumerContentOverride> addContentOverrides( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, List<ConsumerContentOverride> entries) { Consumer consumer = verifyAndLookupConsumer(consumerUuid); Set<String> invalidOverrides = new HashSet<String>(); for (ConsumerContentOverride entry : entries) { if (overrideRules.canOverrideForConsumer(consumer, entry.getName())) { ConsumerContentOverride cco = consumerContentOverrideCurator.retrieve( consumer, entry.getContentLabel(), entry.getName()); if (cco != null) { cco.setValue(entry.getValue()); cco.setUpdated(null); consumerContentOverrideCurator.merge(cco); } else { entry.setConsumer(consumer); consumerContentOverrideCurator.create(entry); } } else { invalidOverrides.add(entry.getName()); } } if (invalidOverrides.size() > 0) { String error = i18n.tr("Not allowed to override values for: {0}", StringUtils.join(invalidOverrides, ", ")); throw new BadRequestException(error); } return consumerContentOverrideCurator.getList(consumer); }

Target:
public List<ConsumerContentOverride> addContentOverrides( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, List<ConsumerContentOverride> entries) { Consumer consumer = verifyAndLookupConsumer(consumerUuid); Set<String> invalidOverrides = new HashSet<String>(); for (ConsumerContentOverride entry : entries) { if (overrideRules.canOverrideForConsumer(consumer, entry.getName())) { ConsumerContentOverride cco = consumerContentOverrideCurator.retrieve( consumer, entry.getContentLabel(), entry.getName()); if (cco != null) { cco.setValue(entry.getValue()); cco.setUpdated(null); consumerContentOverrideCurator.merge(cco); } else { entry.setConsumer(consumer); consumerContentOverrideCurator.create(entry); } } else { invalidOverrides.add(entry.getName()); } } if (!invalidOverrides.isEmpty()) { String error = i18n.tr("Not allowed to override values for: {0}", StringUtils.join(invalidOverrides, ", ")); throw new BadRequestException(error); } return consumerContentOverrideCurator.getList(consumer); }
Source:
private void fireDeployDocEvent(final String target, final RenderedDocPreview docPreview, final RSConnectDeploymentRecord previous) { if (rmdInfoPending_) return; if (StringUtil.isNullOrEmpty(docPreview.getOutputFile())) { rmdInfoPending_ = true; rmdServer_.getRmdOutputInfo(target, new ServerRequestCallback<RmdOutputInfo>() { @Override public void onResponseReceived(RmdOutputInfo response) { RenderedDocPreview preview = new RenderedDocPreview( target, response.output_file_exists ? response.output_file : "", true); events_.fireEvent(RSConnectActionEvent.DeployDocEvent( preview, RSConnect.CONTENT_TYPE_DOCUMENT, previous)); rmdInfoPending_ = false; } @Override public void onError(ServerError error) { Debug.logError(error); rmdInfoPending_ = false; } }); } else { events_.fireEvent(RSConnectActionEvent.DeployDocEvent( docPreview, RSConnect.CONTENT_TYPE_DOCUMENT, previous)); } }

Target:
private void fireDeployDocEvent(final String target, final RenderedDocPreview docPreview, final RSConnectDeploymentRecord previous) { if (rmdInfoPending_) return; if (StringUtil.isNullOrEmpty(docPreview.getOutputFile())) { rmdInfoPending_ = true; rmdServer_.getRmdOutputInfo(target, new ServerRequestCallback<RmdOutputInfo>() { @Override public void onResponseReceived(RmdOutputInfo response) { RenderedDocPreview preview = new RenderedDocPreview( target, response.output_file_exists ? response.output_file : "", true); events_.fireEvent(RSConnectActionEvent.DeployDocEvent( preview, RSConnect.CONTENT_TYPE_DOCUMENT, previous)); rmdInfoPending_ = false; } @Override public void onError(ServerError error) { Debug.logError(error); display_.showErrorMessage("Content Publish Failed", "Unable to determine file to be published. Click Knit or Preview " + "to render it again, then click the Publish button above the rendered document."); rmdInfoPending_ = false; } }); } else { events_.fireEvent(RSConnectActionEvent.DeployDocEvent( docPreview, RSConnect.CONTENT_TYPE_DOCUMENT, previous)); } }
Source:
public <E> E attach(Class<E> extensionType, HandleSupplier handle) { ConfigRegistry instanceConfig = handle.getConfig().createCopy(); SqlObjectInitData data = sqlObjectCache.get(extensionType, handle.getConfig()); data.instanceConfigurer.apply(instanceConfig); if (data.concrete) { try { SqlObjectInitData.INIT_DATA.set(data); return extensionType.cast( Class.forName(extensionType.getPackage().getName() + "." + extensionType.getSimpleName() + "Impl") .getConstructor(HandleSupplier.class, ConfigRegistry.class) .newInstance(handle, instanceConfig)); } catch (ReflectiveOperationException | ExceptionInInitializerError e) { throw new UnableToCreateSqlObjectException(e); } finally { SqlObjectInitData.INIT_DATA.set(null); } } instanceConfig.get(Extensions.class).onCreateProxy(); Map<Method, Supplier<InContextInvoker>> handlers = new HashMap<>(); final Object proxy = Proxy.newProxyInstance( extensionType.getClassLoader(), new Class[] {extensionType}, (p, m, a) -> handlers.get(m).get().invoke(a)); data.methodHandlers.forEach((m, h) -> handlers.put(m, data.lazyInvoker(proxy, m, handle, instanceConfig))); return extensionType.cast(proxy); }

Target:
public <E> E attach(Class<E> extensionType, HandleSupplier handle) { ConfigRegistry instanceConfig = handle.getConfig().createCopy(); SqlObjectInitData data = sqlObjectCache.get(extensionType, handle.getConfig()); data.configureInstance(instanceConfig); if (data.isConcrete()) { return data.instantiate(extensionType, handle, instanceConfig); } instanceConfig.get(Extensions.class).onCreateProxy(); Map<Method, Supplier<InContextInvoker>> handlers = new HashMap<>(); final Object proxy = Proxy.newProxyInstance( extensionType.getClassLoader(), new Class[] {extensionType}, (p, m, a) -> handlers.get(m).get().invoke(a)); data.forEachMethodHandler((m, h) -> handlers.put(m, data.lazyInvoker(proxy, m, handle, instanceConfig))); return extensionType.cast(proxy); }
Source:
public void testAquireBackoff() throws InterruptedException { PessimisticLockFactory.BackoffParameters backoffConfig = new PessimisticLockFactory.BackoffParameters( 10, -1, 0 ); final PessimisticLockFactory lockFactory = new PessimisticLockFactory(backoffConfig); final CountDownLatch randevous = new CountDownLatch(1); final CountDownLatch lockObtained = new CountDownLatch(1); final AtomicReference<Exception> exceptionInThread = new AtomicReference<>(); final String id = "aggregateId"; new Thread(() -> { try { lockFactory.obtainLock(id); lockObtained.countDown(); randevous.await(); } catch (Exception e) { exceptionInThread.set(e); } }).start(); lockObtained.await(); try { lockFactory.obtainLock(id); } finally { randevous.countDown(); } }

Target:
public void testAquireBackoff() throws InterruptedException { PessimisticLockFactory.BackoffParameters backoffConfig = new PessimisticLockFactory.BackoffParameters( 10, -1, 0 ); final PessimisticLockFactory lockFactory = new PessimisticLockFactory(backoffConfig); final CountDownLatch rendezvous = new CountDownLatch(1); try { final AtomicReference<Exception> exceptionInThread = new AtomicReference<>(); final String id = "aggregateId"; createThreadObtainLockAndWaitForState(lockFactory, Thread.State.WAITING, rendezvous, exceptionInThread, id); lockFactory.obtainLock(id); } finally { rendezvous.countDown(); } }
Source:
public Collection<Exception> validateTestClass(TestClass testClass) { Collection<Exception> validationErrors= new ArrayList<Exception>(); for (AnnotatableValidator validator : AnnotatableValidator.values()) { Collection<Exception> additionalErrors= validator .validateTestClass(testClass); validationErrors.addAll(additionalErrors); } return validationErrors; }

Target:
public List<Exception> validateTestClass(TestClass testClass) { List<Exception> validationErrors= new ArrayList<Exception>(); for (AnnotatableValidator<?> validator : VALIDATORS) { List<Exception> additionalErrors= validator .validateTestClass(testClass); validationErrors.addAll(additionalErrors); } return validationErrors; }
Source:
public CheckpointResult saveMetaGroupCheckpoint(final Tuple<String, MetaGroupCheckpoint> tuple) { try { checkpointFinishedMap.putIfAbsent(tuple.getKey(), new CountDownLatch(1)); metaGroupCheckpointQueue.put(tuple); LOG.log(Level.INFO, "Checkpoint submitted for groupId: {0}", tuple.getKey()); } catch (final InterruptedException ie) { ie.printStackTrace(); return CheckpointResult.newBuilder() .setIsSuccess(false) .setMsg("Unsuccessful in checkpointing group " + tuple.getKey()) .setPathToCheckpoint("") .build(); } return CheckpointResult.newBuilder() .setIsSuccess(true) .setMsg("Successfully checkpointed group " + tuple.getKey()) .setPathToCheckpoint(tmpFolderPath + "/" + tuple.getKey() + ".groupcp") .build(); }

Target:
public CheckpointResult saveMetaGroupCheckpoint(final Tuple<String, MetaGroupCheckpoint> tuple) { try { final String groupId = tuple.getKey(); final MetaGroupCheckpoint gmc = tuple.getValue(); final File storedFile = getMetaGroupCheckpointFile(groupId); if (storedFile.exists()) { storedFile.delete(); LOG.log(Level.INFO, "Checkpoint deleted for groupId: {0}", groupId); } if (!storedFile.exists()) { storedFile.getParentFile().mkdirs(); final DataFileWriter<MetaGroupCheckpoint> dataFileWriter = new DataFileWriter<>(datumWriter); dataFileWriter.create(gmc.getSchema(), storedFile); dataFileWriter.append(gmc); dataFileWriter.close(); LOG.log(Level.INFO, "Checkpoint completed for groupId: {0}", groupId); } } catch (final Exception e) { e.printStackTrace(); return CheckpointResult.newBuilder() .setIsSuccess(false) .setMsg("Unsuccessful in checkpointing group " + tuple.getKey()) .setPathToCheckpoint("") .build(); } return CheckpointResult.newBuilder() .setIsSuccess(true) .setMsg("Successfully checkpointed group " + tuple.getKey()) .setPathToCheckpoint(tmpFolderPath + "/" + tuple.getKey() + ".groupcp") .build(); }
Source:
private void addPhotoLink(Resource<UserPhotoDto> userPhotoResource) { userPhotoResource.add(UserPhotoController.getUserPhotoLinkBuilder(userPhotoResource.getContent().getId().get()) .withRel("yona:userPhoto")); }

Target:
private void addPhotoLink(Resource<UserPhotoDto> userPhotoResource) { userPhotoResource.add(UserPhotoController.getUserPhotoLinkBuilder(userPhotoResource.getContent().getId().get()) .withRel("userPhoto")); }
Source:
private static boolean isSyntheticClass(ClassNode node) { if ((node.access & Opcodes.ACC_SYNTHETIC) == Opcodes.ACC_SYNTHETIC) { return true; } return false; }

Target:
private static boolean isSyntheticClass(ClassNode node) { return ((node.access & Opcodes.ACC_SYNTHETIC) == Opcodes.ACC_SYNTHETIC); }
Source:
public void testGson() throws Exception { Gson gson = new GsonBuilder() .registerTypeAdapterFactory(new PersonTypeAdapterFactory()) .create(); Person person = Person.builder() .name("Piasy") .gender(1) .age(23) .build(); String json = "{\"name\":\"Piasy\",\"age\":23,\"gender\":1}"; String toJson = gson.toJson(person, Person.class); JSONAssert.assertEquals(json, toJson, false); Person fromJson = gson.fromJson(json, Person.class); Assert.assertEquals("Piasy", fromJson.name()); Assert.assertEquals(23, fromJson.age()); Assert.assertEquals(1, fromJson.gender()); }

Target:
public void testGson() throws Exception { Gson gson = new GsonBuilder() .registerTypeAdapterFactory(new PersonTypeAdapterFactory()) .create(); Person person = Person.builder() .name("Piasy") .gender(1) .age(23) .build(); String json = "{\"name\":\"Piasy\",\"gender\":1,\"age\":23}"; String toJson = gson.toJson(person, Person.class); Assert.assertEquals(json, toJson); Person fromJson = gson.fromJson(json, Person.class); Assert.assertEquals("Piasy", fromJson.name()); Assert.assertEquals(23, fromJson.age()); Assert.assertEquals(1, fromJson.gender()); }
Source:
public boolean canStart(String line, int lineOffset) { if (lineOffset == 0) { Matcher m = pattern.matcher(line); if (m.matches()) { matcher = m; return true; } } matcher = null; return false; }

Target:
public boolean canStart(String line, int lineOffset) { if (lineOffset == 0) { Matcher matcher = pattern.matcher(line); if (matcher.matches()) { key = matcher.group(1); value = matcher.group(2); return true; } } key = null; value = null; return false; }
Source:
public IASTName[] getNames() { IASTName[] result = new IASTName[fQualifierPos + (fLastName == null ? 1 : 2)]; int idx = 0; for (ICPPASTNameSpecifier nameSpecifier : getQualifier()) { if (nameSpecifier instanceof IASTName) { result[idx++] = (IASTName) nameSpecifier; } else { throw new UnsupportedOperationException("Can't use getNames() on a " + "qualified name that includes a decltype-specifier. Use " + "getQualifier() and getLastName() instead"); } } if (fLastName != null) result[fQualifierPos + 1] = fLastName; return result; }

Target:
public IASTName[] getNames() { IASTName[] result = new IASTName[fQualifierPos + (fLastName == null ? 1 : 2)]; int idx = 0; for (ICPPASTNameSpecifier nameSpecifier : getQualifier()) { if (nameSpecifier instanceof IASTName) { result[idx++] = (IASTName) nameSpecifier; } else { throw new UnsupportedOperationException("Can't use getNames() on a " + "qualified name that includes a decltype-specifier. Use " + "getQualifier() and getLastName() instead."); } } if (fLastName != null) result[fQualifierPos + 1] = fLastName; return result; }
Source:
public Builder setAppGroupName(String appGroupName) { result.appGroupName = appGroupName; if (result.appGroupName != null) { result.appGroupName = result.appGroupName.toUpperCase(); } return this; }

Target:
public Builder setAppGroupName(String appGroupName) { if (appGroupName != null) { result.appGroupName = appGroupName.toUpperCase(); } else { result.appGroupName = null; } return this; }
Source:
protected void addSecurity(GlobalConfigurationBuilder globalBuilder) { globalBuilder.security().authorization().enable().principalRoleMapper(new IdentityRoleMapper()) .role("ADMIN").permission(AuthorizationPermission.ALL) .role("USER").permission(AuthorizationPermission.ALL); }

Target:
protected void addSecurity(GlobalConfigurationBuilder globalBuilder) { globalBuilder.security().authorization().enable().principalRoleMapper(new IdentityRoleMapper()) .role("ADMIN").permission(AuthorizationPermission.ALL) .role("USER").permission(AuthorizationPermission.WRITE, AuthorizationPermission.READ, AuthorizationPermission.EXEC); }
Source:
public Collection<ICallStackGroupDescriptor> getGroupDescriptors() { List<@Nullable CallStackSeries> series =StreamUtils.getStream(getDependentAnalyses()) .map(m -> ((IFlameChartProvider) m).getCallStackSeries()) .collect(Collectors.toList()); List<ICallStackGroupDescriptor> descriptors = new ArrayList<>(); for (CallStackSeries serie : series) { if (serie != null) { descriptors.add(serie.getRootGroup()); } } return descriptors; }

Target:
public Collection<ICallStackGroupDescriptor> getGroupDescriptors() { List<ICallStackGroupDescriptor> descriptors = new ArrayList<>(); for (IAnalysisModule module : getDependentAnalyses()) { if (module instanceof IFlameChartProvider) { CallStackSeries serie = ((IFlameChartProvider) module).getCallStackSeries(); if (serie != null) { descriptors.add(serie.getRootGroup()); } } } return descriptors; }