auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void performApply(ILaunchConfigurationWorkingCopy configuration) { ArrayList<String> api = new ArrayList<>(); ArrayList<String> internal = new ArrayList<>(); ArrayList<String> jar = new ArrayList<>(); ArrayList<String> report = new ArrayList<>(); ArrayList<String> reportto = new ArrayList<>(); for (Pattern pattern : this.patterns) { switch (pattern.kind) { case Pattern.API: { api.add(pattern.pattern); break; } case Pattern.INTERNAL: { internal.add(pattern.pattern); break; } case Pattern.JAR: { jar.add(pattern.pattern); break; } case Pattern.REPORT: { report.add(pattern.pattern); break; } case Pattern.REPORT_TO: { reportto.add(pattern.pattern); break; } default: break; } } configuration.setAttribute(ApiUseLaunchDelegate.API_PATTERNS_LIST, !api.isEmpty() ? api : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.INTERNAL_PATTERNS_LIST, !internal.isEmpty() ? internal : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.JAR_PATTERNS_LIST, !jar.isEmpty() ? jar : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.REPORT_PATTERNS_LIST, !report.isEmpty() ? report : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.REPORT_TO_PATTERNS_LIST, !reportto.isEmpty() ? reportto : (List<String>) null); }

Target:
public void performApply(ILaunchConfigurationWorkingCopy configuration) { ArrayList<String> api = new ArrayList<>(); ArrayList<String> internal = new ArrayList<>(); ArrayList<String> jar = new ArrayList<>(); ArrayList<String> report = new ArrayList<>(); ArrayList<String> reportto = new ArrayList<>(); for (Pattern pattern : this.patterns) { switch (pattern.kind) { case Pattern.API: { api.add(pattern.pattern); break; } case Pattern.INTERNAL: { internal.add(pattern.pattern); break; } case Pattern.JAR: { jar.add(pattern.pattern); break; } case Pattern.REPORT: { report.add(pattern.pattern); break; } case Pattern.REPORT_TO: { reportto.add(pattern.pattern); break; } default: break; } } configuration.setAttribute(ApiUseLaunchDelegate.API_PATTERNS_LIST, api.size() > 0 ? api : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.INTERNAL_PATTERNS_LIST, internal.size() > 0 ? internal : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.JAR_PATTERNS_LIST, jar.size() > 0 ? jar : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.REPORT_PATTERNS_LIST, report.size() > 0 ? report : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.REPORT_TO_PATTERNS_LIST, reportto.size() > 0 ? reportto : (List<String>) null); }
Source:
public ImmutableList<TrackerMotion> getTrackerMotionForDate(long accountId, final String targetDateString) { final HashMap<String, AttributeValue> key = new HashMap<String, AttributeValue>(); key.put(ACCOUNT_ID_ATTRIBUTE_NAME, new AttributeValue().withN(String.valueOf(accountId))); key.put(TARGET_DATE_ATTRIBUTE_NAME, new AttributeValue().withS(targetDateString)); final GetItemRequest getItemRequest = new GetItemRequest() .withTableName(this.tableName) .withKey(key); final GetItemResult getItemResult = dynamoDBClient.getItem(getItemRequest); if(getItemResult.getItem() == null || !getItemResult.getItem().containsKey(DATA_BLOB_ATTRIBUTE_NAME)) { return ImmutableList.copyOf(new TrackerMotion[0]); } final String jasonCompactMotionData = getItemResult.getItem().get(DATA_BLOB_ATTRIBUTE_NAME).getS(); ObjectMapper mapper = new ObjectMapper(); try { final List<AmplitudeDataCompact> data = mapper.readValue(jasonCompactMotionData, new TypeReference<List<AmplitudeDataCompact>>(){}); TrackerMotion[] resultData = new TrackerMotion[data.size()]; int index = 0; for(final AmplitudeDataCompact datum:data){ TrackerMotion trackerMotion = new TrackerMotion( -1, accountId, "", datum.timestamp, datum.amplitude, datum.offsetMillis); resultData[index] = trackerMotion; index++; } return ImmutableList.copyOf(resultData); } catch (IOException e) { e.printStackTrace(); LOGGER.warn("{}", e.getStackTrace()); } return ImmutableList.copyOf(new TrackerMotion[0]); }

Target:
private ImmutableList<TrackerMotion> getTrackerMotionForDate(long accountId, final String targetDateString) { final HashMap<String, AttributeValue> key = new HashMap<String, AttributeValue>(); key.put(ACCOUNT_ID_ATTRIBUTE_NAME, new AttributeValue().withN(String.valueOf(accountId))); key.put(TARGET_DATE_ATTRIBUTE_NAME, new AttributeValue().withS(targetDateString)); final GetItemRequest getItemRequest = new GetItemRequest() .withTableName(this.tableName) .withKey(key); GetItemResult getItemResult = null; try { getItemResult = dynamoDBClient.getItem(getItemRequest); }catch (AmazonServiceException ase){ LOGGER.error("Amazon service exception {}", ase.getMessage()); }finally { if (getItemResult.getItem() == null || !getItemResult.getItem().containsKey(DATA_BLOB_ATTRIBUTE_NAME)) { return ImmutableList.copyOf(Collections.<TrackerMotion>emptyList()); } } final ByteBuffer byteBuffer = getItemResult.getItem().get(DATA_BLOB_ATTRIBUTE_NAME).getB(); try { final InputProtos.TrackerDataBatch trackerDataBatch = InputProtos.TrackerDataBatch.parseFrom(byteBuffer.array()); final List<InputProtos.TrackerDataBatch.TrackerData> dataList = trackerDataBatch.getSamplesList(); LinkedList<TrackerMotion> resultData = new LinkedList<TrackerMotion>(); for(final InputProtos.TrackerDataBatch.TrackerData datum:dataList){ TrackerMotion trackerMotion = new TrackerMotion( -1, accountId, "", datum.getTimestamp(), datum.getSvmNoGravity(), datum.getOffsetMillis()); resultData.add(trackerMotion); } return ImmutableList.copyOf(resultData); } catch (IOException e) { LOGGER.error("{}", e.getStackTrace()); } return ImmutableList.copyOf(Collections.<TrackerMotion>emptyList()); }
Source:
public void markEdgeNeedLightUpdate(BlockPos pos, EnumSkyBlock type) { if(type == EnumSkyBlock.BLOCK) return; int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); Cube cube = this.getCube(x, y, z); if (cube != null) { int localX = Coords.blockToLocal(x); int localY = Coords.blockToLocal(y); int localZ = Coords.blockToLocal(z); if (localX == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.WEST); } else if (localX == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.EAST); } if (localY == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.DOWN); } else if (localY == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.UP); } if (localZ == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.NORTH); } else if (localZ == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.SOUTH); } } }

