auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public synchronized void init() throws IOException { logger.debug("ConfigurationRepository.init()"); oEntityManager.registerEntityClass(BinaryConfiguration.class, true); transactionTemplate.execute(new TransactionCallback<Object>() { @Override public Object doInTransaction(TransactionStatus status) { if (!schemaExists() || getConfiguration() == null) { try { createSettings(); } catch (IOException e) { throw new RuntimeException(e); } } return null; } }); }

Target:
public synchronized void init() throws IOException { logger.debug("ConfigurationRepository.init()"); oEntityManager.registerEntityClass(BinaryConfiguration.class, true); transactionTemplate.execute((s) -> { if (!schemaExists() || getConfiguration() == null) { try { createSettings(); } catch (IOException e) { throw new BeanInitializationException(String.format("Failed to init: msg-[%s]", e.getMessage()), e); } } return null; }); }
Source:
public Optional<Long> gettimeofday() { return Optional.of(Math.round(System.nanoTime() / 1_000d)); }

Target:
public Optional<Long> gettimeofday() { return this.available ? Optional.of(gettimeofdayRaw()) : Optional.empty(); }
Source:
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_contributions_list, container, false); ButterKnife.bind(this, view); linearLayoutManager=new LinearLayoutManager(getContext()); gridLayoutManager=new GridLayoutManager(getContext(),3); initAdapter(); return view; }

Target:
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_contributions_list, container, false); ButterKnife.bind(this, view); initAdapter(); return view; }
Source:
public void testImport3Levels() { DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("L3_Do_say_hello.dmn", this.getClass(), "Do_say_hello_with_2_bkms.dmn", "Saying_hello_2_bkms.dmn"); runtime.addListener(DMNRuntimeUtil.createListener()); DMNModel importedModel = runtime.getModel("<LINK_0>", "Saying hello 2 bkms"); assertThat(importedModel, notNullValue()); for (DMNMessage message : importedModel.getMessages()) { LOG.debug("{}", message); } DMNModel dmnModel = runtime.getModel("<LINK_1>", "Do say hello with 2 bkms"); assertThat(dmnModel, notNullValue()); for (DMNMessage message : dmnModel.getMessages()) { LOG.debug("{}", message); } DMNModel dmnModelL3 = runtime.getModel("<LINK_2>", "L3 Do say hello"); assertThat(dmnModelL3, notNullValue()); for (DMNMessage message : dmnModelL3.getMessages()) { LOG.debug("{}", message); } DMNContext context = runtime.newContext(); context.set("Another Name", "Bob"); context.set("L2import", mapOf(entry("Person name", "John"))); DMNResult evaluateAll = runtime.evaluateAll(dmnModelL3, context); for (DMNMessage message : evaluateAll.getMessages()) { LOG.debug("{}", message); } LOG.debug("{}", evaluateAll); assertThat(evaluateAll.getDecisionResultByName("L3 decision").getResult(), is("Hello, Bob")); assertThat(evaluateAll.getDecisionResultByName("L3 view on M2").getResult(), is("Hello, John")); assertThat(evaluateAll.getDecisionResultByName("L3 what about hello").getResult(), is("Hello")); }

Target:
public void testImport3Levels() { DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("L3_Do_say_hello.dmn", this.getClass(), "Do_say_hello_with_2_bkms.dmn", "Saying_hello_2_bkms.dmn"); if (LOG.isDebugEnabled()) { runtime.addListener(DMNRuntimeUtil.createListener()); } DMNModel importedModel = runtime.getModel("<LINK_0>", "Saying hello 2 bkms"); assertThat(importedModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(importedModel.getMessages()), importedModel.hasErrors(), is(false)); DMNModel dmnModel = runtime.getModel("<LINK_1>", "Do say hello with 2 bkms"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); DMNModel dmnModelL3 = runtime.getModel("<LINK_2>", "L3 Do say hello"); assertThat(dmnModelL3, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModelL3.getMessages()), dmnModelL3.hasErrors(), is(false)); DMNContext context = runtime.newContext(); context.set("Another Name", "Bob"); context.set("L2import", mapOf(entry("Person name", "John"))); DMNResult evaluateAll = runtime.evaluateAll(dmnModelL3, context); assertThat(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages()), evaluateAll.hasErrors(), is(false)); LOG.debug("{}", evaluateAll); assertThat(evaluateAll.getDecisionResultByName("L3 decision").getResult(), is("Hello, Bob")); assertThat(evaluateAll.getDecisionResultByName("L3 view on M2").getResult(), is("Hello, John")); assertThat(evaluateAll.getDecisionResultByName("L3 what about hello").getResult(), is("Hello")); }
Source:
private void logBrickStatusChange(GlusterVolumeEntity volume, final GlusterBrickEntity brick, final GlusterStatus fetchedStatus) { log.debug("Detected that status of brick '{}' in volume '{}' changed from '{}' to '{}'", brick.getQualifiedName(), volume.getName(), brick.getStatus(), fetchedStatus); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_CHANGED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); put(GlusterConstants.OPTION_OLD_VALUE, brick.getStatus().toString()); put(GlusterConstants.OPTION_NEW_VALUE, fetchedStatus.toString()); } }); if(fetchedStatus.toString().equals("DOWN")){ logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_DOWN, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); } }, brick.getQualifiedName()); }else if(fetchedStatus.toString().equals("UP")){ AlertDirector.RemoveAlertsByBrickVolumeId(volume.getId(), brick.getQualifiedName(), "GLUSTER_BRICK_STATUS_DOWN"); } }

