auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Credential validate(Credential credential, RequestData data) throws WSSecurityException { if (credential == null || credential.getTimestamp() == null) { throw new WSSecurityException(ErrorCode.FAILURE, "noCredential"); } if (data.getWssConfig() == null) { throw new WSSecurityException(ErrorCode.FAILURE, "WSSConfig cannot be null"); } WSSConfig wssConfig = data.getWssConfig(); boolean timeStampStrict; int timeStampTTL = 300; int futureTimeToLive = 60; if (wssConfig != null) { timeStampTTL = data.getTimeStampTTL(); futureTimeToLive = data.getTimeStampFutureTTL(); } long timeStampTTLProperty = getTimeStampTTL(); if (timeStampTTLProperty >= 0) { timeStampTTL = (int) timeStampTTLProperty; } long futureTimeToLiveProperty = getTimeStampFutureTTL(); if (futureTimeToLiveProperty >= 0) { futureTimeToLive = (int) futureTimeToLiveProperty; } timeStampStrict = getTimeStampStrict(); CONNECTTimestamp timeStamp = new CONNECTTimestamp(credential.getTimestamp()); Date invocationTime = (Date) ((Message) data.getMsgContext()).get(TimestampInterceptor.INVOCATION_TIME_KEY); if (timeStampStrict && timeStamp.isExpired(invocationTime) || !timeStamp.verifyCreated(timeStampTTL, futureTimeToLive, invocationTime)) { throw new WSSecurityException(ErrorCode.MESSAGE_EXPIRED, "invalidTimestamp", new Object[] { "The security semantics of the message have expired" }); } return credential; }

Target:
public Credential validate(Credential credential, RequestData data) throws WSSecurityException { if (credential == null || credential.getTimestamp() == null) { throw new WSSecurityException(ErrorCode.FAILURE, "noCredential"); } WSSConfig wssConfig = data.getWssConfig(); if (wssConfig == null) { throw new WSSecurityException(ErrorCode.FAILURE, "WSSConfig cannot be null"); } boolean timeStampStrict; int timeStampTTL = data.getTimeStampTTL(); int futureTimeToLive = data.getTimeStampFutureTTL(); long timeStampTTLProperty = getTimeStampTTL(); if (timeStampTTLProperty >= 0) { timeStampTTL = (int) timeStampTTLProperty; } long futureTimeToLiveProperty = getTimeStampFutureTTL(); if (futureTimeToLiveProperty >= 0) { futureTimeToLive = (int) futureTimeToLiveProperty; } timeStampStrict = getTimeStampStrict(); CONNECTTimestamp timeStamp = new CONNECTTimestamp(credential.getTimestamp()); Date invocationTime = (Date) ((Message) data.getMsgContext()).get(TimestampInterceptor.INVOCATION_TIME_KEY); if (timeStampStrict && timeStamp.isExpired(invocationTime) || !timeStamp.verifyCreated(timeStampTTL, futureTimeToLive, invocationTime)) { throw new WSSecurityException(ErrorCode.MESSAGE_EXPIRED, "invalidTimestamp", new Object[] { "The security semantics of the message have expired" }); } return credential; }
Source:
private void createDiff(RevCommit parent) { Diff diff = revision.getDiffToParent(parent); if (diff != null) { try { createDiffLinkAndText(parent, diff); } catch (IOException e) { Activator.logError( "Error creating diff in blame information control for commit " + parent.toObjectId(), e); } } }

Target:
private void createDiff(RevCommit parent) { Diff diff = revision.getDiffToParent(parent); if (diff != null) { try { createDiffLinkAndText(parent, diff); } catch (IOException e) { String msg = "Error creating diff in blame information control for commit " + parent.toObjectId(); Activator.logError(msg, e); } } }
Source:
public void setUp() { control = EasyMock.createNiceControl(); backend = control.createMock(BackendLocal.class); DbUser currentUser = new DbUser(); currentUser.setFirstName(USER); currentUser.setLastName(USER); currentUser.setDomain(DOMAIN); currentUser.setNamespace(NAMESPACE); currentUser.setId(GUIDS[0]); Current current = new Current(); current.setUser(currentUser); current.setSessionId(SESSION_ID); CurrentManager.put(current); httpHeaders = control.createMock(HttpHeaders.class); locales = new ArrayList<Locale>(); expect(httpHeaders.getAcceptableLanguages()).andReturn(locales).anyTimes(); accepts = new ArrayList<String>(); expect(httpHeaders.getRequestHeader("Accept")).andReturn(accepts).anyTimes(); List<String> filterValue = new ArrayList<String>(); filterValue.add("false"); expect(httpHeaders.getRequestHeader(USER_FILTER_HEADER)).andReturn(filterValue).anyTimes(); mapperLocator = new MappingLocator(); mapperLocator.populate(); validatorLocator = new ValidatorLocator(); validatorLocator.populate(); locale = Locale.getDefault(); Locale.setDefault(Locale.GERMANY); messageBundle = new MessageBundle(); messageBundle.setPath(BUNDLE_PATH); messageBundle.populate(); if (Config.getConfigUtils() == null) { Config.setConfigUtils(mock(IConfigUtilsInterface.class)); } when(Config.getConfigUtils().getValue(ConfigValues.CoCoCommandLifeInMinutes, ConfigCommon.defaultConfigurationVersion)).thenReturn(300); init(); }

Target:
public void setUp() { control = EasyMock.createNiceControl(); backend = control.createMock(BackendLocal.class); DbUser currentUser = new DbUser(); currentUser.setFirstName(USER); currentUser.setLastName(USER); currentUser.setDomain(DOMAIN); currentUser.setNamespace(NAMESPACE); currentUser.setId(GUIDS[0]); Current current = new Current(); current.setUser(currentUser); current.setSessionId(SESSION_ID); CurrentManager.put(current); httpHeaders = control.createMock(HttpHeaders.class); locales = new ArrayList<Locale>(); expect(httpHeaders.getAcceptableLanguages()).andReturn(locales).anyTimes(); accepts = new ArrayList<String>(); expect(httpHeaders.getRequestHeader("Accept")).andReturn(accepts).anyTimes(); List<String> filterValue = new ArrayList<String>(); filterValue.add("false"); expect(httpHeaders.getRequestHeader(USER_FILTER_HEADER)).andReturn(filterValue).anyTimes(); mapperLocator = new MappingLocator(); mapperLocator.populate(); validatorLocator = new ValidatorLocator(); validatorLocator.populate(); locale = Locale.getDefault(); Locale.setDefault(Locale.GERMANY); messageBundle = new MessageBundle(); messageBundle.setPath(BUNDLE_PATH); messageBundle.populate(); init(); }
Source:
public void disableCaptcha() { String currentURL = driver.getCurrentUrl(); if (currentURL.contains("?")) { currentURL += "&"; } else { currentURL += "?"; } currentURL += "nocaptchatest=1"; getUrl(currentURL); }