Target:
public void markEdgeNeedLightUpdate(BlockPos pos, EnumSkyBlock type) { if (type == EnumSkyBlock.BLOCK) return; int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); Cube cube = this.getCube(x, y, z); if (cube == null) return; int localX = Coords.blockToLocal(x); int localY = Coords.blockToLocal(y); int localZ = Coords.blockToLocal(z); if (localX == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.WEST); } else if (localX == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.EAST); } if (localY == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.DOWN); } else if (localY == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.UP); } if (localZ == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.NORTH); } else if (localZ == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.SOUTH); } }
Source:
private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { ovfStoreDiskImage.setDiskAlias("OVF_STORE"); ovfStoreDiskImage.setDiskDescription("OVF_STORE"); ovfStoreDiskImage.setShareable(true); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(ovfStoreDiskImage, getParameters().getStorageDomainId()); String result = "succeeded"; try { if (!runInternalAction(VdcActionType.RegisterDisk, registerDiskParams, null).getSucceeded()) { result = "failed"; } } catch (Exception e) { result = "failed"; log.error(e); } log.infoFormat("Register new floating OVF_STORE disk with disk id {0} for storage domain {1} has {2}", ovfStoreDiskImage.getId(), getParameters().getStorageDomainId(), result); } }

Target:
private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { ovfStoreDiskImage.setDiskAlias(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setDiskDescription(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setShareable(true); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(ovfStoreDiskImage, getParameters().getStorageDomainId()); String result = "succeeded"; if (!runInternalAction(VdcActionType.RegisterDisk, registerDiskParams, null).getSucceeded()) { result = "failed"; } log.infoFormat("Register new floating OVF_STORE disk with disk id {0} for storage domain {1} has {2}", ovfStoreDiskImage.getId(), getParameters().getStorageDomainId(), result); addOvfStoreDiskToDomain(ovfStoreDiskImage); } }
Source:
long calculateTimeoutSeconds() { int minimum = 10; int size = dataContainer.size(); if (size < 10_000) return minimum; return Math.round(Math.log1p(size) * 10); }

Target:
long calculateTimeoutSeconds() { int minimum = 10; int size = dataContainer.sizeIncludingExpired(); if (size < 10_000) return minimum; return Math.round(Math.log1p(size) * 10); }
Source:
protected void initExtendedEditorConfiguration() { if (configuration == null) { final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + AppliedStereotypeProperty.class.getName()); if (languagePreferred != null && !"".equals(languagePreferred)) { configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, new AppliedStereotypeProperty(null, null)); } else { configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, new AppliedStereotypeProperty(null, null)); } } }

Target:
protected void initExtendedEditorConfiguration() { if (configuration == null) { final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + AppliedStereotypeProperty.class.getName()); if (languagePreferred != null && !"".equals(languagePreferred)) { configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()); } else { configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement()); } } }
Source:
public Iterable<Server> listNodesByIds(final Iterable<String> ids) { Iterable<Long> idsAsLongs = Iterables.transform(ids, new Function<String, Long>() { @Override public Long apply(String arg0) { return Long.valueOf(checkNotNull(arg0, "arg0")); } }); return client.getServerServices().getServersById(Longs.toArray(ImmutableSet.copyOf(idsAsLongs))); }

Target:
public Iterable<Server> listNodesByIds(final Iterable<String> ids) { Set<Long> idsAsLongs = FluentIterable.from(ids) .transform(toLong()) .toSet(); return client.getServerServices().getServersById(Longs.toArray(idsAsLongs)); }
Source:
public void start(ComponentContext context) { getLog().debug("Starting component"); applicationStarted(context); }

Target:
public void start(ComponentContext context) { getLog().debug("Starting component " + getName()); applicationStarted(context); }
Source:
private int dropDatabase(Hive db, DropDatabaseDesc dropDb) throws HiveException { try { String dbName = dropDb.getDatabaseName(); ReplicationSpec replicationSpec = dropDb.getReplicationSpec(); if (replicationSpec.isInReplicationScope()) { Database database = db.getDatabase(dbName); if (database == null) { return 0; } Set<String> keySet = database.getParameters().keySet(); if (keySet.contains(ReplicationSpec.KEY.CURR_STATE_ID.toString())) { String value = database.getParameters().get(ReplicationSpec.KEY.CURR_STATE_ID.toString()); long replState = Long.parseLong(replicationSpec.getCurrentReplicationState()); long currentState = Long.parseLong(value); if (currentState > replState) { return 0; } } } db.dropDatabase(dbName, true, dropDb.getIfExists(), dropDb.isCasdade()); if (dropDb.isCasdade()) { FunctionRegistry.unregisterPermanentFunctions(dbName); } } catch (NoSuchObjectException ex) { throw new HiveException(ex, ErrorMsg.DATABASE_NOT_EXISTS, dropDb.getDatabaseName()); } return 0; }

Target:
private int dropDatabase(Hive db, DropDatabaseDesc dropDb) throws HiveException { try { String dbName = dropDb.getDatabaseName(); ReplicationSpec replicationSpec = dropDb.getReplicationSpec(); if (replicationSpec.isInReplicationScope()) { Database database = db.getDatabase(dbName); if (database == null || !replicationSpec.allowEventReplacementInto(database.getParameters())) { return 0; } } db.dropDatabase(dbName, true, dropDb.getIfExists(), dropDb.isCasdade()); if (dropDb.isCasdade()) { FunctionRegistry.unregisterPermanentFunctions(dbName); } } catch (NoSuchObjectException ex) { throw new HiveException(ex, ErrorMsg.DATABASE_NOT_EXISTS, dropDb.getDatabaseName()); } return 0; }
Source:
private void newEntity() { if (getWindow() != null) { return; } AffinityGroupModel model = getNewAffinityGroupModel(); model.init(); setWindow(model); }