Target:
private void logBrickStatusChange(GlusterVolumeEntity volume, final GlusterBrickEntity brick, final GlusterStatus fetchedStatus) { log.debug("Detected that status of brick '{}' in volume '{}' changed from '{}' to '{}'", brick.getQualifiedName(), volume.getName(), brick.getStatus(), fetchedStatus); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_CHANGED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); put(GlusterConstants.OPTION_OLD_VALUE, brick.getStatus().toString()); put(GlusterConstants.OPTION_NEW_VALUE, fetchedStatus.toString()); } }); if(fetchedStatus == GlusterStatus.DOWN){ logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_DOWN, brick.getId(), brick.getQualifiedName(), new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); } }); }else if(fetchedStatus == GlusterStatus.UP){ AlertDirector.RemoveAlertsByBrickIdLogType(brick.getId(), AuditLogType.GLUSTER_BRICK_STATUS_DOWN); } }
Source:
private void populateRangeDefaultsFromJobData(final JobExecutionContext context) { ObjectMapper mapper = new ObjectMapper(); String parametersJson = context.getMergedJobDataMap().getString("parameters"); JsonNode rootNode = null; try { rootNode = mapper.readTree(parametersJson); } catch (Exception e) { LOGGER.error( "Could not determine min and max range values. " + "Using default: " + minRangeInDays + " - " + maxRangeInDays); return; } if (rootNode != null) { JsonNode minNode = rootNode.findValue("min"); if (minNode != null) { minRangeInDays = minNode.asInt(); } JsonNode maxNode = rootNode.findValue("max"); if (maxNode != null) { maxRangeInDays = maxNode.asInt(); } } }

Target:
private void populateRangeDefaultsFromJobData(final JobExecutionContext context) { ObjectMapper mapper = new ObjectMapper(); String parametersJson = context.getMergedJobDataMap().getString("parameters"); JsonNode rootNode = null; try { rootNode = mapper.readTree(parametersJson); } catch (Exception e) { LOGGER.error( String.format("Could not determine min and max range values. Using default: %d - %d.", rangeInDays.getMinimum(), rangeInDays.getMaximum())); return; } if (rootNode != null) { Integer min = rangeInDays.getMinimum(); Integer max = rangeInDays.getMaximum(); JsonNode minNode = rootNode.findValue("min"); if (minNode != null) { min = minNode.asInt(); } JsonNode maxNode = rootNode.findValue("max"); if (maxNode != null) { max = maxNode.asInt(); } rangeInDays = Range.between(min, max); } }
Source:
public void nonVmLanWithDifferentMTUAddedToNic() { Network net = createNetwork("VLanVmMtu9000"); net.setvlan_id(100); net.setMtu(9000); Network newNet = createNetwork("nonVmVLanVmMtu9000"); newNet.setvlan_id(200); newNet.setMtu(5000); newNet.setVmNetwork(false); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", null); VdsNetworkInterface nicWithVlan = createVlan(nic.getName(), net.getvlan_id(), net.getName()); nicWithVlan.setMtu(net.getMtu()); mockExistingIfaces(nic, nicWithVlan); VdsNetworkInterface nicWithNonVmVlan = createVlan(nic.getName(), newNet.getvlan_id(), newNet.getName()); nicWithNonVmVlan.setMtu(newNet.getMtu()); SetupNetworksHelper helper = createHelper(createParametersForNics(nic, nicWithVlan, nicWithNonVmVlan)); validateAndExpectNoViolations(helper); }

Target:
public void nonVmLanWithDifferentMTUAddedToNic() { Network net = createNetwork("vlanVmMtu9000"); net.setvlan_id(100); net.setMtu(9000); Network newNet = createNetwork("vlanNonVmMtu9000"); newNet.setvlan_id(200); newNet.setMtu(5000); newNet.setVmNetwork(false); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", null); VdsNetworkInterface nicWithVlan = createVlan(nic.getName(), net.getvlan_id(), net.getName()); nicWithVlan.setMtu(net.getMtu()); mockExistingIfaces(nic, nicWithVlan); VdsNetworkInterface nicWithNonVmVlan = createVlan(nic.getName(), newNet.getvlan_id(), newNet.getName()); nicWithNonVmVlan.setMtu(newNet.getMtu()); SetupNetworksHelper helper = createHelper(createParametersForNics(nic, nicWithVlan, nicWithNonVmVlan)); validateAndExpectNoViolations(helper); }
Source:
public AbstractCounterAspect(String fieldName, String label) { Objects.requireNonNull(fieldName); fFieldName = fieldName; fLabel = label; }

Target:
public AbstractCounterAspect(String fieldName, String label) { fFieldName = fieldName; fLabel = label; }
Source:
private static Document getXmlDocumentFromFile(File file) { try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory .newInstance(); DocumentBuilder dBuilder; dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(file); doc.getDocumentElement().normalize(); return doc; } catch (ParserConfigurationException e) { fail("Xml document parse exception"); } catch (SAXException e) { fail("Exception parsing xml file"); } catch (IOException e) { fail("File io exception"); } return null; }

Target:
private static Document getXmlDocumentFromFile(File file) { try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(file); doc.getDocumentElement().normalize(); return doc; } catch (ParserConfigurationException e) { fail("Xml document parse exception"); } catch (SAXException e) { fail("Exception parsing xml file"); } catch (IOException e) { fail("File io exception"); } return null; }
Source:
protected String insertSQL(SimpleFeatureType featureType, SimpleFeature feature, KeysFetcher keysFetcher, Connection cx) throws SQLException, IOException { BasicSQLDialect dialect = (BasicSQLDialect) getSQLDialect(); StringBuffer sql = new StringBuffer(); sql.append("INSERT INTO "); encodeTableName(featureType.getTypeName(), sql, null); sql.append(" ( "); for (int i = 0; i < featureType.getAttributeCount(); i++) { String colName = featureType.getDescriptor(i).getLocalName(); if(keysFetcher.isKey(colName)) { continue; } dialect.encodeColumnName(null, colName, sql); sql.append(","); } keysFetcher.addKeyColumns(sql); sql.setLength(sql.length() - 1); sql.append(" ) VALUES ( "); for (int i = 0; i < featureType.getAttributeCount(); i++) { AttributeDescriptor att = featureType.getDescriptor(i); String colName = att.getLocalName(); if(keysFetcher.isKey(colName)) { continue; } Class binding = att.getType().getBinding(); Object value = feature.getAttribute(colName); if (value == null) { sql.append("null"); } else { if (Geometry.class.isAssignableFrom(binding)) { try { Geometry g = (Geometry) value; int srid = getGeometrySRID(g, att); int dimension = getGeometryDimension(g, att); dialect.encodeGeometryValue(g, dimension, srid, sql); } catch (IOException e) { throw new RuntimeException(e); } } else { dialect.encodeValue(value, binding, sql); } } sql.append(","); } keysFetcher.setKeyValues(this, cx, featureType, feature, sql); sql.setLength(sql.length() - 1); sql.append(")"); return sql.toString(); }