Target:
public void disableCaptcha() { String url = urlBuilder.appendQueryStringToURL( driver.getCurrentUrl(), URLsContent.disableCaptchaParameter ); getUrl(url); }
Source:
public Collection<String> getVersions(String name) throws AgentException { URL url = urlProvider.getAgentVersions(name); try { HttpJsonResponse response = requestFactory.fromUrl(url.toString()).useGetMethod().request(); @SuppressWarnings("unchecked") List<String> versions = response.as(List.class, new TypeToken<List<String>>() { }.getType()); return versions; } catch (IOException | ServerException | UnauthorizedException | ConflictException | BadRequestException | ForbiddenException e) { throw new AgentException(format("Can't fetch available %s version.", name), e); } catch (NotFoundException e) { throw new AgentNotFoundException(format("Agent %s not found", name), e); } }

Target:
public List<String> getVersions(String name) throws AgentException { URL url = urlProvider.getAgentVersionsUrl(name); try { HttpJsonResponse response = requestFactory.fromUrl(url.toString()).useGetMethod().request(); @SuppressWarnings("unchecked") List<String> versions = response.as(List.class, new TypeToken<List<String>>() { }.getType()); return versions; } catch (NotFoundException e) { throw new AgentNotFoundException(format("Agent %s not found", name), e); } catch (IOException | ApiException e) { throw new AgentException(format("Can't fetch available %s version.", name), e); } }
Source:
private static String parseZone(JsonObject json) { return toString(json.get("metadata").asObject().get("labels").asObject().get("failure-domain.beta.kubernetes.io/zone")); }

Target:
private static String parseZone(JsonObject json) { JsonObject labels = json.get("metadata").asObject().get("labels").asObject(); JsonValue zone = labels.get("failure-domain.kubernetes.io/zone"); if (zone != null) { return toString(zone); } return toString(labels.get("failure-domain.beta.kubernetes.io/zone")); }
Source:
public void addContent(String content) { sourceModeTextArea.sendKeys(content); PageObjectLogging.log("addContent", "content was added", true, driver); }

Target:
public void addContent(String content) { sourceModeTextArea.sendKeys(content); PageObjectLogging.log("addContent", "content was added", true); }
Source:
protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { setClampHeight(1.0f); collectTote(); setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); drive(toteDistance.get()); collectTote(); setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); drive(toteDistance.get()); collectTote(); turn(90); drive(autoZoneDistance.get()); setClampHeight(0.0f); setClampOpen(true); setClampHeight(1.0f); DriveCode.octocanumShifting.set(true); strafe(1.0f, strafeTime.get()); strafe(1.0f, strafeTime.get()); ejectTotes(); DriveCode.octocanumShifting.set(false); }

Target:
protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { setClampHeight(1.0f); collectTote(); setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); drive(toteDistance.get()); collectTote(); setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); drive(toteDistance.get()); collectTote(); turn(90); drive(autoZoneDistance.get()); setClampHeight(0.0f); setClampOpen(true); setClampHeight(1.0f); DriveCode.octocanumShifting.set(true); strafe(1.0f, strafeTime.get()); ejectTotes(); strafe(1.0f, strafeTime.get()); DriveCode.octocanumShifting.set(false); }
Source:
public List<QueryMetacardImpl> getQueryMetacards(WorkspaceMetacardImpl workspaceMetacard) { return workspaceMetacard .getQueries() .stream() .map(this::getAssociatedMetacardById) .filter(Objects::nonNull) .map(QueryMetacardImpl::from) .collect(Collectors.toList()); }

Target:
public List<QueryMetacardImpl> getQueryMetacards(WorkspaceMetacardImpl workspaceMetacard) { List<String> queryIds = workspaceMetacard.getQueries(); if (queryIds.isEmpty()) { LOGGER.trace( "Workspace metacard with id does not contain any queries", workspaceMetacard.getId()); return Collections.emptyList(); } Query query = new QueryImpl(getQueriesFilter(queryIds)); QueryRequest queryRequest = new QueryRequestImpl(query); return ResultIterable.resultIterable(catalogFramework::query, queryRequest) .stream() .map(Result::getMetacard) .filter(Objects::nonNull) .map(QueryMetacardImpl::new) .collect(Collectors.toList()); }
Source:
public void searchChargeByPartialReference_ShouldReturnCharge() { insertTestChargeWithReference(ServicePaymentReference.of("rorytest")); insertTestCharge(); SearchParams searchParams = new SearchParams() .withReferenceLike(ServicePaymentReference.of("reference")); List<ChargeEntity> charges = chargeDao.findAllBy(searchParams); assertThat(charges.size(), is(1)); assertThat(charges.get(0).getReference(), is(defaultTestCharge.getReference())); }

Target:
public void searchChargeByPartialReference_ShouldReturnCharge() { insertTestChargeWithReference(ServicePaymentReference.of("willnotreturn")); insertTestChargeWithReference(ServicePaymentReference.of("Test reference")); SearchParams searchParams = new SearchParams() .withReferenceLike(ServicePaymentReference.of("reference")); List<ChargeEntity> charges = chargeDao.findAllBy(searchParams); assertThat(charges.size(), is(1)); assertThat(charges.get(0).getReference(), is(defaultTestCharge.getReference())); }
Source:
public static List<String> getPropertyNameElements(final ScenarioGridModel scenarioGridModel, final int columnIndex) { final Optional<Simulation> optionalSimulation = scenarioGridModel.getSimulation(); return optionalSimulation.map(simulation -> { final FactMapping factMapping = scenarioGridModel.getSimulation().get().getSimulationDescriptor().getFactMappingByIndex(columnIndex); if (scenarioGridModel.isSimpleType(factMapping.getFactAlias())) { return Arrays.asList(ConstantHolder.VALUE); } else { return Collections.unmodifiableList(simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex).getExpressionElementsWithoutClass() .stream() .map(ExpressionElement::getStep) .collect(Collectors.toList())); } }).orElse(null); }