Target:
private void newEntity() { if (getWindow() != null) { return; } AffinityGroupModel model = new NewAffinityGroupModel(getNewAffinityGroup(), this, getClusterResolver()); model.init(); setWindow(model); }
Source:
public byte[] call(final byte[] bytes) throws Exception { final HdfsDataSet<LongWritable, Text> dataSet; try { dataSet = HdfsDataSet.from(bytes); } catch (final IOException e) { throw new RuntimeException("Exception while instantiating a HdfsDataSet", e); } LOG.log(Level.FINER, "LineCounting task started"); int count = 0; for (final Pair<LongWritable, Text> recordPair : dataSet) { LOG.log(Level.FINEST, "Read line: {0}", recordPair); count++; } LOG.log(Level.INFO, "LineCounting task finished: read {0} lines", count); return Integer.toString(count).getBytes(StandardCharsets.UTF_8); }

Target:
public byte[] call(final byte[] bytes) throws Exception { final HdfsDataSet<LongWritable, Text> dataSet; try { dataSet = HdfsDataSet.from(bytes); } catch (final IOException e) { LOG.log(Level.SEVERE, "Exception while instantiating a HdfsDataSet: {0}", e); throw e; } LOG.log(Level.FINER, "LineCounting task started"); int count = 0; for (final Pair<LongWritable, Text> recordPair : dataSet) { LOG.log(Level.FINEST, "Read line: {0}", recordPair); count++; } LOG.log(Level.INFO, "LineCounting task finished: read {0} lines", count); return Integer.toString(count).getBytes(StandardCharsets.UTF_8); }
Source:
public static String getDownloadUrlSuffix(Release.Edition edition) { switch (edition) { case DEVELOPER: return DOWNLOAD_DEVELOPER_URL_SUFFIX; case ENTERPRISE: return DOWNLOAD_ENTERPRISE_URL_SUFFIX; case DATACENTER: return DOWNLOAD_DATACENTER_URL_SUFFIX; default: case COMMUNITY: return DOWNLOAD_URL_SUFFIX; } }

Target:
public static String getDownloadUrlSuffix(Release.Edition edition) { switch (edition) { case DEVELOPER: return DOWNLOAD_DEVELOPER_URL_SUFFIX; case ENTERPRISE: return DOWNLOAD_ENTERPRISE_URL_SUFFIX; case DATACENTER: return DOWNLOAD_DATACENTER_URL_SUFFIX; default: return DOWNLOAD_URL_SUFFIX; } }
Source:
public static NIOMavenCompiler getCompiler(Decorator decorator) { NIOMavenCompiler compiler = compilers.get(decorator); if (compiler == null) { compiler = createAndAddNewCompiler(decorator); } return compiler; }

Target:
public static NIOMavenCompiler getCompiler(Decorator decorator) { NIOMavenCompiler compiler = compilers.get(decorator.name()); if (compiler == null) { compiler = createAndAddNewCompiler(decorator); } return compiler; }
Source:
private List<Person> createModel() { return Arrays.asList(new Person("Tom", "Schindl", "tom.schindl@bestsolution.at"), new Person("Boris", "Bokowski", "boris_bokowski@ca.ibm.com"), new Person("Tod", "Creasey", "tod_creasey@ca.ibm.com"), new Person("Jeanderson", "Candido", "jeandersonbc@gmail.com"), new Person("Lars", "Vogel", "Lars.Vogel@gmail.com"), new Person("Hendrik", "Still", "hendrik.still@vogella.com")); }

Target:
private List<Person> createModel() { return Arrays.asList(new Person("Tom", "Schindl", "tom.schindl@bestsolution.at"), new Person("Boris", "Bokowski", "boris_bokowski@ca.ibm.com"), new Person("Tod", "Creasey", "tod_creasey@ca.ibm.com"), new Person("Jeanderson", "Candido", "jeandersonbc@gmail.com"), new Person("Lars", "Vogel", "lars.vogel@vogella.com"), new Person("Hendrik", "Still", "hendrik.still@vogella.com"), new Person("Simon", "Scholz", "simon.scholz@vogella.com")); }
Source:
void checkAndMaybeComplete() { if (!chunkCompleted && chunkOperationTracker.isDone()) { if (chunkOperationTracker.hasSucceeded()) { if (chunkException != null) { chunkException = null; } } chunkCompleted = true; } if (chunkCompleted) { operationException.set(chunkException); state = ChunkState.Complete; } }

Target:
void checkAndMaybeComplete() { if (chunkOperationTracker.isDone()) { if (!retainExceptionOnSuccess && chunkOperationTracker.hasSucceeded()) { chunkException = null; } chunkCompleted = true; } if (chunkCompleted) { operationException.set(chunkException); state = ChunkState.Complete; } }
Source:
public static void persistUpdatedPackingPlan(String topologyName, PackingPlan updatedPackingPlan, SchedulerStateManagerAdaptor stateManager) { LOG.log(Level.INFO, "Updating scheduled-resource in packing plan: {0}", topologyName); PackingPlanProtoSerializer serializer = new PackingPlanProtoSerializer(); if (stateManager.getPackingPlan(topologyName) != null) { stateManager.deletePackingPlan(topologyName); } boolean result = stateManager.setPackingPlan(serializer.toProto(updatedPackingPlan), topologyName); if (!result) { throw new RuntimeException(String.format("Failed to save %s's packing plan", topologyName)); } }

Target:
public static void persistUpdatedPackingPlan(String topologyName, PackingPlan updatedPackingPlan, SchedulerStateManagerAdaptor stateManager) { LOG.log(Level.INFO, "Updating scheduled-resource in packing plan: {0}", topologyName); PackingPlanProtoSerializer serializer = new PackingPlanProtoSerializer(); if (!stateManager.updatePackingPlan(serializer.toProto(updatedPackingPlan), topologyName)) { throw new RuntimeException(String.format( "Failed to update packing plan for topology %s", topologyName)); } }
Source:
public final void deallocate() { maxCapacity(-rawMaxCapacity()); wrapped.deallocate(); }