Target:
protected String insertSQL(SimpleFeatureType featureType, SimpleFeature feature, KeysFetcher keysFetcher, Connection cx) throws SQLException, IOException { BasicSQLDialect dialect = (BasicSQLDialect) getSQLDialect(); StringBuffer sql = new StringBuffer(); sql.append("INSERT INTO "); encodeTableName(featureType.getTypeName(), sql, null); sql.append(" ( "); for (int i = 0; i < featureType.getAttributeCount(); i++) { String colName = featureType.getDescriptor(i).getLocalName(); if(keysFetcher.isKey(colName)) { continue; } dialect.encodeColumnName(null, colName, sql); sql.append(","); } keysFetcher.addKeyColumns(sql); sql.setLength(sql.length() - 1); sql.append(" ) VALUES ( "); for (int i = 0; i < featureType.getAttributeCount(); i++) { AttributeDescriptor att = featureType.getDescriptor(i); String colName = att.getLocalName(); if(keysFetcher.isKey(colName)) { continue; } Class binding = att.getType().getBinding(); Object value = feature.getAttribute(colName); if (value == null) { if (!att.isNillable()) { throw new IOException("Cannot set a NULL value on the not null column " + colName); } sql.append("null"); } else { if (Geometry.class.isAssignableFrom(binding)) { try { Geometry g = (Geometry) value; int srid = getGeometrySRID(g, att); int dimension = getGeometryDimension(g, att); dialect.encodeGeometryValue(g, dimension, srid, sql); } catch (IOException e) { throw new RuntimeException(e); } } else { dialect.encodeValue(value, binding, sql); } } sql.append(","); } keysFetcher.setKeyValues(this, cx, featureType, feature, sql); sql.setLength(sql.length() - 1); sql.append(")"); return sql.toString(); }
Source:
public void onDateInputBlur(final BlurEvent blurEvent) { final Object target = getEventTarget(blurEvent); if (this.onValueInputBlur != null && !Objects.isNull(target)) { onValueInputBlur.accept(blurEvent); } }

Target:
public void onDateInputBlur(final BlurEvent blurEvent) { final Object target = getEventTarget(blurEvent); if (!Objects.isNull(onValueInputBlur) && !Objects.isNull(target)) { onValueInputBlur.accept(blurEvent); } }
Source:
private void checkAndUpdatePreviousRequestTimes(Map<String, RequestTime> newRequests) { newRequests.forEach((remoteHost, newRequest) -> { RequestTime previousRequest = previousRequestsByServer.get(remoteHost); if (previousRequest != null) { try { new ClockSkewComparer(remoteHost, events, previousRequest, newRequest).compare(); } catch (IllegalArgumentException exception) { } } previousRequestsByServer.put(remoteHost, newRequest); }); }

Target:
private void checkAndUpdatePreviousRequestTimes(Map<String, RequestTime> newRequests) { newRequests.forEach((remoteHost, newRequest) -> { RequestTime previousRequest = previousRequestsByServer.get(remoteHost); if (previousRequest != null) { new ClockSkewComparer(remoteHost, events, previousRequest, newRequest).compare(); } previousRequestsByServer.put(remoteHost, newRequest); }); }
Source:
private void destroy(World world, int i, int j, int k){ TileEntityManaBattery te = getTileEntity(world, i, j, k); if (te != null && !world.isRemote){ float f = world.rand.nextFloat() * 0.8F + 0.1F; float f1 = world.rand.nextFloat() * 0.8F + 0.1F; float f2 = world.rand.nextFloat() * 0.8F + 0.1F; int dmg = (int)((PowerNodeRegistry.For(world).getPower(te, te.getPowerType()) / te.getCapacity()) * 100); if (dmg == 0) dmg = 1; ItemStack stack = new ItemStack(this); stack.damageItem(stack.getMaxDamage() - dmg, new EntityDummyCaster(world)); stack.stackTagCompound = new NBTTagCompound(); stack.stackTagCompound.setFloat("mana_battery_charge", PowerNodeRegistry.For(world).getPower(te, te.getPowerType())); stack.stackTagCompound.setInteger("mana_battery_powertype", te.getPowerType().ID()); if (!stack.stackTagCompound.hasKey("Lore")) stack.stackTagCompound.setTag("Lore", new NBTTagList()); NBTTagList tagList = new NBTTagList(); PowerTypes powerType = te.getPowerType(); float amt = PowerNodeRegistry.For(world).getPower(te, powerType); tagList.appendTag(new NBTTagString(String.format("Contains %.2f %s%s etherium", amt, powerType.chatColor(), powerType.name()))); stack.stackTagCompound.setTag("Lore", tagList); EntityItem entityitem = new EntityItem(world, i + f, j + f1, k + f2, stack); float f3 = 0.05F; entityitem.motionX = (float)world.rand.nextGaussian() * f3; entityitem.motionY = (float)world.rand.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float)world.rand.nextGaussian() * f3; world.spawnEntityInWorld(entityitem); } }