Target:
public static List<String> getPropertyNameElements(final ScenarioGridModel scenarioGridModel, final int columnIndex) { final Optional<Simulation> optionalSimulation = scenarioGridModel.getSimulation(); return optionalSimulation.map(simulation -> { final FactMapping factMapping = simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex); if (scenarioGridModel.isSimpleType(factMapping.getFactAlias())) { return Arrays.asList(ConstantHolder.VALUE); } else { return Collections.unmodifiableList(simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex).getExpressionElementsWithoutClass() .stream() .map(ExpressionElement::getStep) .collect(Collectors.toList())); } }).orElse(null); }
Source:
public void registerEmail(final String address, final AsyncCallback<VoidResult> cb) { try { switch (authConfig.getAuthType()) { case OPENID: case HTTP: case HTTP_LDAP: case CLIENT_SSL_CERT_LDAP: case LDAP: case LDAP_BIND: final RegisterNewEmailSender sender; sender = registerNewEmailFactory.create(address); sender.send(); cb.onSuccess(VoidResult.INSTANCE); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: registerMail(address, cb); break; default: log.error( "Unsupported loginType: " + authConfig.getAuthType(), new ProvisionException("Unsupported loginType: " + authConfig.getAuthType())); throw new ProvisionException("Unsupported loginType: " + authConfig.getAuthType()); } } catch (EmailException e) { log.error("Cannot send email verification message to " + address, e); cb.onFailure(e); } catch (RuntimeException e) { log.error("Cannot send email verification message to " + address, e); cb.onFailure(e); } }

Target:
public void registerEmail(final String address, final AsyncCallback<VoidResult> cb) { if (authConfig.getAuthType() == AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT) { checkFormatAndSaveEmail(address, cb); } else { try { final RegisterNewEmailSender sender; sender = registerNewEmailFactory.create(address); sender.send(); cb.onSuccess(VoidResult.INSTANCE); } catch (EmailException e) { log.error("Cannot send email verification message to " + address, e); cb.onFailure(e); } catch (RuntimeException e) { log.error("Cannot send email verification message to " + address, e); cb.onFailure(e); } } }
Source:
public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(acc); out.writeUTF(separator); }

Target:
public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(VERSION); out.writeObject(acc); out.writeUTF(separator); }
Source:
public HTableDescriptor adapt(Table table) { String tableNameStr = bigtableClusterName.toTableId(table.getName()); HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableNameStr)); for (Entry<String, ColumnFamily> entry : table.getColumnFamilies().entrySet()) { tableDescriptor.addFamily(columnDescriptorAdapter.adapt(entry.getKey(), entry.getValue())); } return tableDescriptor; }

Target:
public HTableDescriptor adapt(Table table) { String tableId = bigtableClusterName.toTableId(table.getName()); HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableId)); for (Entry<String, ColumnFamily> entry : table.getColumnFamilies().entrySet()) { tableDescriptor.addFamily(columnDescriptorAdapter.adapt(entry.getKey(), entry.getValue())); } return tableDescriptor; }
Source:
public void run() { try { final Manufacturer manufacturer = this.findManufacturer(this.deviceConnectionScheduledTaskManufacturerName); if (manufacturer == null) { return; } final List<DeviceModel> deviceModels = this.findDeviceModels(manufacturer); if (deviceModels == null || deviceModels.isEmpty()) { return; } final List<Device> devices = this.findDevices(deviceModels); if (devices.isEmpty()) { return; } final List<Device> devicesToContact = this.findDevicesToContact(devices, this.deviceConnectionScheduledTaskMaximumAllowedAge); if (devicesToContact.isEmpty()) { return; } this.contactDevices(devicesToContact, DeviceFunction.GET_STATUS); } catch (final Exception e) { LOGGER.error("Exception caught during DeviceConnectionScheduledTask.run()", e); } }

Target:
public void run() { try { final Manufacturer manufacturer = this.findManufacturer(this.deviceConnectionScheduledTaskManufacturerName); if (manufacturer == null) { return; } final List<DeviceModel> deviceModels = this.findDeviceModels(manufacturer); if (deviceModels == null || deviceModels.isEmpty()) { return; } final List<Device> devices = this.findDevices(deviceModels, LightMeasurementDevice.LMD_TYPE); if (devices.isEmpty()) { return; } final List<Device> devicesToContact = this.findDevicesToContact(devices, this.deviceConnectionScheduledTaskMaximumAllowedAge); if (devicesToContact == null || devicesToContact.isEmpty()) { return; } this.contactDevices(devicesToContact, DeviceFunction.GET_STATUS); } catch (final Exception e) { LOGGER.error("Exception caught during DeviceConnectionScheduledTask.run()", e); } }
Source:
public void the_user_on_an_existing_candidates_page() throws Throwable { webDriver.get("http://localhost:8080/atsy/secure/candidate/3"); }

Target:
public void the_user_on_an_existing_candidates_page() { webDriver.get(CANDIDATE_PAGE_URL); }
Source:
private static Method getMethod(Object svc, String methodName, Class... paramTypes) throws NoSuchMethodException { Method method = null; Class<?> clazz = svc.getClass(); hwile: while (!(clazz == Object.class || method != null)) { Method[] methods = clazz.getDeclaredMethods(); for (Method m : methods) { if (m.getName().compareTo(methodName) == 0) { method = m; break hwile; } } clazz = clazz.getSuperclass(); } if (method == null) { throw new NoSuchMethodException("Method not found"); } return method; }

Target:
private static Method getMethod(Object svc, String methodName, Class... paramTypes) throws NoSuchMethodException { Method method = null; Class<?> clazz = svc.getClass(); hwile: while (!(clazz == Object.class || method != null)) { Method[] methods = clazz.getDeclaredMethods(); for (Method m : methods) { if (m.getName().compareTo(methodName) == 0) { method = m; break hwile; } } clazz = clazz.getSuperclass(); } if (method == null) { throw new NoSuchMethodException(String.format("Method not found: %s", methodName)); } return method; }
Source:
protected Object executeMethod(String name, Class<?>[] parameterTypes, Object... arguments) { try { Method method = target.getClass().getDeclaredMethod(name, parameterTypes); method.setAccessible(true); return ReflectionUtils.invokeMethod(method, target, arguments); } catch (NoSuchMethodException | SecurityException exception) { LOG.warning(exception.getMessage()); return null; } }

Target:
protected Object executeMethod(String name, Class<?>[] parameterTypes, Object... arguments) { try { Method method = this.target.getClass().getDeclaredMethod(name, parameterTypes); method.setAccessible(true); return ReflectionUtils.invokeMethod(method, target, arguments); } catch (NoSuchMethodException | SecurityException ex) { throw new JUnitException( "Error while looking up method to call via reflection for class " + target.getClass().getName(), ex); } }
Source:
protected void executeQueryCommand() { getQueryReturnValue().setReturnValue(diskImageDao.getDiskImageByDiskAndImageIds(getParameters().getDiskId(), getParameters().getImageId())); }