Target:
public final void deallocate() { wrapped.deallocate(); }
Source:
public UpdateEmailTemplateResponse updateEmailTemplate(UpdateEmailTemplateRequest input) { LOG.finer("Entering updateEmailTemplate"); UpdateEmailTemplateResponse output = new UpdateEmailTemplateResponse(); try { if (input == null) throw new InputValidationException(ApiError.InvalidValueNull.getCode(), ApiError.InvalidValueNull.getMessage("UpdateEmailTemplateRequest: input")); input.accessCode = ValidationHelper.validateAccessCode(input.accessCode, "input.accessCode"); output.session = input.session = ValidationHelper.validateAndExtendSession(input.session, "input.session"); if (input.emailTemplate == null) throw new InputValidationException(ApiError.InvalidValueNull.getCode(), ApiError.InvalidValueNull.getMessage("input.emailTemplate")); ValidationHelper.validateAuthorised(input.session.user, DataTypeHelper.createRole(DataTypeHelper.ROLE_ADMIN_ID)); EmailTemplateServiceProvider.provide().updateEmailTemplate(input.emailTemplate); output.status = StatusType.StatusTypeSuccess; } catch (Exception e) { output.status = StatusType.StatusTypeFailure; output.error = convertToErrorAndLog(LOG, e); } LOG.finer("Exiting updateEmailTemplate"); return output; }

Target:
public UpdateEmailTemplateResponse updateEmailTemplate(UpdateEmailTemplateRequest input) { LOG.finer("Entering updateEmailTemplate"); UpdateEmailTemplateResponse output = new UpdateEmailTemplateResponse(); try { if (input == null) throw new InputValidationException(ApiError.InvalidValueNull.getCode(), ApiError.InvalidValueNull.getMessage("UpdateEmailTemplateRequest: input")); input.accessCode = ValidationHelper.validateAccessCode(input.accessCode, "input.accessCode"); output.session = input.session = ValidationHelper.validateAndExtendSession(input.session, "input.session"); if (input.emailTemplate == null) throw new InputValidationException(ApiError.InvalidValueNull.getCode(), ApiError.InvalidValueNull.getMessage("input.emailTemplate")); input.emailTemplate = ValidationHelper.validateExistingEmailTemplate(input.emailTemplate, "input.emailTemplate"); ValidationHelper.validateAuthorised(input.session.user, DataTypeHelper.createRole(DataTypeHelper.ROLE_ADMIN_ID)); EmailTemplateServiceProvider.provide().updateEmailTemplate(input.emailTemplate); output.status = StatusType.StatusTypeSuccess; } catch (Exception e) { output.status = StatusType.StatusTypeFailure; output.error = convertToErrorAndLog(LOG, e); } LOG.finer("Exiting updateEmailTemplate"); return output; }
Source:
public boolean equals(Object o) { if(this == o) return true; if(o == null || getClass() != o.getClass()) return false; MCFluidStack that = (MCFluidStack) o; return stack.equals(that.stack); }

Target:
public boolean equals(Object o) { if(this == o) return true; if(o == null || getClass() != o.getClass()) return false; final FluidStack thatStack = ((MCFluidStack) o).stack; final FluidStack thisStack = this.stack; if(thisStack.isEmpty()) { return thatStack.isEmpty(); } if(thisStack.getAmount() != thatStack.getAmount()) { return false; } if(!Objects.equals(thisStack.getFluid(), thatStack.getFluid())) { return false; } return Objects.equals(thisStack.getTag(), thatStack.getTag()); }
Source:
public void aggregate(String groupKey, Iterator<StructuredRecord> iterator, Emitter<StructuredRecord> emitter) throws Exception { if (!iterator.hasNext()) { return; } StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); builder.set(conf.getKeyField(), groupKey); while (iterator.hasNext()) { StructuredRecord record = iterator.next(); String fieldName = record.get(conf.getFieldName()); fieldName = outputMappings.containsKey(fieldName) ? outputMappings.get(fieldName) : fieldName; if (outputFields.contains(fieldName)) { builder.set(fieldName, record.get(conf.getFieldValue())); } } emitter.emit(builder.build()); }

Target:
public void aggregate(String groupKey, Iterator<StructuredRecord> iterator, Emitter<StructuredRecord> emitter) throws Exception { if (!iterator.hasNext()) { return; } StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); builder.set(conf.getKeyField(), groupKey); while (iterator.hasNext()) { StructuredRecord record = iterator.next(); String outputFieldName = record.get(nameField); String outputFieldValue = record.get(valueField); outputFieldName = outputMappings.containsKey(outputFieldName) ? outputMappings.get(outputFieldName) : outputFieldName; if (outputFields.contains(outputFieldName)) { builder.set(outputFieldName, outputFieldValue); } } emitter.emit(builder.build()); }
Source:
private static <S extends Enum<S>, T extends Enum<T>> Class<S> getOutcomeType(Map<T, Set<S>> translation) { Map.Entry<T, Set<S>> first = translation.entrySet().iterator().next(); Class<S> outcomeType = first.getValue().iterator().next().getDeclaringClass(); return outcomeType; }