Target:
private void destroy(World world, int i, int j, int k){ float f = world.rand.nextFloat() * 0.8F + 0.1F; float f1 = world.rand.nextFloat() * 0.8F + 0.1F; float f2 = world.rand.nextFloat() * 0.8F + 0.1F; ItemStack stack = new ItemStack(this); EntityItem entityitem = new EntityItem(world, i + f, j + f1, k + f2, stack); float f3 = 0.05F; entityitem.motionX = (float)world.rand.nextGaussian() * f3; entityitem.motionY = (float)world.rand.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float)world.rand.nextGaussian() * f3; world.spawnEntityInWorld(entityitem); }
Source:
protected InputField(Parcel in) { this.id = in.readInt(); this.concept = in.readString(); this.value = in.readDouble(); this.isRed=(in.readInt()==1)?true:false; }

Target:
protected InputField(Parcel in) { this.id = in.readInt(); this.concept = in.readString(); this.value = in.readDouble(); this.isRed = (in.readInt()==1); }
Source:
protected Watchers getWatchers(NotifyType type) throws OrmException { ProjectWatch watch = new ProjectWatch(args, project, projectState, changeData); return watch.getWatchers(type); }

Target:
protected final Watchers getWatchers(NotifyType type) throws OrmException { ProjectWatch watch = new ProjectWatch(args, project, projectState, changeData); return watch.getWatchers(type); }
Source:
public void return_all_projects() { ComponentDto associatedProject = insertProject(ComponentTesting.newPublicProjectDto(organization)); ComponentDto unassociatedProject = insertProject(ComponentTesting.newPublicProjectDto(organization)); associateProjectToQualitGate(associatedProject.getId()); Association result = underTest.find(dbSession, organization, builder() .gateId(Long.toString(qGate.getId())) .build()); Map<Long, ProjectQgateAssociation> projectsById = projectsById(result.projects()); assertThat(projectsById).hasSize(2); verifyProject(projectsById.get(associatedProject.getId()), true, associatedProject.name()); verifyProject(projectsById.get(unassociatedProject.getId()), false, unassociatedProject.name()); }

Target:
public void return_all_projects() { OrganizationDto organization = dbTester.organizations().insert(); QualityGateDto qGate = dbTester.qualityGates().insertQualityGate(organization, qualityGateDto -> qualityGateDto.setName("Default Quality Gate").setUuid(Uuids.createFast())); dbTester.commit(); ComponentDto unassociatedProject = newPublicProjectDto(organization); dbTester.components().insertComponent(unassociatedProject); ComponentDto associatedProject = newPublicProjectDto(organization); dbTester.components().insertComponent(associatedProject); associateProjectToQualitGate(associatedProject, qGate); Association result = underTest.find(dbSession, organization, builder() .gateId(Long.toString(qGate.getId())) .build()); Map<Long, ProjectQgateAssociation> projectsById = projectsById(result.projects()); assertThat(projectsById).hasSize(2); verifyProject(projectsById.get(associatedProject.getId()), true, associatedProject.name()); verifyProject(projectsById.get(unassociatedProject.getId()), false, unassociatedProject.name()); }
Source:
public void aSpareFollowedByZerosIsWorthTenPoints() { int[] rolls = { 6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; PlayGame(rolls); assertEquals(10, game.score()); }

Target:
public void aSpareFollowedByZerosIsWorthTenPoints() { int[] rolls = {6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; playGame(rolls); assertEquals(10, game.score()); }
Source:
Builder setClock(Clock clock) { this.clock = clock; return this; }

Target:
Builder setClock(Clock clock) { this.clock = Preconditions.checkNotNull(clock); return this; }
Source:
public <T> T getAdapter(Class<T> adapter) { if (adapter == UserWorkspaceServiceImplComponent.class) { return (T) this; } if (adapter == UserWorkspaceService.class) { return adapter.cast(getUserWorkspaceService()); } if (adapter == CollectionLocationService.class) { return adapter.cast(getUserWorkspaceService()); } return null; }

Target:
public <T> T getAdapter(Class<T> adapter) { if (adapter == UserWorkspaceServiceImplComponent.class) { return adapter.cast(this); } else if (adapter == UserWorkspaceService.class) { return adapter.cast(getUserWorkspaceService()); } else if (adapter == CollectionLocationService.class) { return adapter.cast(getUserWorkspaceService()); } return null; }
Source:
public void updateDiskCacheKey(MessageDigest messageDigest) { messageDigest.update(ID_BYTES); }

Target:
public void updateDiskCacheKey(MessageDigest messageDigest) { messageDigest.update(getId().getBytes(CHARSET)); }
Source:
public void open(Map conf, final TopologyContext context, SpoutOutputCollector collector) { spoutService = context.getThisComponentId(); this.setEventSender(); delegate.open(conf, context, new SpoutOutputCollector(collector) { @Override public List<Integer> emit(String streamId, List<Object> tuple, Object messageId) { List<Integer> emitResult = super.emit(streamId, tuple, messageId); Monitor.getMonitor().startLatency(messageId); return emitResult; } @Override public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId) { super.emitDirect(taskId, streamId, tuple, messageId); Monitor.getMonitor().startLatency(messageId); } }); }

Target:
public void open(Map conf, final TopologyContext context, SpoutOutputCollector collector) { spoutService = context.getThisComponentId(); injectEventSender(delegate); delegate.open(conf, context, new SpoutOutputCollector(collector) { @Override public List<Integer> emit(String streamId, List<Object> tuple, Object messageId) { List<Integer> emitResult = super.emit(streamId, tuple, messageId); Monitor.getMonitor().startLatency(messageId); return emitResult; } @Override public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId) { super.emitDirect(taskId, streamId, tuple, messageId); Monitor.getMonitor().startLatency(messageId); } }); }
Source:
public String getDisplayString(Diagnosis diagnosis) { if (diagnosis.getDiagnosis() == null) { return ""; } else { if (diagnosis.getDiagnosis().getCoded() != null) return diagnosis.getDiagnosis().getCoded().getName().getName(); return diagnosis.getDiagnosis().getNonCoded(); } }