Target:
protected void executeQueryCommand() { getQueryReturnValue().setReturnValue(diskImageDao.getDiskImageByDiskAndImageIds( getParameters().getDiskId(), getParameters().getImageId(), getUserID(), getParameters().isFiltered())); }
Source:
void getPointer(DataInputStream din, DataOutputStream dout) throws Exception { PublicKeyHash encodedSharingKey = PublicKeyHash.fromCbor(CborObject.deserialize(new CborDecoder(din), 1024)); byte[] metadataBlob = mutable.getPointer(encodedSharingKey).get().orElse(new byte[0]); dout.write(metadataBlob); }

Target:
void getPointer(DataInputStream din, DataOutputStream dout) throws Exception { PublicKeyHash encodedSharingKey = PublicKeyHash.fromCbor(CborObject.deserialize(new CborDecoder(din), PublicKeyHash.MAX_KEY_HASH_SIZE)); byte[] metadataBlob = mutable.getPointer(encodedSharingKey).get().orElse(new byte[0]); dout.write(metadataBlob); }
Source:
public List<String> getMacsForMacPool(Guid macPoolId) { List<Guid> idsOfAllClustersHavingMacPool = getIdsOfAllClustersHavingMacPool(macPoolId); Map<Guid, VM> vmsById = idsOfAllClustersHavingMacPool.stream() .flatMap(clusterId -> vmDao.getAllForCluster(clusterId).stream()) .collect(Collectors.toMap(VM::getId, Function.identity())); Stream<Guid> idsOfRunningVMs = vmsById.values().stream().filter(VM::isRunning).map(VM::getId); Stream<VM> statelessSnapshotsOfRunningVMs = idsOfRunningVMs.map(snapshotsManager::getVmConfigurationInStatelessSnapshotOfVm) .filter(Optional::isPresent) .map(Optional::get); Map<Guid, List<VmNetworkInterface>> snapshottedInterfacesByVmId = statelessSnapshotsOfRunningVMs.collect(Collectors.toMap(VM::getId, VM::getInterfaces)); List<String> macsToBeAllocated = vmsById.keySet() .stream() .flatMap(vmId -> calculateAllMacsUsedInVmAndItsSnapshot(vmsById.get(vmId).getInterfaces(), snapshottedInterfacesByVmId.get(vmId))) .collect(Collectors.toList()); return macsToBeAllocated; }

Target:
public List<String> getMacsForMacPool(Guid macPoolId) { List<Guid> idsOfAllClustersHavingMacPool = getIdsOfAllClustersHavingMacPool(macPoolId); Map<Guid, VM> vmsById = idsOfAllClustersHavingMacPool.stream() .flatMap(clusterId -> vmDao.getAllForCluster(clusterId).stream()) .collect(Collectors.toMap(VM::getId, Function.identity())); Stream<Guid> idsOfRunningVMs = vmsById.values() .stream() .filter(VM::isRunning) .filter(VM::isStateless) .map(VM::getId); Stream<VM> statelessSnapshotsOfRunningVMs = idsOfRunningVMs.map(snapshotsManager::getVmConfigurationInStatelessSnapshotOfVm) .filter(Optional::isPresent) .map(Optional::get); Map<Guid, List<VmNetworkInterface>> snapshottedInterfacesByVmId = statelessSnapshotsOfRunningVMs.collect(Collectors.toMap(VM::getId, VM::getInterfaces)); List<String> macsToBeAllocated = vmsById.keySet() .stream() .flatMap(vmId -> calculateAllMacsUsedInVmAndItsSnapshot(vmsById.get(vmId).getInterfaces(), snapshottedInterfacesByVmId.get(vmId))) .collect(Collectors.toList()); return macsToBeAllocated; }
Source:
public static void addCommonTooltipFromResources(List list, ItemStack itemstack) { if(itemstack.getItem() == null) { return; } String unloc = null; if (itemstack.getItem() instanceof IResourceTooltipProvider) { unloc = ((IResourceTooltipProvider)itemstack.getItem()).getUnlocalizedNameForTooltip(itemstack); } if(unloc == null) { unloc = itemstack.getItem().getUnlocalizedName(itemstack); } addCommonTooltipFromResources(list, unloc); }

Target:
public static void addCommonTooltipFromResources(List list, ItemStack itemstack) { if(itemstack.getItem() == null) { return; } addCommonTooltipFromResources(list, getUnlocalizedNameForTooltip(itemstack)); }
Source:
public void testImportMultipleTimes() throws Exception { System.out.println("testImportUpdateApplicationCatalog"); Client client = getClient(); waitForHashinator(client); pushDataToImporters(100, 1); verifyData(client, 100); Thread.sleep(0, 1); pushDataToImporters(100, 1); verifyData(client, 200); client.close(); }

Target:
public void testImportMultipleTimes() throws Exception { System.out.println("testImportUpdateApplicationCatalog"); pushDataToImporters(100, 1); verifyData(m_client, 100); Thread.sleep(0, 1); pushDataToImporters(100, 1); verifyData(m_client, 200); }
Source:
private static String getSolrUrl() { return AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)); }

Target:
private String getSolrUrl() { return getProperty(SOLR_HTTP_URL); }
Source:
public boolean equals(Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } TransportEndpoint that = (TransportEndpoint) other; return Objects.equals(id, that.id) && Objects.equals(getSocketAddress(), that.getSocketAddress()); }

Target:
public boolean equals(Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } TransportEndpoint that = (TransportEndpoint) other; return Objects.equals(id, that.id) && Objects.equals(host, that.host) && Objects.equals(port, that.port); }
Source:
public void stop() { LOG.debug("Shutting down Zuul."); serverGroup.stop(); try { Runtime.getRuntime().removeShutdownHook(jvmShutdownHook); } catch (IllegalStateException e) { LOG.debug("Failed to remove shutdown hook", e); } LOG.debug("Completed zuul shutdown."); }