Target:
private static <S extends Enum<S>, T extends Enum<T>> Class<S> getOutcomeType(Map<T, Set<S>> translation) { Map.Entry<T, Set<S>> first = translation.entrySet().iterator().next(); return first.getValue().iterator().next().getDeclaringClass(); }
Source:
public void addEventNotification(final String deviceUid, final String eventType, final String description, final int index, final String timestamp) { Assert.notNull(eventType); Assert.notNull(description); Assert.notNull(timestamp); final OslpDevice oslpDevice = this.oslpDeviceSettingsService.getDeviceByUid(deviceUid); LOGGER.info("addEventNotification called for device: with eventType: {}, description: and index: {}", oslpDevice.getDeviceIdentification(), eventType, description, index); final DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyyMMddHHmmss Z"); final DateTime dateTime = dateTimeFormatter.withOffsetParsed().parseDateTime(timestamp.concat(" +0000")); LOGGER.info("parsed timestamp from string: to DateTime: {}", timestamp, dateTime); final EventNotificationDto eventNotification = new EventNotificationDto(deviceUid, dateTime, EventTypeDto.valueOf(eventType), description, index); final RequestMessage requestMessage = new RequestMessage("no-correlationUid", "no-organisation", oslpDevice.getDeviceIdentification(), eventNotification); this.osgpRequestMessageSender.send(requestMessage, DeviceFunctionDto.ADD_EVENT_NOTIFICATION.name()); }

Target:
public void addEventNotification(final String deviceUid, final String eventType, final String description, final int index, final String timestamp) { Assert.notNull(eventType); Assert.notNull(description); final OslpDevice oslpDevice = this.oslpDeviceSettingsService.getDeviceByUid(deviceUid); LOGGER.info("addEventNotification called for device: with eventType: {}, description: and index: {}", oslpDevice.getDeviceIdentification(), eventType, description, index); DateTime dateTime; if (StringUtils.isEmpty(timestamp)) { dateTime = DateTime.now(); LOGGER.info("timestamp is empty, using DateTime.now(): {}", dateTime); } else { final DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyyMMddHHmmss Z"); dateTime = dateTimeFormatter.withOffsetParsed().parseDateTime(timestamp.concat(" +0000")); LOGGER.info("parsed timestamp from string: to DateTime: {}", timestamp, dateTime); } final EventNotificationDto eventNotification = new EventNotificationDto(deviceUid, dateTime, EventTypeDto.valueOf(eventType), description, index); final RequestMessage requestMessage = new RequestMessage("no-correlationUid", "no-organisation", oslpDevice.getDeviceIdentification(), eventNotification); this.osgpRequestMessageSender.send(requestMessage, DeviceFunctionDto.ADD_EVENT_NOTIFICATION.name()); }
Source:
public AutoscaleRecommendationV4Response(Set<String> timeBasedHostGroups, Set<String> loadBasedHostGroups) { this.timeBasedHostGroups = timeBasedHostGroups; this.loadBasedHostGroups = loadBasedHostGroups; }

Target:
public AutoscaleRecommendationV4Response(Set<String> timeBasedHostGroups, Set<String> loadBasedHostGroups) { this.timeBasedHostGroups = Set.copyOf(timeBasedHostGroups); this.loadBasedHostGroups = Set.copyOf(loadBasedHostGroups); }
Source:
public void testEvents() { doAnswer(invocation -> { Firmware firmware = (Firmware) invocation.getArguments()[0]; ProgressCallback progressCallback = (ProgressCallback) invocation.getArguments()[1]; progressCallback.defineSequence(SEQUENCE); progressCallback.next(); progressCallback.next(); progressCallback.next(); progressCallback.next(); thing1.setProperty(Thing.PROPERTY_FIRMWARE_VERSION, firmware.getVersion()); return null; }).when(handler1).updateFirmware(any(Firmware.class), any(ProgressCallback.class)); assertThat(firmwareUpdateService.getFirmwareStatusInfo(THING1_UID), is(updateExecutableInfoFw112)); firmwareUpdateService.updateFirmware(THING1_UID, FW112_EN.getUID(), null); AtomicReference<List<Event>> events = new AtomicReference<>(new ArrayList<>()); ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class); waitForAssert(() -> { verify(mockPublisher, atLeast(SEQUENCE.length)).post(eventCaptor.capture()); }); events.get().addAll(eventCaptor.getAllValues()); List<Event> list = events.get().stream().filter(event -> event instanceof FirmwareUpdateProgressInfoEvent) .collect(Collectors.toList()); waitForAssert(() -> { assertTrue(list.size() >= SEQUENCE.length); }); for (int i = 0; i < SEQUENCE.length; i++) { FirmwareUpdateProgressInfoEvent event = (FirmwareUpdateProgressInfoEvent) list.get(i); assertThat(event.getTopic(), containsString(THING1_UID.getAsString())); assertThat(event.getThingUID(), is(THING1_UID)); assertThat(event.getProgressInfo().getProgressStep(), is(SEQUENCE[i])); } }

Target:
public void testEvents() { doAnswer(invocation -> { Firmware firmware = (Firmware) invocation.getArguments()[0]; ProgressCallback progressCallback = (ProgressCallback) invocation.getArguments()[1]; progressCallback.defineSequence(SEQUENCE); progressCallback.next(); progressCallback.next(); progressCallback.next(); progressCallback.next(); thing1.setProperty(Thing.PROPERTY_FIRMWARE_VERSION, firmware.getVersion()); return null; }).when(handler1).updateFirmware(any(Firmware.class), any(ProgressCallback.class)); assertThat(firmwareUpdateService.getFirmwareStatusInfo(THING1_UID), is(updateExecutableInfoFw112)); firmwareUpdateService.updateFirmware(THING1_UID, FW112_EN.getUID(), null); AtomicReference<List<Event>> events = new AtomicReference<>(new ArrayList<>()); ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class); waitForAssert(() -> { verify(mockPublisher, atLeast(SEQUENCE.length + 1)).post(eventCaptor.capture()); }); events.get().addAll(eventCaptor.getAllValues()); List<Event> list = events.get().stream().filter(event -> event instanceof FirmwareUpdateProgressInfoEvent) .collect(Collectors.toList()); assertTrue(list.size() >= SEQUENCE.length); for (int i = 0; i < SEQUENCE.length; i++) { FirmwareUpdateProgressInfoEvent event = (FirmwareUpdateProgressInfoEvent) list.get(i); assertThat(event.getTopic(), containsString(THING1_UID.getAsString())); assertThat(event.getThingUID(), is(THING1_UID)); assertThat(event.getProgressInfo().getProgressStep(), is(SEQUENCE[i])); } }
Source:
public void canConvertToStringWithUnknownLineNumber() { AtlasDbStackTraceElement element = ImmutableAtlasDbStackTraceElement.builder() .className(CLASS_NAME) .methodName(METHOD_NAME) .fileName(FILE_NAME) .build(); assertThat(element.toString()) .contains(CLASS_NAME) .contains(METHOD_NAME) .contains(FILE_NAME); }

Target:
public void canConvertToStringWithUnknownLineNumber() { AtlasDbStackTraceElement element = ImmutableAtlasDbStackTraceElement.builder() .className(CLASS_NAME) .methodName(METHOD_NAME) .fileName(FILE_NAME) .build(); assertClassAndMethodName(element, CLASS_NAME, METHOD_NAME); assertThat(element.toString()).contains(FILE_NAME); }
Source:
public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (this.getClass() != obj.getClass()) return false; final ObisCodeValuesDto other = (ObisCodeValuesDto) obj; if (this.a != other.a) return false; if (this.b != other.b) return false; if (this.c != other.c) return false; if (this.d != other.d) return false; if (this.e != other.e) return false; if (this.f != other.f) return false; return true; }