Target:
public String getDisplayString(Diagnosis diagnosis) { if (diagnosis.getDiagnosis() == null) { return ""; } else { if (diagnosis.getDiagnosis().getCoded() != null) { return diagnosis.getDiagnosis().getCoded().getName().getName(); } return diagnosis.getDiagnosis().getNonCoded(); } }
Source:
public void whenClientErrorResponseThenGetFeatureFlagsShouldThrow() throws Exception { when(restTemplate.getForObject(FEATURE_FLAGS_URI_PATTERN, FeatureFlags.class, PROJECT_ID)) .thenThrow(new RestClientException("")); service.listFeatureFlags(project); }

Target:
public void whenClientErrorResponseThenGetFeatureFlagsShouldThrow() throws Exception { when(restTemplate.getForObject(new URI(FEATURE_FLAGS_URI), FeatureFlags.class)) .thenThrow(new RestClientException("")); service.listFeatureFlags(project); }
Source:
private static void bootstrapLayoutServer(IClientRouter router, Layout layout) throws ExecutionException, InterruptedException, AlreadyBootstrappedException, TimeoutException { LayoutClient layoutClient = new LayoutClient(router, layout.getEpoch()); try { CFUtils.getUninterruptibly(layoutClient.bootstrapLayout(layout), AlreadyBootstrappedException.class, TimeoutException.class); } catch (AlreadyBootstrappedException abe) { if (!layoutClient.getLayout().get().equals(layout)) { log.error("BootstrapUtil: Layout Server {}:{} already bootstrapped with different " + "layout.", router.getHost(), router.getPort()); throw abe; } } catch (TimeoutException toe){ log.error("BootstrapUtil: Layout Server {}:{} timeout occurred.", router.getHost(), router.getPort()); throw toe; } }

Target:
private static void bootstrapLayoutServer(IClientRouter router, Layout layout) throws ExecutionException, InterruptedException, AlreadyBootstrappedException { LayoutClient layoutClient = new LayoutClient(router, layout.getEpoch()); try { CFUtils.getUninterruptibly(layoutClient.bootstrapLayout(layout), AlreadyBootstrappedException.class); } catch (AlreadyBootstrappedException abe) { if (!layoutClient.getLayout().get().equals(layout)) { log.error("BootstrapUtil: Layout Server {}:{} already bootstrapped with different " + "layout.", router.getHost(), router.getPort()); throw abe; } } }
Source:
private void setUpUserView(UserViewHolder viewHolder, Item item) { final User user = item.getUser(); viewHolder.mName.setText(user.getName()); if (user.getSchool() != null) { viewHolder.mSchool.setText(user.getSchool().getName()); } viewHolder.mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { onItemClick(user); } }); user.loadUserImage(mActivity, viewHolder.mImage); int role = user.getRole(); if (user.getDirectorId() != 0) { role = 3; } viewHolder.mUserType.setVisibility(View.VISIBLE); viewHolder.mBorder.setVisibility(View.VISIBLE); viewHolder.mUserType.setTypeface(null, Typeface.BOLD); GradientDrawable shape = (GradientDrawable) viewHolder.mUserType.getBackground(); viewHolder.mUserType.setText(ROLES[role]); switch(role) { case 0: if (user.getUserSemester() != null && !user.getUserSemester().isActive()) { shape.setColor(mActivity.getResources().getColor(R.color.red_endangered)); } else { viewHolder.mBorder.setVisibility(View.GONE); viewHolder.mUserType.setVisibility(View.GONE); } break; case 1: shape.setColor(mActivity.getResources().getColor(R.color.orange_admin)); break; case 2: shape.setColor(mActivity.getResources().getColor(R.color.blue_president)); break; case 3: shape.setColor(mActivity.getResources().getColor(R.color.turquoise_director)); break; } }

Target:
private void setUpUserView(UserViewHolder viewHolder, Item item) { final User user = item.getUser(); viewHolder.mName.setText(user.getName()); if (user.getSchool() != null) { viewHolder.mSchool.setText(user.getSchool().getName()); } viewHolder.mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { onItemClick(user); } }); user.loadUserImage(mActivity, viewHolder.mImage); UserUtils.setType(mActivity, user, viewHolder.mUserType, viewHolder.mBorder, user.ABBREV_ROLES_LABEL); }
Source:
public void testOpenTransientSession() { SWTBotTreeItem projectTreeItemBot = modelExplorerViewBot.tree().expandNode(getProjectName(), true); SWTBotTreeItem modelResourceTreeItemBot = projectTreeItemBot.getNode(SEMANTIC_RESOURCE_NAME); modelResourceTreeItemBot.select(); SWTBotUtils.clickContextMenu(modelResourceTreeItemBot, "Sirius Ecore Editor"); SWTBotUtils.waitAllUiEvents(); bot.waitUntil(new ICondition() { @Override public boolean test() throws Exception { return bot.editors().size() == 1; } @Override public void init(SWTBot bot) { } @Override public String getFailureMessage() { return "Sirius Ecore Editor should be opened"; } }); modelResourceTreeItemBot.select().doubleClick(); assertEquals("Double click on the opened model should not open a second editor", 1, bot.editors().size()); assertEquals("The double click action should not open a second session", 1, localSession.getOpenedSession().getAllSessionResources().size()); }