Target:
public void stop() { LOG.info("Shutting down Zuul."); serverGroup.stop(); try { Runtime.getRuntime().removeShutdownHook(jvmShutdownHook); } catch (IllegalStateException e) { LOG.debug("Failed to remove shutdown hook", e); } LOG.info("Completed zuul shutdown."); }
Source:
public static org.openmrs.Condition generateOpenMRSCondition(org.hl7.fhir.dstu3.model.Condition condition) { org.openmrs.Condition openMrsCondition; openMrsCondition = Context.getService(ConditionService.class).getConditionByUuid(condition.getId()); if (openMrsCondition == null) { openMrsCondition = new org.openmrs.Condition(); } BaseOpenMRSDataUtil.readBaseExtensionFields(openMrsCondition, condition); openMrsCondition.setId(Integer.parseInt(condition.getId())); if (condition.getSubject() != null) { String patientRef = condition.getSubject().getReference(); Patient openMrsPatient = Context.getPatientService().getPatientByUuid(patientRef); openMrsCondition.setPatient(openMrsPatient); } openMrsCondition.setUuid(condition.getContext().getReference()); try { openMrsCondition.setOnsetDate(condition.getOnsetDateTimeType().getValue()); } catch (FHIRException e) { e.printStackTrace(); } openMrsCondition.setAdditionalDetail(condition.getNoteFirstRep().getText()); openMrsCondition.setDateChanged(condition.getAssertedDate()); if (condition.getCode() != null) { CodeableConcept conceptDt = condition.getCode(); List<Coding> codings = conceptDt.getCoding(); Concept openMrsConcept = new Concept(); if (!codings.isEmpty()) { for (Coding coding : codings) { openMrsConcept.setUuid(coding.getCode()); openMrsConcept.setVersion(coding.getVersion()); } } openMrsCondition.setConcept(openMrsConcept); } openMrsCondition.setCreator(Context.getAuthenticatedUser()); return openMrsCondition; }

Target:
public static org.openmrs.Condition generateOpenMRSCondition(org.hl7.fhir.dstu3.model.Condition condition) { org.openmrs.Condition openMrsCondition; List<String> errors = new ArrayList<>(); openMrsCondition = Context.getService(ConditionService.class).getConditionByUuid(condition.getId()); if (openMrsCondition == null) { openMrsCondition = new org.openmrs.Condition(); } BaseOpenMRSDataUtil.readBaseExtensionFields(openMrsCondition, condition); if (condition.getSubject() != null) { String patientRef = condition.getSubject().getReference(); Patient openMrsPatient = Context.getPatientService().getPatientByUuid(patientRef); openMrsCondition.setPatient(openMrsPatient); } openMrsCondition.setUuid(condition.getContext().getReference()); openMrsCondition.setAdditionalDetail(condition.getNoteFirstRep().getText()); openMrsCondition.setDateChanged(condition.getAssertedDate()); openMrsCondition.setConcept(FHIRUtils.getConceptFromCode(condition.getCode(), errors)); openMrsCondition.setStatus( FHIRConditionUtil.generateConditionClinicalStatusFromFHIRCondition(condition)); openMrsCondition.setCreator(Context.getAuthenticatedUser()); FHIRUtils.checkGeneratorErrorList(errors); return openMrsCondition; }
Source:
public void generate() throws Exception { initPlanTest(); try { getQueryResourcePaths() .parallel() .forEach(queryResourcePath -> { try { Path queryPlanWritePath = Paths.get( getPrestoMainSourcePath().toString(), "src/test/resources", getQueryPlanResourcePath(queryResourcePath).toString()); Files.createParentDirs(queryPlanWritePath.toFile()); Files.write(generateQueryPlan(read(queryResourcePath)).getBytes(UTF_8), queryPlanWritePath.toFile()); System.out.println("Generated expected plan for query: " + queryResourcePath); } catch (IOException e) { throw new UncheckedIOException(e); } }); } finally { destroyPlanTest(); } }

Target:
public void generate() throws Exception { initPlanTest(); try { getQueryResourcePaths() .parallel() .forEach(queryResourcePath -> { try { Path queryPlanWritePath = Paths.get( getPrestoMainSourcePath().toString(), "src/test/resources", getQueryPlanResourcePath(queryResourcePath)); createParentDirs(queryPlanWritePath.toFile()); write(generateQueryPlan(read(queryResourcePath)).getBytes(UTF_8), queryPlanWritePath.toFile()); System.out.println("Generated expected plan for query: " + queryResourcePath); } catch (IOException e) { throw new UncheckedIOException(e); } }); } finally { destroyPlanTest(); } }
Source:
public void saveStateShouldThrowIllegalArgumentExceptionWhenApplicationIdIsNull() { given(applicationsRepository.findOne(null)).willThrow(IllegalArgumentException.class); statesService.saveState(stateDTO, null); }

Target:
public void saveStateShouldThrowIllegalArgumentExceptionWhenApplicationIdIsNull() { statesService.saveState(stateDTO, null); }
Source:
public String getDomainsLoggingEntry() { StringBuilder configurationEntry = new StringBuilder(""); boolean firstEntry = true; for (Entry<String, String> currEntry : valuePerDomain.entrySet()) { if (!firstEntry) { configurationEntry.append(domainSeperator); } else { firstEntry = false; } configurationEntry.append(currEntry.getKey()); if (currEntry.getValue() != null) { configurationEntry.append(valueSeperator).append(LOGGING_PASSWORD); } } return configurationEntry.toString(); }

Target:
public String getDomainsLoggingEntry() { StringBuilder configurationEntry = new StringBuilder(); boolean firstEntry = true; for (Entry<String, String> currEntry : valuePerDomain.entrySet()) { if (!firstEntry) { configurationEntry.append(domainSeperator); } else { firstEntry = false; } configurationEntry.append(currEntry.getKey()); if (currEntry.getValue() != null) { configurationEntry.append(valueSeperator).append(LOGGING_PASSWORD); } } return configurationEntry.toString(); }
Source:
public List<CommitValidationMessage> onCommitReceived( CommitReceivedEvent receiveEvent) throws CommitValidationException { if (receiveEvent.commit.getParentCount() > 1) { if (MagicBranch.isMagicBranch(receiveEvent.command.getRefName())) { if (!refControl.canUploadMerges()) { throw new CommitValidationException( "you are not allowed to upload merges for review"); } } else if (!refControl.canPushMerges()) { throw new CommitValidationException( "you are not allowed to push merges directly bypassing code review"); } } return Collections.<CommitValidationMessage> emptyList(); }