Target:
public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof ObisCodeValuesDto)) { return false; } final ObisCodeValuesDto other = (ObisCodeValuesDto) obj; return this.a == other.a && this.b == other.b && this.c == other.c && this.d == other.d && this.e == other.e && this.f == other.f; }
Source:
private void generateCommands() throws IOException, TemplateException { if (ConverterUtil.hasContent(spec.getRequests())) { for (final Ds3Request request : spec.getRequests()) { generateRequest(request); } } if (ConverterUtil.hasContent(spec.getTypes())) { for (final Ds3Type typeEntry : spec.getTypes().values()) { if (typeEntry.getElements().isEmpty()) { generateTypeEnumConstant(typeEntry); generateTypeEnumConstantMatcher(typeEntry); } } for (final Ds3Type typeEntry : spec.getTypes().values()) { if (!typeEntry.getElements().isEmpty()) { generateTypeElement(typeEntry); } } } }

Target:
private void generateCommands() throws IOException, TemplateException { if (ConverterUtil.hasContent(spec.getRequests())) { for (final Ds3Request request : spec.getRequests()) { generateRequest(request); } } if (ConverterUtil.hasContent(spec.getTypes())) { for (final Ds3Type typeEntry : spec.getTypes().values()) { if (ConverterUtil.hasContent(typeEntry.getEnumConstants())) { generateTypeEnumConstant(typeEntry); generateTypeEnumConstantMatcher(typeEntry); } } for (final Ds3Type typeEntry : spec.getTypes().values()) { if (ConverterUtil.hasContent(typeEntry.getElements())) { generateTypeElement(typeEntry); generateFreeTypeElementPrototype(typeEntry); generateFreeTypeElement(typeEntry); } } } }
Source:
abstract public void release() throws PublisherException; } private DataNode tail = new DataNode(null, 0); private int windowCount; public synchronized void add(PublisherPush item) throws PublisherException { boolean hasWindows; synchronized (this) { hasWindows = windowCount != 0; if (hasWindows) { DataNode prev = tail; tail = new DataNode(item, windowCount); prev.setNext(tail); } } if (!hasWindows) item.close(); }

Target:
abstract public void release() throws PublisherException; } private BlockingNode tail = new BlockingNode(Data.EMPTY); private int windowCount; public void add(PublisherPush item) throws PublisherException { if (item == null) throw new NullPointerException(); boolean hasWindows; synchronized (this) { hasWindows = windowCount != 0; if (hasWindows) { BlockingNode old = tail; tail = new BlockingNode(new Data(item, windowCount)); old.setNext(tail); } } if (!hasWindows) item.close(); }
Source:
private InstrumentedHttpClientConnectionManager(MetricRegistry metricsRegistry, HttpClientConnectionOperator httpClientConnectionOperator, HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory, long connTTL, TimeUnit connTTLTimeUnit, String name) { super(httpClientConnectionOperator, connFactory, connTTL, connTTLTimeUnit); if (metricsRegistry==null) { throw new IllegalArgumentException("metricsRegistry must be specified"); } this.metricsRegistry = metricsRegistry; this.name = name; metricsRegistry.register(name(HttpClientConnectionManager.class, name, "available-connections"), (Gauge<Integer>) () -> { return getTotalStats().getAvailable(); }); metricsRegistry.register(name(HttpClientConnectionManager.class, name, "leased-connections"), (Gauge<Integer>) () -> { return getTotalStats().getLeased(); }); metricsRegistry.register(name(HttpClientConnectionManager.class, name, "max-connections"), (Gauge<Integer>) () -> { return getTotalStats().getMax(); }); metricsRegistry.register(name(HttpClientConnectionManager.class, name, "pending-connections"), (Gauge<Integer>) () -> { return getTotalStats().getPending(); }); }

Target:
public InstrumentedHttpClientConnectionManager(MetricRegistry metricsRegistry, HttpClientConnectionOperator httpClientConnectionOperator, HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory, long connTTL, TimeUnit connTTLTimeUnit, String name) { super(httpClientConnectionOperator, connFactory, connTTL, connTTLTimeUnit); this.metricsRegistry = metricsRegistry; this.name = name; metricsRegistry.register(name(HttpClientConnectionManager.class, name, "available-connections"), (Gauge<Integer>) () -> { return getTotalStats().getAvailable(); }); metricsRegistry.register(name(HttpClientConnectionManager.class, name, "leased-connections"), (Gauge<Integer>) () -> { return getTotalStats().getLeased(); }); metricsRegistry.register(name(HttpClientConnectionManager.class, name, "max-connections"), (Gauge<Integer>) () -> { return getTotalStats().getMax(); }); metricsRegistry.register(name(HttpClientConnectionManager.class, name, "pending-connections"), (Gauge<Integer>) () -> { return getTotalStats().getPending(); }); }
Source:
public static void initialize() { assumeTrue(testTrace.exists()); stateFile = new File(TmfTraceManager.getSupplementaryFileDir(testTrace.getTrace()) + TEST_FILE_NAME); stateFileBenchmark = new File(TmfTraceManager.getSupplementaryFileDir(testTrace.getTrace()) + BENCHMARK_FILE_NAME); TestLttngKernelAnalysisModule module = new TestLttngKernelAnalysisModule(TEST_FILE_NAME); try { module.setTrace(testTrace.getTrace()); } catch (TmfAnalysisException e) { fail(); } module.schedule(); assertTrue(module.waitForCompletion(new NullProgressMonitor())); ssq = module.getStateSystem(); assertNotNull(ssq); }