Target:
public void testOpenTransientSession() { SWTBotTreeItem projectTreeItemBot = modelExplorerViewBot.tree().expandNode(getProjectName(), true); SWTBotTreeItem modelResourceTreeItemBot = projectTreeItemBot.getNode(SEMANTIC_RESOURCE_NAME); modelResourceTreeItemBot.select(); SWTBotUtils.clickContextMenu(modelResourceTreeItemBot, "Sirius Ecore Editor"); bot.waitUntil(new NumberOfOpenedEditorsCondition(bot, 1)); modelResourceTreeItemBot.select().doubleClick(); assertEquals("Double click on the opened model should not open a second editor", 1, bot.editors().size()); assertEquals("The double click action should not open a second session", 1, localSession.getOpenedSession().getAllSessionResources().size()); }
Source:
public void backPressed() { if (mediaDetails != null) { if (mediaDetails.isVisible()) { ((BookmarkFragment) getParentFragment()).tabLayout.setVisibility(View.VISIBLE); removeFragment(mediaDetails); setFragment(listFragment, mediaDetails); ((MainActivity) getActivity()).showTabs(); } else { ((MainActivity) getActivity()).setSelectedItemId(NavTab.CONTRIBUTIONS.code()); ((MainActivity) getActivity()).showTabs(); } } else { ((MainActivity) getActivity()).setSelectedItemId(NavTab.CONTRIBUTIONS.code()); ((MainActivity) getActivity()).showTabs(); } }

Target:
public void backPressed() { if (mediaDetails != null) { if (mediaDetails.isVisible()) { ((BookmarkFragment) getParentFragment()).tabLayout.setVisibility(View.VISIBLE); removeFragment(mediaDetails); setFragment(listFragment, mediaDetails); ((MainActivity) getActivity()).showTabs(); } else { moveToContributionsFragment(); } } else { moveToContributionsFragment(); } }
Source:
public void setSwingHand(boolean value) { if(isPickBlock()) throw new UnsupportedOperationException("The hand swing can't be disabled if this is a pick block input."); handSwing = value; }

Target:
public void setSwingHand(boolean value) { handSwing = value; }
Source:
protected void onResume() { super.onResume(); if (!PrefUtils.isFirstStartDone(this)) { mDrawerLayout.openDrawer(Gravity.START); } }

Target:
protected void onResume() { super.onResume(); if (PrefUtils.shouldOpenDrawerOnStart(this)) { mDrawerLayout.openDrawer(Gravity.START); } }
Source:
public void configureCredentialFactory(final ChainingRestHttpRequestCredentialFactory factory) { val restProperties = casProperties.getRest(); val extractor = x509CertificateExtractor.getIfAvailable(); val headerAuth = restProperties.isHeaderAuth(); val bodyAuth = restProperties.isBodyAuth(); val tlsClientAuth = restProperties.isTlsClientAuth(); LOGGER.debug("is certificate extractor available? = {}, headerAuth = {}, bodyAuth = {}, tlsClientAuth = {}", extractor, headerAuth, bodyAuth, tlsClientAuth); if (tlsClientAuth && (headerAuth || bodyAuth)) { LOGGER.warn("X509 REST configuration seems inconsistant as activating headerAuth or bodyAuth supposes " + "that the CAS server is not directly reachable by clients (see security warning in the " +"documentation) and activating tlsClientAuth suppose the opposite."); } if (extractor != null && headerAuth) { factory.registerCredentialFactory(x509RestRequestHeader()); } if (bodyAuth) { factory.registerCredentialFactory(x509RestMultipartBody()); } if (tlsClientAuth) { factory.registerCredentialFactory(x509RestTlsClientCert()); } }

Target:
public void configureCredentialFactory(final ChainingRestHttpRequestCredentialFactory factory) { val restProperties = casProperties.getRest(); val extractor = x509CertificateExtractor.getIfAvailable(); val headerAuth = restProperties.isHeaderAuth(); val bodyAuth = restProperties.isBodyAuth(); val tlsClientAuth = restProperties.isTlsClientAuth(); LOGGER.trace("Is certificate extractor available? = {}, headerAuth = {}, bodyAuth = {}, tlsClientAuth = {}", extractor, headerAuth, bodyAuth, tlsClientAuth); if (tlsClientAuth && (headerAuth || bodyAuth)) { LOGGER.warn("The X.509 feature over REST using \"headerAuth\" or \"bodyAuth\" provides a tremendously " + "convenient target for claiming user identities or obtaining TGTs without proof of private " + "key ownership. To securely use this feature, network configuration MUST allow connections " + "to the CAS server only from trusted hosts which in turn have strict security limitations " + "and logging. Thus, \"tlsClientAuth\" shouldn't be activated together with \"headerAuth\" " + "or \"bodyAuth\""); } if (extractor != null && headerAuth) { factory.registerCredentialFactory(x509RestRequestHeader()); } if (bodyAuth) { factory.registerCredentialFactory(x509RestMultipartBody()); } if (tlsClientAuth) { factory.registerCredentialFactory(x509RestTlsClientCert()); } }
Source:
public void testThumbLargeRouteNoForceFileExists() throws Exception { String derivativePath = idToPath(fileID, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); File existingFile = new File("target/" + derivativePath + "/" + fileID + ".png"); FileUtils.writeStringToFile(existingFile, "extracted text", "utf-8"); createContext(largeThumbRoute); getMockEndpoint("mock:exec:/bin/sh").expectedMessageCount(0); Map<String, Object> headers = createEvent(fileID, eventTypes, "false"); template.sendBodyAndHeaders("", headers); doThrow(Exception.class).when(addLargeThumbnailProcessor).process(any(Exchange.class)); verify(addLargeThumbnailProcessor, never()).process(any(Exchange.class)); assertMockEndpointsSatisfied(); existingFile.delete(); }

Target:
public void testThumbLargeRouteNoForceFileExists() throws Exception { String derivativePath = idToPath(fileID, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); File existingFile = new File("target/" + derivativePath + "/" + fileID + ".png"); FileUtils.writeStringToFile(existingFile, "extracted text", "utf-8"); createContext(largeThumbRoute); getMockEndpoint("mock:exec:/bin/sh").expectedMessageCount(0); Map<String, Object> headers = createEvent(fileID, eventTypes, "false"); template.sendBodyAndHeaders("", headers); doNothing().when(addLargeThumbnailProcessor).process(any(Exchange.class)); verify(addLargeThumbnailProcessor, never()).process(any(Exchange.class)); assertMockEndpointsSatisfied(); }
Source:
public void testGenerateHiddenStateChainOnUninformativeHMM() { final int numStates = 3; final UninformativeTestHMModel model = new UninformativeTestHMModel(numStates); final int chainLength = 100000; final List<Integer> positions = IntStream.range(0, chainLength).boxed().collect(Collectors.toList()); final List<Integer> chain = model.generateHiddenStateChain(positions); Assert.assertEquals(chain.size(), positions.size()); final int[] counts = new int[numStates]; chain.stream().forEach(n -> counts[n]++); final int expectedCountsPerSTate = chainLength / numStates; final double averageCountDeviation = Arrays.stream(counts) .map(c -> Math.abs(c - expectedCountsPerSTate)).average().getAsDouble(); Assert.assertEquals(averageCountDeviation, 0, 200); }