Target:
public List<CommitValidationMessage> onCommitReceived( CommitReceivedEvent receiveEvent) throws CommitValidationException { if (receiveEvent.commit.getParentCount() > 1) { if (MagicBranch.isMagicBranch(receiveEvent.command.getRefName())) { if (!refControl.canUploadMerges()) { throw new CommitValidationException( "you are not allowed to upload merges for review"); } } else if (!refControl.canPushMerges()) { throw new CommitValidationException( "you are not allowed to push merges directly bypassing code review"); } } return Collections.emptyList(); }
Source:
private Content mergeBroadcasts(Maybe<Identified> possibleExisting, Content update) { if (possibleExisting.isNothing()) { throw new IllegalStateException("Entity for " + update.getCanonicalUri() + " does not exists"); } Identified existing = possibleExisting.requireValue(); if (existing instanceof Item) { Item item = (Item) existing; if (!update.getVersions().isEmpty()) { if (Iterables.isEmpty(item.getVersions())) { item.addVersion(new Version()); } Version existingVersion = item.getVersions().iterator().next(); Version postedVersion = Iterables.getOnlyElement(update.getVersions()); mergeVersions(existingVersion, postedVersion); } return (Content) existing; } throw new IllegalStateException("Entity for " + update.getCanonicalUri() + " not Content"); }

Target:
private Content mergeBroadcasts(Maybe<Identified> possibleExisting, Content update) { if (possibleExisting.isNothing()) { return update; } Identified existing = possibleExisting.requireValue(); if (!(existing instanceof Item)) { throw new IllegalStateException("Entity for " + update.getCanonicalUri() + " not Content"); } Item item = (Item) existing; if (!update.getVersions().isEmpty()) { if (Iterables.isEmpty(item.getVersions())) { item.addVersion(new Version()); } Version existingVersion = item.getVersions().iterator().next(); Version postedVersion = Iterables.getOnlyElement(update.getVersions()); mergeVersions(existingVersion, postedVersion); } return (Content) existing; }
Source:
public void getSearchConfig_shouldReturnLogEntryByGeneratedBy() throws Exception { MockHttpServletRequest req = request(RequestMethod.GET, getURI()); req.addParameter("generatedBy", USER_UUID); SimpleObject result = deserialize(handle(req)); Assert.assertEquals(5, Util.getResultsSize(result)); }

Target:
public void getSearchConfig_shouldReturnLogEntryByGeneratedBy() throws Exception { MockHttpServletRequest req = request(RequestMethod.GET, getURI()); req.addParameter("generatedBy", USER_UUID); SimpleObject result = deserialize(handle(req)); Assert.assertEquals(2, Util.getResultsSize(result)); }
Source:
public TableStatisticsImpl(String tableId, List<? extends PartitionStatistics> partitionStatistics, double fallbackNullFraction, double extraQualifierMultiplier) { this.tableId = tableId; this.partitionStatistics = partitionStatistics; assert partitionStatistics.size() > 0:"Partition statistics are 0"; this.fallbackNullFraction = fallbackNullFraction; this.extraQualifierMultiplier = extraQualifierMultiplier; isMergedStats = false; if (partitionStatistics.size() > 0) { if (partitionStatistics.get(0).getPartitionStatistics() != null) { int statsType = partitionStatistics.get(0).getPartitionStatistics().getStatsType(); isMergedStats = statsType == 2 || statsType == 3; } } }

Target:
public TableStatisticsImpl(String tableId, List<? extends PartitionStatistics> partitionStatistics, double fallbackNullFraction, double extraQualifierMultiplier) { this.tableId = tableId; this.partitionStatistics = partitionStatistics; assert partitionStatistics.size() > 0:"Partition statistics are 0"; this.fallbackNullFraction = fallbackNullFraction; this.extraQualifierMultiplier = extraQualifierMultiplier; isMergedStats = false; if (partitionStatistics.size() > 0) { if (partitionStatistics.get(0).getPartitionStatistics() != null) { int statsType = partitionStatistics.get(0).getPartitionStatistics().getStatsType(); isMergedStats = statsType == SYSTABLESTATISTICSRowFactory.REGULAR_MERGED_STATS || statsType == SYSTABLESTATISTICSRowFactory.SAMPLE_MERGED_STATS; } } }
Source:
public TransformOperator() { expressionImports.add("java.lang.Math.*"); expressionImports.add("org.apache.commons.lang3.StringUtils.*"); }

Target:
public TransformOperator() { expressionFuntions.add("java.lang.Math.*"); expressionFuntions.add("org.apache.commons.lang3.StringUtils.*"); expressionFuntions.add("org.apache.commons.lang3.StringEscapeUtils.*"); expressionFuntions.add("org.apache.commons.lang3.time.DurationFormatUtils.*"); expressionFuntions.add("org.apache.commons.lang3.time.DateFormatUtils.*"); }
Source:
void createTables(Map<TableReference, byte[]> tableRefToMetadata) { try { clientPool.runWithRetry(client -> { for (Map.Entry<TableReference, byte[]> entry : tableRefToMetadata.entrySet()) { createTable(entry.getKey(), entry.getValue(), client); } CassandraKeyValueServices.waitForSchemaVersions(config, client, "after adding the column family for " + "tables " + tableRefToMetadata.keySet() + " in a call to create tables"); return null; }); } catch (Exception e) { throw Throwables.unwrapAndThrowAtlasDbDependencyException(e); } }

Target:
void createTables(Map<TableReference, byte[]> tableRefToMetadata) { try { clientPool.runWithRetry(client -> { for (Map.Entry<TableReference, byte[]> entry : tableRefToMetadata.entrySet()) { CassandraKeyValueServices.runWithWaitingForSchemas( () -> createTable(entry.getKey(), entry.getValue(), client), config, client, "adding the column family for table " + entry.getKey() + " in a call to create tables"); } return null; }); } catch (Exception e) { throw Throwables.unwrapAndThrowAtlasDbDependencyException(e); } }
Source:
private TaskLauncher findTaskLauncher(String platformName) { Launcher launcher = this.launcherRepository.findByName(platformName); if (launcher == null) { List<String> launcherNames = StreamSupport.stream(launcherRepository.findAll().spliterator(), false) .map(Launcher::getName) .collect(Collectors.toList()); if (launcherNames.size() == 1) { logger.info("Task platform doesn't exist, defaulting to existing single platform {}", platformName, launcherNames.get(0)); launcher = this.launcherRepository.findByName(launcherNames.get(0)); } if (launcher == null) { throw new IllegalStateException(String.format( "No Launcher found for the platform named '%s'. " + "Available platform names are %s", platformName, launcherNames)); } } TaskLauncher taskLauncher = launcher.getTaskLauncher(); if (taskLauncher == null) { throw new IllegalStateException(String.format("No TaskLauncher found for the platform named '%s'", platformName)); } return taskLauncher; }