Target:
public static void initialize() { assumeTrue(testTrace.exists()); try { stateFile = File.createTempFile("test", ".ht"); stateFileBenchmark = File.createTempFile("test", ".ht.benchmark"); input = new LttngKernelStateProvider(testTrace.getTrace()); ssq = TmfStateSystemFactory.newFullHistory(stateFile, input, true); } catch (IOException e) { fail(); } catch (TmfTraceException e) { fail(); } }
Source:
public SslCertResponse createCertResponse(final SslCertVO cert, final List<LoadBalancerCertMapVO> lbCertMap) { Preconditions.checkNotNull(cert); final SslCertResponse response = new SslCertResponse(); final Account account = _accountDao.findByIdIncludingRemoved(cert.getAccountId()); if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { final Project project = _projectMgr.findByProjectAccountIdIncludingRemoved(account.getId()); if (project != null) { response.setProjectId(project.getUuid()); response.setProjectName(project.getName()); } else { response.setAccountName(account.getAccountName()); } } else { response.setAccountName(account.getAccountName()); } final DomainVO domain = _domainDao.findByIdIncludingRemoved(cert.getDomainId()); response.setDomainId(domain.getUuid()); response.setDomainName(domain.getName()); response.setObjectName("sslcert"); response.setId(cert.getUuid()); response.setCertificate(cert.getCertificate()); response.setFingerprint(cert.getFingerPrint()); response.setName(cert.getName()); if (cert.getChain() != null) response.setCertchain(cert.getChain()); if (lbCertMap != null && !lbCertMap.isEmpty()) { final List<String> lbIds = new ArrayList<String>(); for (final LoadBalancerCertMapVO mapVO : lbCertMap) { final LoadBalancer lb = _entityMgr.findById(LoadBalancerVO.class, mapVO.getLbId()); if (lb != null) { lbIds.add(lb.getUuid()); } } response.setLbIds(lbIds); } return response; }

Target:
public SslCertResponse createCertResponse(final SslCertVO cert, final List<LoadBalancerCertMapVO> lbCertMap) { Preconditions.checkNotNull(cert); final SslCertResponse response = new SslCertResponse(); final Account account = _accountDao.findByIdIncludingRemoved(cert.getAccountId()); if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { final Project project = _projectMgr.findByProjectAccountIdIncludingRemoved(account.getId()); if (project != null) { response.setProjectId(project.getUuid()); response.setProjectName(project.getName()); } else { response.setAccountName(account.getAccountName()); } } else { response.setAccountName(account.getAccountName()); } final DomainVO domain = _domainDao.findByIdIncludingRemoved(cert.getDomainId()); response.setDomainId(domain.getUuid()); response.setDomainName(domain.getName()); response.setObjectName("sslcert"); response.setId(cert.getUuid()); response.setCertificate(cert.getCertificate()); response.setFingerprint(cert.getFingerPrint()); response.setName(cert.getName()); if (cert.getChain() != null) { response.setCertchain(cert.getChain()); } if (lbCertMap != null && !lbCertMap.isEmpty()) { final List<String> lbIds = new ArrayList<String>(); for (final LoadBalancerCertMapVO mapVO : lbCertMap) { final LoadBalancer lb = _entityMgr.findById(LoadBalancerVO.class, mapVO.getLbId()); if (lb != null) { lbIds.add(lb.getUuid()); } } response.setLbIds(lbIds); } return response; }
Source:
public UrlAssetImport(MimeTypeService mimeTypeService, HttpClientBuilderFactory httpFactory) { super(mimeTypeService); if (httpFactory != null) { this.httpClient = httpFactory.newBuilder().build(); } }

Target:
public UrlAssetImport(MimeTypeService mimeTypeService, HttpClientBuilderFactory httpFactory) { super(mimeTypeService); this.httpFactory = httpFactory; }
Source:
public void shutdown(RequestMonitor rm) { fTrackedTargets.clear(); fCreatedTargetBreakpoints.clear(); fDeletedTargetBreakpoints.clear(); fPendingModifications.clear(); MIBreakpointsManager bm = getBreakpointsManager(); if (bm != null) { bm.removeBreakpointsTrackingListener(this); } unregister(); super.shutdown( rm ); }

Target:
public void shutdown(RequestMonitor rm) { fTrackedTargets.clear(); fCreatedTargetBreakpoints.clear(); fDeletedTargetBreakpoints.clear(); fPendingModifications.clear(); getSession().removeServiceEventListener(this); MIBreakpointsManager bm = getBreakpointsManager(); if (bm != null) { bm.removeBreakpointsTrackingListener(this); } unregister(); super.shutdown( rm ); }
Source:
private Integer getRangeInDays(final JobExecutionContext jobContext) { Integer range = 7; if (jobContext.getMergedJobDataMap().containsKey("range")) { range = jobContext.getMergedJobDataMap().getInt("range"); } return range * -1; }

Target:
private Integer getRangeInDays(final JobExecutionContext jobContext) { Integer range = DEFAULT_RANGE; if (jobContext.getMergedJobDataMap().containsKey("range")) { try { range = jobContext.getMergedJobDataMap().getInt("range"); } catch (ClassCastException e) { LOGGER.info("Range is not stored as an integer. Using the default value of: " + range); } } return range; }
Source:
public Multimap<Serializable, Notice> getNoticeAssignments() { return noticeAssignments; }

Target:
public Multimap<TransitEntity<?>, Notice> getNoticeAssignments() { return noticeAssignments; }
Source:
public boolean contains(String name, String value, boolean ignoreCase) { return contains(name, value, ignoreCase); }