Target:
public void testGenerateHiddenStateChainOnUninformativeHMM() { final int numStates = 3; final UninformativeTestHMModel model = new UninformativeTestHMModel(numStates); final int chainLength = 100000; final List<Integer> positions = IntStream.range(0, chainLength).boxed().collect(Collectors.toList()); final List<Integer> chain = model.generateHiddenStateChain(positions); Assert.assertEquals(chain.size(), positions.size()); final int[] counts = new int[numStates]; chain.stream().forEach(n -> counts[n]++); final int expectedCountsPerState = chainLength / numStates; final double averageCountDeviation = Arrays.stream(counts) .map(c -> Math.abs(c - expectedCountsPerState)).average().getAsDouble(); Assert.assertEquals(averageCountDeviation, 0, 200); }
Source:
private HttpComponentsMessageSender webServiceMessageSender(final String keystore) throws GeneralSecurityException, IOException { final KeyStoreFactoryBean keyStoreFactory = new KeyStoreFactoryBean(); keyStoreFactory.setType(this.keyStoreType); keyStoreFactory.setLocation(new FileSystemResource(this.keyStoreLocation + "/" + keystore + ".pfx")); keyStoreFactory.setPassword(this.keyStorePassword); keyStoreFactory.afterPropertiesSet(); final KeyStore keyStore = keyStoreFactory.getObject(); if (keyStore == null || keyStore.size() == 0) { throw new KeyStoreException("Key store is empty"); } final HttpComponentsMessageSender sender = new HttpComponentsMessageSender(); final HttpClient client = sender.getHttpClient(); final SSLSocketFactory socketFactory = new SSLSocketFactory(keyStore, this.keyStorePassword, this.trustStoreFactory.getObject()); final Scheme scheme = new Scheme("https", 443, socketFactory); client.getConnectionManager().getSchemeRegistry().register(scheme); return sender; }

Target:
private HttpComponentsMessageSender webServiceMessageSender(final String keystore) throws GeneralSecurityException, IOException { final KeyStoreFactoryBean keyStoreFactory = new KeyStoreFactoryBean(); keyStoreFactory.setType(this.keyStoreType); keyStoreFactory.setLocation(new FileSystemResource(this.keyStoreLocation + "/" + keystore + ".pfx")); keyStoreFactory.setPassword(this.keyStorePassword); keyStoreFactory.afterPropertiesSet(); final KeyStore keyStore = keyStoreFactory.getObject(); if (keyStore == null || keyStore.size() == 0) { throw new KeyStoreException("Key store is empty"); } SSLContext sslContext = SSLContexts.custom() .loadKeyMaterial(keyStore , this.keyStorePassword.toCharArray()) .loadTrustMaterial(this.trustStoreFactory.getObject(), new TrustSelfSignedStrategy()) .build(); HttpClientBuilder clientbuilder = HttpClientBuilder.create(); SSLConnectionSocketFactory connectionFactory = new SSLConnectionSocketFactory(sslContext, SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); clientbuilder.setSSLSocketFactory(connectionFactory); clientbuilder.addInterceptorLast(new HttpComponentsMessageSender.RemoveSoapHeadersInterceptor()); return new HttpComponentsMessageSender(clientbuilder.build()); }
Source:
public void saveAllConfigs(Configs configs) { List<Config> allConfigs = configs.getConfigs(); if (configs.getByName(configs.getDefaultConfigName()) != null) { this.configs.setDefaultConfigName(configs.getDefaultConfigName()); } for (int i=0; i<configs.getConfigs().size(); i++) { addConfig(allConfigs.get(i)); } }

Target:
public void saveAllConfigs(Configs configs) { this.configs.setDefaultConfigName(configs.getDefaultConfigName()); for (Config config : configs.getConfigs()) { addConfig(config); } }
Source:
public OutputStream createOutput(final String blobName) throws IOException { deleteBlob(blobName); final PipedInputStream in = new PipedInputStream(); final Thread transport = new Thread(new Runnable(){ public void run(){ blobStore.swift().getObject(buildKey(blobName)).uploadObject(in); } }); transport.start(); return new PipedOutputStream(in) { @Override public void close() throws IOException { super.close(); } }; }

Target:
public OutputStream createOutput(final String blobName) throws IOException { deleteBlob(blobName); final PipedInputStream in = new PipedInputStream(); final Thread transport = new Thread(new Runnable(){ public void run(){ blobStore.swift().getObject(buildKey(blobName)).uploadObject(in); } }); transport.start(); return new PipedOutputStream(in) { @Override public void close() throws IOException { try { super.close(); transport.join(); } catch(InterruptedException e) { throw new IOException("Swift input/output shenanigans."); } } }; }
Source:
public File createFile(String pathname, Config config) { if (config != null && isNfsSupportEnabled(config)) { return new NFSFile(pathname, config); } return new File(pathname); }

Target:
public File createFile(String pathname, Config config) { return isNfsSupportEnabled(config) ? new NFSFile(pathname, config) : new File(pathname); }
Source:
public Object compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return sketch.getRetainedEntries(); }