Target:
private TaskLauncher findTaskLauncher(String platformName) { Launcher launcher = this.launcherRepository.findByName(platformName); if (launcher == null) { List<String> launcherNames = StreamSupport.stream(launcherRepository.findAll().spliterator(), false) .map(Launcher::getName) .collect(Collectors.toList()); throw new IllegalStateException(String.format("No Launcher found for the platform named '%s'. " + "Available platform names are %s", platformName, launcherNames)); } TaskLauncher taskLauncher = launcher.getTaskLauncher(); if (taskLauncher == null) { throw new IllegalStateException(String.format("No TaskLauncher found for the platform named '%s'", platformName)); } return taskLauncher; }
Source:
private void saveNotificationsInRealm(List<Notification> notifications) { Realm realm = Realm.getDefaultInstance(); realm.executeTransaction(realm1 -> { realm1.delete(Notification.class); realm1.insertOrUpdate(notifications); }); realm.close(); }

Target:
private void saveNotificationsInRealm(List<Notification> notifications) { realm.executeTransaction(realm1 -> { realm1.delete(Notification.class); realm1.insertOrUpdate(notifications); }); }
Source:
private void processUserDefinedPVCs( KubernetesEnvironment k8sEnv, RuntimeIdentity identity, String workspaceId, Map<String, PersistentVolumeClaim> volumeName2PVC) { final Map<String, PersistentVolumeClaim> envClaims = k8sEnv.getPersistentVolumeClaims(); Map<String, PersistentVolumeClaim> userDefinedPVCs = envClaims .values() .stream() .filter( p -> { Object isProvisioned = p.getAdditionalProperties().get("CHE_PROVISIONED"); return !(isProvisioned instanceof Boolean) || !(Boolean) isProvisioned; }) .collect(toMap(pvc -> pvc.getMetadata().getName(), Function.identity())); prefixSubpaths(userDefinedPVCs.keySet(), k8sEnv.getPodsData(), identity.getWorkspaceId()); for (PersistentVolumeClaim pvc : userDefinedPVCs.values()) { String originalPVCName = pvc.getMetadata().getName(); PersistentVolumeClaim existingPVC = volumeName2PVC.get(originalPVCName); if (existingPVC != null) { envClaims.remove(originalPVCName); changePVCReferences( k8sEnv.getPodsData(), originalPVCName, existingPVC.getMetadata().getName()); } else { putLabel(pvc, CHE_VOLUME_NAME_LABEL, originalPVCName); putLabel(pvc, CHE_WORKSPACE_ID_LABEL, workspaceId); final String uniqueName = Names.generateName(pvcNamePrefix + '-'); pvc.getMetadata().setName(uniqueName); pvc.getAdditionalProperties().put("CHE_PROVISIONED", true); envClaims.remove(originalPVCName); envClaims.put(uniqueName, pvc); volumeName2PVC.put(originalPVCName, pvc); changePVCReferences(k8sEnv.getPodsData(), originalPVCName, uniqueName); } } }

Target:
private void processUserDefinedPVCs( KubernetesEnvironment k8sEnv, RuntimeIdentity identity, String workspaceId, Map<String, PersistentVolumeClaim> volumeName2PVC) { final Map<String, PersistentVolumeClaim> envClaims = k8sEnv.getPersistentVolumeClaims(); Map<String, PersistentVolumeClaim> userDefinedPVCs = envClaims .values() .stream() .filter( p -> { Object isProvisioned = p.getAdditionalProperties().get(CHE_PROVISIONED_PVC_PROPERTY); return !(isProvisioned instanceof Boolean) || !(Boolean) isProvisioned; }) .collect(toMap(pvc -> pvc.getMetadata().getName(), Function.identity())); prefixSubpaths(userDefinedPVCs.keySet(), k8sEnv.getPodsData(), identity.getWorkspaceId()); for (PersistentVolumeClaim pvc : userDefinedPVCs.values()) { String originalPVCName = pvc.getMetadata().getName(); PersistentVolumeClaim existingPVC = volumeName2PVC.get(originalPVCName); if (existingPVC != null) { envClaims.remove(originalPVCName); changePVCReferences( k8sEnv.getPodsData(), originalPVCName, existingPVC.getMetadata().getName()); } else { putLabel(pvc, CHE_VOLUME_NAME_LABEL, originalPVCName); putLabel(pvc, CHE_WORKSPACE_ID_LABEL, workspaceId); final String uniqueName = Names.generateName(pvcNamePrefix + '-'); pvc.getMetadata().setName(uniqueName); pvc.getAdditionalProperties().put(CHE_PROVISIONED_PVC_PROPERTY, true); envClaims.remove(originalPVCName); envClaims.put(uniqueName, pvc); volumeName2PVC.put(originalPVCName, pvc); changePVCReferences(k8sEnv.getPodsData(), originalPVCName, uniqueName); } } }
Source:
public void loadFilters() { view.addNumericFilter(constants.Id(), constants.FilterByTaskId(), f -> addSearchFilter(f, equalsTo(COLUMN_TASK_ID, f.getValue())) ); view.addTextFilter(constants.Task(), constants.FilterByTaskName(), f -> addSearchFilter(f, likeTo(COLUMN_NAME, f.getValue(), false)) ); final Map<String, String> status = getStatusByType(TaskType.ALL).stream().sorted().collect(Collectors.toMap(key -> key, value -> translationService.format(value))); view.addMultiSelectFilter(constants.Status(), status, f -> addSearchFilterList(COLUMN_STATUS, f)); view.addTextFilter(constants.Process_Instance_Correlation_Key(), constants.FilterByCorrelationKey(), f -> addSearchFilter(f, likeTo(COLUMN_PROCESS_INSTANCE_CORRELATION_KEY, f.getValue(), false)) ); view.addTextFilter(constants.Actual_Owner(), constants.FilterByActualOwner(), f -> addSearchFilter(f, likeTo(COLUMN_ACTUAL_OWNER, f.getValue(), false)) ); view.addTextFilter(constants.Process_Instance_Description(), constants.FilterByProcessInstanceDescription(), f -> addSearchFilter(f, likeTo(COLUMN_PROCESS_INSTANCE_DESCRIPTION, f.getValue(), false)) ); addTaskNameFilter(getDataSetId()); addProcessNameFilter(getDataSetId()); addContainerIdFilter(getDataSetId()); view.addDateRangeFilter(constants.Created_On(), constants.Created_On_Placeholder(), true, f -> addSearchFilter(f, between(COLUMN_CREATED_ON, f.getValue().getStartDate(), f.getValue().getEndDate())) ); }