Target:
public boolean contains(String name, String value, boolean ignoreCase) { return contains((CharSequence) name, (CharSequence) value, ignoreCase); }
Source:
private Object getFieldValue(@Nullable AbstractFieldValue value) throws ParseException { int type = value.getFieldDetail().getType(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat; switch (type) { case 0: case 1: case 2: case 3: case 71: return value.asString(); case 4: return Long.parseLong(value.asHex(), 16); case 5: case 6: case 7: return value.asInt(); case 15: case 16: case 23: return Integer.parseInt(Base64.decodeBase64(Base64.encodeBase64(value.toString().getBytes())).toString()); case 8: case 11: case 18: case 19: case 20: case 22: case 24: case 25: case 26: case 27: case 28: case 29: case 31: case 32: case 33: return value.asDouble(); case 17: return value.asFloat(); case 35: case 36: case 39: return Base64.decodeInteger(Base64.encodeInteger(value.asBigInteger())); case 72: simpleDateFormat = new SimpleDateFormat("YYMMDD"); return dateFormat.format(simpleDateFormat.parse(value.toString())); case 73: simpleDateFormat = new SimpleDateFormat("YYYYMMDD"); return dateFormat.format(simpleDateFormat.parse(value.toString())); case 74: simpleDateFormat = new SimpleDateFormat("DDMMYY"); return dateFormat.format(simpleDateFormat.parse(value.toString())); case 75: simpleDateFormat = new SimpleDateFormat("DDMMYYYY"); return dateFormat.format(simpleDateFormat.parse(value.toString())); case 111: if (value.toString().toLowerCase().contains("y")) { return true; } else { return false; } case 112: if (value.toString().toLowerCase().contains("t")) { return true; } else { return false; } case 114: return value.asBoolean(); default: return value.toString(); } }

Target:
private Object getFieldValue(@Nullable AbstractFieldValue value) throws ParseException { if (value == null) { return null; } int type = value.getFieldDetail().getType(); switch (type) { case 0: return value.asString(); case 17: return value.asFloat(); case 18: case 22: case 31: case 32: case 33: return value.asDouble(); case 25: return value.asInt(); case 35: case 36: case 39: return value.asLong(); default: return value.asString(); } }
Source:
private Node maybeRecordAndRemoveAlias(Node assign) { Node next = assign.getParent(); Node lhs = assign; Node rhs = assign.getLastChild(); if (rhs == null) { return null; } if (isInProvidedNameSpace(rhs)) { aliasToProvidedNamespace.put(lhs.getString(), rhs.getQualifiedName()); next = assign.getParent().getNext(); assign.detachFromParent(); compiler.reportCodeChange(); return next; } return null; }

Target:
private Node maybeRecordAndRemoveAlias(Node assign) { Node next = assign.getParent(); Node lhs = assign; Node rhs = assign.getLastChild(); if (rhs == null) { return null; } if (isInProvidedNamespace(rhs)) { aliasToProvidedNamespace.put(lhs.getString(), rhs.getQualifiedName()); next = assign.getParent().getNext(); assign.detachFromParent(); compiler.reportCodeChange(); return next; } return null; }
Source:
public void removeMember(PerunSession sess, Member member, List<Group> groups) throws InternalErrorException, MemberNotExistsException, NotGroupMemberException, PrivilegeException, GroupNotExistsException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException { Utils.checkPerunSession(sess); for (Group group : groups) { getGroupsManagerBl().checkGroupExists(sess, group); Attribute attrSynchronizeEnabled = getPerunBl().getAttributesManagerBl().getAttribute(sess, group, GROUPSYNCHROENABLED_ATTRNAME); if ("true".equals(attrSynchronizeEnabled.getValue()) || getGroupsManagerBl().isGroupInStructureSynchronizationTree(sess, group)) { throw new ExternallyManagedException("Removing of member is not allowed. Group is externally managed."); } } getPerunBl().getMembersManagerBl().checkMemberExists(sess, member); List<PerunBean> beans = new ArrayList<>(groups); beans.add(member); if (!AuthzResolver.authorizedInternal(sess, "removeMember_Member_List<Group>_policy", beans)) { throw new PrivilegeException(sess, "addMember"); } getGroupsManagerBl().removeMember(sess, groups, member); }

Target:
public void removeMember(PerunSession sess, Member member, List<Group> groups) throws InternalErrorException, MemberNotExistsException, NotGroupMemberException, PrivilegeException, GroupNotExistsException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException { Utils.checkPerunSession(sess); for (Group group : groups) { getGroupsManagerBl().checkGroupExists(sess, group); Attribute attrSynchronizeEnabled = getPerunBl().getAttributesManagerBl().getAttribute(sess, group, GROUPSYNCHROENABLED_ATTRNAME); if ("true".equals(attrSynchronizeEnabled.getValue()) || getGroupsManagerBl().isGroupInStructureSynchronizationTree(sess, group)) { throw new ExternallyManagedException("Removing of member is not allowed. Group is externally managed."); } } getPerunBl().getMembersManagerBl().checkMemberExists(sess, member); List<PerunBean> beans = new ArrayList<>(groups); beans.add(member); if (!AuthzResolver.authorizedInternal(sess, "removeMember_Member_List<Group>_policy", beans)) { throw new PrivilegeException(sess, "removeMember"); } getGroupsManagerBl().removeMember(sess, groups, member); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } Condition conditionObj = (Condition) o; if (!patient.equals(conditionObj.patient)) { return false; } if (clinicalStatus != conditionObj.clinicalStatus) { return false; } if (verificationStatus != conditionObj.verificationStatus) { return false; } if (this.condition.getCoded() != null && !this.condition.getCoded().equals(conditionObj.getCondition().getCoded())) { return false; } if (this.condition.getNonCoded() != null ? !this.condition.getNonCoded().equals(conditionObj.getCondition().getNonCoded()) : conditionObj.getCondition().getNonCoded() != null) { return false; } if (!Objects.equals(onsetDate, conditionObj.onsetDate)) { return false; } if (!Objects.equals(additionalDetail, conditionObj.additionalDetail)) { return false; } if (!Objects.equals(endDate, conditionObj.endDate)) { return false; } return Objects.equals(endReason, conditionObj.endReason); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } Condition conditionToBeChecked = (Condition) o; if (!patient.equals(conditionToBeChecked.patient)) { return false; } if (clinicalStatus != conditionToBeChecked.clinicalStatus) { return false; } if (verificationStatus != conditionToBeChecked.verificationStatus) { return false; } if (this.condition.getCoded() != null && !this.condition.getCoded().equals(conditionToBeChecked.getCondition().getCoded())) { return false; } if (this.condition.getNonCoded() != null ? !this.condition.getNonCoded().equals(conditionToBeChecked.getCondition().getNonCoded()) : conditionToBeChecked.getCondition().getNonCoded() != null) { return false; } if (!Objects.equals(onsetDate, conditionToBeChecked.onsetDate)) { return false; } if (!Objects.equals(additionalDetail, conditionToBeChecked.additionalDetail)) { return false; } if (!Objects.equals(endDate, conditionToBeChecked.endDate)) { return false; } return Objects.equals(endReason, conditionToBeChecked.endReason); }