Target:
public Integer compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return sketch.getRetainedEntries(); }
Source:
protected String selectSQL(SimpleFeatureType featureType, Query query) throws IOException, SQLException { StringBuffer sql = new StringBuffer(); sql.append("SELECT "); selectColumns(featureType, null, query, sql); sql.setLength(sql.length() - 1); dialect.encodePostSelect(featureType, sql); sql.append(" FROM "); encodeTableName(featureType.getTypeName(), sql, setKeepWhereClausePlaceHolderHint(query)); optimizeSQL(featureType, query, sql); Filter filter = query.getFilter(); if (filter != null && !Filter.INCLUDE.equals(filter)) { sql.append(" WHERE "); filter(featureType, filter, sql); } sort(featureType, query.getSortBy(), null, sql); applyLimitOffset(sql, query.getStartIndex(), query.getMaxFeatures()); applySearchHints(featureType, query, sql); return sql.toString(); }

Target:
protected String selectSQL(SimpleFeatureType featureType, Query query) throws IOException, SQLException { StringBuffer sql = new StringBuffer(); sql.append("SELECT "); selectColumns(featureType, null, query, sql); sql.setLength(sql.length() - 1); dialect.encodePostSelect(featureType, sql); sql.append(" FROM "); encodeTableName(featureType.getTypeName(), sql, setKeepWhereClausePlaceHolderHint(query)); Filter filter = query.getFilter(); if (filter != null && !Filter.INCLUDE.equals(filter)) { sql.append(" WHERE "); filter(featureType, filter, sql); } sort(featureType, query.getSortBy(), null, sql); applyLimitOffset(sql, query.getStartIndex(), query.getMaxFeatures()); applySearchHints(featureType, query, sql); return sql.toString(); }
Source:
public void validateFragmentContributions(IBuildEntry binIncludes) { try { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(PDEProject.getPluginXml(fProject).getContents()); XPath xpath = XPathFactory.newInstance().newXPath(); NodeList list = (NodeList) xpath.evaluate("/plugin/extension[@point='org.eclipse.e4.workbench.model']/fragment/@uri", doc, XPathConstants.NODESET); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); validateBinIncludes(binIncludes, node.getNodeValue()); } } catch (Exception e) { e.printStackTrace(); } }

Target:
private void validateFragmentContributions(IBuildEntry binIncludes) { try { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(PDEProject.getPluginXml(fProject).getContents()); XPath xpath = XPathFactory.newInstance().newXPath(); NodeList list = (NodeList) xpath.evaluate("/plugin/extension[@point='org.eclipse.e4.workbench.model']/fragment/@uri", doc, XPathConstants.NODESET); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); validateBinIncludes(binIncludes, node.getNodeValue()); } } catch (Exception e) { e.printStackTrace(); } }
Source:
protected String createPayload(Nic.Request.CreatePayload payload) { checkNotNull(payload, "payload"); checkNotNull(payload.dataCenterId(), "dataCenterId"); checkNotNull(payload.serverId(), "serverId"); dataCenterId = payload.dataCenterId(); serverId = payload.serverId(); Map<String, Object> properties = new HashMap<String, Object>(); properties.put("lan", payload.lan()); if (payload.name() != null) properties.put("name", payload.name()); if (payload.ips() != null && !payload.ips().isEmpty()) properties.put("ips", payload.ips()); if (payload.dhcp() != null) properties.put("dhcp", payload.dhcp()); if (payload.firewallActive() != null) properties.put("firewallActive", payload.firewallActive()); if (payload.firewallrules() != null) { Map<String, Object> entities = new HashMap<String, Object>(); entities.put("firewallrules", payload.firewallrules()); properties.put("entities", entities); } requestBuilder.put("properties", properties); return (new Gson()).toJson(requestBuilder); }

Target:
protected String createPayload(Nic.Request.CreatePayload payload) { checkNotNull(payload, "payload"); checkNotNull(payload.dataCenterId(), "dataCenterId"); checkNotNull(payload.serverId(), "serverId"); dataCenterId = payload.dataCenterId(); serverId = payload.serverId(); Map<String, Object> properties = new HashMap<String, Object>(); properties.put("lan", payload.lan()); if (payload.name() != null) properties.put("name", payload.name()); if (payload.ips() != null && !payload.ips().isEmpty()) properties.put("ips", payload.ips()); if (payload.dhcp() != null) properties.put("dhcp", payload.dhcp()); if (payload.firewallActive() != null) properties.put("firewallActive", payload.firewallActive()); if (payload.firewallrules() != null) { Map<String, Object> entities = new HashMap<String, Object>(); entities.put("firewallrules", payload.firewallrules()); properties.put("entities", entities); } requestBuilder.put("properties", properties); return jsonBinder.toJson(requestBuilder); }
Source:
public String getInfo() { if (aggregate.getID().equals(AverageAggregate.ID)) { return Localization.getString("UniqueFilter.Average"); } else if (aggregate.getID().equals(CountAggregate.ID)) { return Localization.getString("UniqueFilter.Average"); } else if (aggregate.getID().equals(MaxAggregate.ID)) { return Localization.getString("UniqueFilter.Average"); } else if (aggregate.getID().equals(MinAggregate.ID)) { return Localization.getString("UniqueFilter.Average"); } else if (aggregate.getID().equals(SumAggregate.ID)) { return Localization.getString("UniqueFilter.Average"); } return Localization.getString("UniqueFilter.Other"); }

Target:
public String getInfo() { if (aggregate.getID().equals(AverageAggregate.ID)) { return Localization.getString("UniqueFilter.Average"); } else if (aggregate.getID().equals(CountAggregate.ID)) { return Localization.getString("UniqueFilter.Count"); } else if (aggregate.getID().equals(MaxAggregate.ID)) { return Localization.getString("UniqueFilter.Max"); } else if (aggregate.getID().equals(MinAggregate.ID)) { return Localization.getString("UniqueFilter.Min"); } else if (aggregate.getID().equals(SumAggregate.ID)) { return Localization.getString("UniqueFilter.Sum"); } return Localization.getString("UniqueFilter.Other"); }