Target:
public void loadFilters() { view.addNumericFilter(constants.Id(), constants.FilterByTaskId(), f -> addSearchFilter(f, equalsTo(COLUMN_TASK_ID, f.getValue())) ); view.addTextFilter(constants.Task(), constants.FilterByTaskName(), f -> addSearchFilter(f, likeTo(COLUMN_NAME, f.getValue(), false)) ); final Map<String, String> status = getStatusByType(TaskType.ALL).stream().sorted().collect(Collectors.toMap(key -> key, value -> translationService.format(value))); view.addMultiSelectFilter(constants.Status(), status, f -> addSearchFilterList(COLUMN_STATUS, f)); view.addTextFilter(constants.Process_Instance_Correlation_Key(), constants.FilterByCorrelationKey(), f -> addSearchFilter(f, likeTo(COLUMN_PROCESS_INSTANCE_CORRELATION_KEY, f.getValue(), false)) ); view.addTextFilter(constants.Actual_Owner(), constants.FilterByActualOwner(), f -> addSearchFilter(f, likeTo(COLUMN_ACTUAL_OWNER, f.getValue(), false)) ); view.addTextFilter(constants.Process_Instance_Description(), constants.FilterByProcessInstanceDescription(), f -> addSearchFilter(f, likeTo(COLUMN_PROCESS_INSTANCE_DESCRIPTION, f.getValue(), false)) ); addTaskNameFilter(getDataSetId()); addProcessNameFilter(getDataSetId()); view.addDateRangeFilter(constants.Created_On(), constants.Created_On_Placeholder(), true, f -> addSearchFilter(f, between(COLUMN_CREATED_ON, f.getValue().getStartDate(), f.getValue().getEndDate())) ); }
Source:
private void changeStatus(DestroyVmVDSCommandParameters parameters, VM curVm) { if (getParameters().getVdsId().equals(curVm.getRunOnVds())) { ResourceManager.getInstance().InternalSetVmStatus(curVm, parameters.getGracefully() ? VMStatus.PoweringDown : VMStatus.Down, curVm.getStatusUpdatedTime()); } }

Target:
private void changeStatus(DestroyVmVDSCommandParameters parameters, VM curVm) { if (getParameters().getVdsId().equals(curVm.getRunOnVds())) { ResourceManager.getInstance().InternalSetVmStatus(curVm, parameters.getGracefully() ? VMStatus.PoweringDown : VMStatus.Down); } }
Source:
public String indexState(TreeSet<Long> modTimes) throws IllegalStateException, MissingObjectException, IncorrectObjectTypeException, IOException { DirCache dc = DirCache.read(db); Map lookup = new HashMap(); List ret = new ArrayList(dc.getEntryCount()); NameConflictTreeWalk tw = new NameConflictTreeWalk(db); tw.reset(); tw.addTree(new FileTreeIteratorWithTimeControl(db, modTimes)); tw.addTree(new DirCacheIterator(dc)); FileTreeIteratorWithTimeControl fIt; DirCacheIterator dcIt; List entry; boolean smudgedBefore; while (tw.next()) { entry = new ArrayList(4); fIt = tw.getTree(0, FileTreeIteratorWithTimeControl.class); dcIt = tw.getTree(1, DirCacheIterator.class); entry.add(tw.getPathString()); entry.add("modTime(index/file): " + lookup(Long.valueOf(fIt.getEntryLastModified()), "t%n", lookup) + "/" + lookup(Long.valueOf(dcIt.getDirCacheEntry() .getLastModified()), "t%n", lookup)); smudgedBefore = dcIt.getDirCacheEntry().isSmudged(); if (fIt.isModified(dcIt.getDirCacheEntry(), true, true, db.getFS())) entry.add("dirty"); if (dcIt.getDirCacheEntry().isSmudged()) entry.add("smudged"); else if (smudgedBefore) entry.add("unsmudged"); ret.add(entry); } return ret.toString(); }

Target:
public String indexState(TreeSet<Long> modTimes) throws IllegalStateException, MissingObjectException, IncorrectObjectTypeException, IOException { DirCache dc = DirCache.read(db); Map lookup = new HashMap(); List ret = new ArrayList(dc.getEntryCount()); NameConflictTreeWalk tw = new NameConflictTreeWalk(db); tw.reset(); tw.addTree(new FileTreeIteratorWithTimeControl(db, modTimes)); tw.addTree(new DirCacheIterator(dc)); boolean smudgedBefore; while (tw.next()) { List entry = new ArrayList(4); FileTreeIteratorWithTimeControl fIt = tw.getTree(0, FileTreeIteratorWithTimeControl.class); DirCacheIterator dcIt = tw.getTree(1, DirCacheIterator.class); entry.add(tw.getPathString()); entry.add("modTime(index/file): " + lookup(Long.valueOf(dcIt.getDirCacheEntry() .getLastModified()), "t%n", lookup) + "/" + lookup(Long.valueOf(fIt.getEntryLastModified()), "t%n", lookup)); smudgedBefore = dcIt.getDirCacheEntry().isSmudged(); if (fIt.isModified(dcIt.getDirCacheEntry(), true, true, db.getFS())) entry.add("dirty"); if (dcIt.getDirCacheEntry().isSmudged()) entry.add("smudged"); else if (smudgedBefore) entry.add("unsmudged"); ret.add(entry); } return ret.toString(); }
Source:
public static SymbolicValue get(ExpressionTree expression) { if (expression.is(Kind.IDENTIFIER_REFERENCE)) { IdentifierTree identifier = (IdentifierTree) expression; if ("undefined".equals(identifier.name())) { return NULL_OR_UNDEFINED; } } return expression.is(Kind.NULL_LITERAL) ? NULL_OR_UNDEFINED : UNKNOWN; }

Target:
public static SymbolicValue get(ExpressionTree expression) { SymbolicValue value = UNKNOWN; if (expression.is(Kind.NULL_LITERAL)) { value = NULL_OR_UNDEFINED; } else if (expression.is(Kind.BOOLEAN_LITERAL)) { value = booleanLiteral((LiteralTree) expression); } else if (expression.is(Kind.STRING_LITERAL)) { value = stringLiteral((LiteralTree) expression); } else if (expression.is(Kind.NUMERIC_LITERAL)) { value = numericLiteral((LiteralTree) expression); } else if (expression.is(Kind.IDENTIFIER_REFERENCE)) { IdentifierTree identifier = (IdentifierTree) expression; if ("undefined".equals(identifier.name())) { value = NULL_OR_UNDEFINED; } } return value; }