auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Group createGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupRelationNotAllowed, GroupRelationAlreadyExists, WrongAttributeValueException, WrongReferenceAttributeValueException, ExternallyManagedException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); if (getGroupsManagerBl().isGroupInStructureSynchronizationTree(sess, resultGroup)) { throw new ExternallyManagedException("Result group: " + resultGroup + " is externally managed!"); } else if (getGroupsManagerBl().isGroupInStructureSynchronizationTree(sess, operandGroup)) { throw new ExternallyManagedException("Operand group: " + operandGroup + " is externally managed!"); } if ((!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup))) { throw new PrivilegeException(sess, "createGroupUnion"); } return getGroupsManagerBl().createGroupUnion(sess, resultGroup, operandGroup, false); }

Target:
public Group createGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupRelationNotAllowed, GroupRelationAlreadyExists, WrongAttributeValueException, WrongReferenceAttributeValueException, ExternallyManagedException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); if (getGroupsManagerBl().isGroupInStructureSynchronizationTree(sess, resultGroup)) { throw new ExternallyManagedException("Result group: " + resultGroup + " is externally managed!"); } if ((!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup))) { throw new PrivilegeException(sess, "createGroupUnion"); } return getGroupsManagerBl().createGroupUnion(sess, resultGroup, operandGroup, false); }
Source:
public void processEntry(MarshalledEntry<K, V> marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { if (!taskContext.isStopped()) { InternalCacheEntry<K, V> ice = PersistenceUtil.convert(marshalledEntry, entryFactory); if (!ice.isExpired(timeService.wallClockTime())) { action.apply(marshalledEntry.getKey(), ice); } if (Thread.interrupted()) { throw new InterruptedException(); } } }

Target:
public void processEntry(MarshalledEntry<K, V> marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { if (!taskContext.isStopped()) { InternalMetadata metadata = marshalledEntry.getMetadata(); if (metadata == null || !metadata.isExpired(timeService.wallClockTime())) { InternalCacheEntry<K, V> ice = PersistenceUtil.convert(marshalledEntry, entryFactory); action.apply(marshalledEntry.getKey(), ice); } if (Thread.interrupted()) { throw new InterruptedException(); } } }
Source:
public void visitMethod(MethodTree tree) { super.visitMethod(tree); if (tree.block() != null) { CFG cfg = CFG.build(tree); try { UCFG uCFG = buildUCfg(tree, cfg); UCFGtoProtobuf.toProtobufFile(uCFG, filePath()); } catch (Exception e) { LOG.error("Cannot generate ucfg in file "+fileKey+" for method at line"+tree.firstToken().line(), e); } index++; } }

Target:
public void visitMethod(MethodTree tree) { super.visitMethod(tree); if (tree.block() != null) { CFG cfg = CFG.build(tree); try { UCFG uCFG = buildUCfg(tree, cfg); UCFGtoProtobuf.toProtobufFile(uCFG, filePath()); } catch (Exception e) { LOG.error("Cannot generate ucfg in file " + fileKey + " for method at line" + tree.firstToken().line(), e); } } }
Source:
public void execute() throws MojoExecutionException, MojoFailureException { String osgiVersionStr = getOSGiVersion(); if (osgiVersionStr != null) { try { Version osgiVersion = Version.parseVersion(osgiVersionStr); if (!VersioningHelper.QUALIFIER.equals(osgiVersion.getQualifier())) { project.getProperties().put(BUILD_QUALIFIER_PROPERTY, osgiVersion.getQualifier()); project.getProperties().put(UNQUALIFIED_VERSION_PROPERTY, osgiVersion.getMajor() + "." + osgiVersion.getMinor() + "." + osgiVersion.getMicro()); return; } } catch (IllegalArgumentException e) { throw new MojoFailureException("Not a valid OSGi version " + osgiVersionStr + " for project " + project); } } String qualifier = forceContextQualifier; if (qualifier == null) { qualifier = buildPropertiesParser.parse(baseDir).getForceContextQualifier(); } if (qualifier == null) { Date timestamp = getBuildTimestamp(); qualifier = getQualifier(timestamp); } project.getProperties().put(BUILD_QUALIFIER_PROPERTY, qualifier); project.getProperties().put(UNQUALIFIED_VERSION_PROPERTY, getUnqualifiedVersion()); getLog().info("Qualifier: " + getUnqualifiedVersion() + "." + qualifier); }

Target:
public void execute() throws MojoExecutionException, MojoFailureException { TychoProjectVersion projectVersion = calculateQualifiedVersion(); project.getProperties().put(BUILD_QUALIFIER_PROPERTY, projectVersion.qualifier); project.getProperties().put(UNQUALIFIED_VERSION_PROPERTY, projectVersion.unqualifiedVersion); getLog().info("The project's OSGi version is " + projectVersion.getOSGiVersion()); }
Source:
private void findTop() throws IOException { while (source.hasTop()) { long colType = source.getTopKey().getTimestamp() & ColumnConstants.PREFIX_MASK; if (colType == TX_DONE_PREFIX || colType == WRITE_PREFIX || colType == DEL_LOCK_PREFIX) { source.skipToPrefix(source.getTopKey(), RLOCK_PREFIX); continue; } else if (colType == RLOCK_PREFIX) { if (ReadLockUtil.isDelete(source.getTopKey())) { lastDelete.set(source.getTopKey()); } else { if (lastDelete.equals(source.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)) { long ts1 = ReadLockUtil.decodeTs(source.getTopKey().getTimestamp() & TIMESTAMP_MASK); long ts2 = ReadLockUtil.decodeTs(lastDelete.getTimestamp() & TIMESTAMP_MASK); if (ts1 != ts2) { return; } } else { return; } } source.next(); continue; } else if (colType == DATA_PREFIX || colType == LOCK_PREFIX || colType == ACK_PREFIX) { source.skipColumn(source.getTopKey()); continue; } else { throw new IllegalArgumentException("Uknown column type " + source.getTopKey()); } } }

Target:
private void findTop() throws IOException { while (source.hasTop()) { long colType = source.getTopKey().getTimestamp() & ColumnConstants.PREFIX_MASK; if (colType == TX_DONE_PREFIX || colType == WRITE_PREFIX || colType == DEL_LOCK_PREFIX) { source.skipToPrefix(source.getTopKey(), RLOCK_PREFIX); continue; } else if (colType == RLOCK_PREFIX) { if (ReadLockUtil.isDelete(source.getTopKey())) { lastDelete.set(source.getTopKey()); } else { if (lastDelete.equals(source.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)) { long ts1 = ReadLockUtil.decodeTs(source.getTopKey().getTimestamp() & TIMESTAMP_MASK); long ts2 = ReadLockUtil.decodeTs(lastDelete.getTimestamp() & TIMESTAMP_MASK); if (ts1 != ts2) { return; } } else { return; } } source.next(); continue; } else if (colType == DATA_PREFIX || colType == LOCK_PREFIX || colType == ACK_PREFIX) { source.skipColumn(source.getTopKey()); continue; } else { throw new IllegalArgumentException("Unknown column type " + source.getTopKey()); } } }
Source:
void updateContainerBucket(Long bucketKey, String serviceId, String containerId, long value) { if (bucketKey != null && containerBuckets.containsKey(bucketKey)) { Map<String, Map<String, Long>> deltaInValidDataSizePerContainer = containerBuckets.get(bucketKey); updateNestedMapHelper(deltaInValidDataSizePerContainer, serviceId, containerId, value); } }

Target:
void updateContainerBucket(Long bucketKey, String serviceId, String containerId, long value) { if (bucketKey != null && containerBuckets.containsKey(bucketKey)) { Map<String, Map<String, Long>> existingBucketEntry = containerBuckets.get(bucketKey); updateNestedMapHelper(existingBucketEntry, serviceId, containerId, value); } }
Source:
private PartitionBy partitionByForString(String key) { if ( key == null ) return null; switch(key) { case "table": return PartitionBy.TABLE; case "database": return PartitionBy.DATABASE; case "primary_key": return PartitionBy.PRIMARY_KEY; case "column": return PartitionBy.COLUMN; default: return null; } }

Target:
private PartitionBy partitionByForString(String key) { if ( key == null ) return PartitionBy.DATABASE; switch(key) { case "table": return PartitionBy.TABLE; case "database": return PartitionBy.DATABASE; case "primary_key": return PartitionBy.PRIMARY_KEY; case "column": return PartitionBy.COLUMN; default: throw new RuntimeException("Unknown partitionBy string: " + key); } }
Source:
public boolean isDone(final TreeWalk walker) { return pathRaw.length == walker.getRawPath().length; }

Target:
public boolean isDone(final TreeWalk walker) { return pathRaw.length == walker.getPathLength(); }
Source:
public void registerAttributes(ManagementResourceRegistration resourceRegistration) { AbstractWriteAttributeHandler writeAttribute = new ActiveMQReloadRequiredHandlers.WriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attribute : ATTRIBUTES) { resourceRegistration.registerReadWriteAttribute(attribute, null, writeAttribute); } HAPolicySynchronizationStatusReadHandler.registerMasterAttributes(resourceRegistration); }

Target:
public void registerAttributes(ManagementResourceRegistration resourceRegistration) { AbstractWriteAttributeHandler writeAttribute = new ActiveMQReloadRequiredHandlers.WriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attribute : ATTRIBUTES) { resourceRegistration.registerReadWriteAttribute(attribute, null, writeAttribute); } if(registerRuntime) { HAPolicySynchronizationStatusReadHandler.registerMasterAttributes(resourceRegistration); } }
Source:
protected Optional<TypedValue> getValue(String name, StatementContext ctx) { Method method = ctx.getConfig(ClassMethodCache.class).getCache() .computeIfAbsent(obj.getClass(), ObjectMethodArguments::load) .get(name); if (method == null) { return Optional.empty(); } QualifiedType<?> type = QualifiedType.of(method.getGenericReturnType()) .withAnnotations(ctx.getConfig(Qualifiers.class).qualifiers(method)); Object value = invokeMethod(method, ctx); return Optional.of(new TypedValue(type, value)); }

Target:
protected Optional<TypedValue> getValue(String name, StatementContext ctx) { Method method = NULLARY_METHOD_CACHE.get(obj.getClass(), ctx).get(name); if (method == null) { return Optional.empty(); } QualifiedType<?> type = QualifiedType.of(method.getGenericReturnType()) .withAnnotations(ctx.getConfig(Qualifiers.class).findFor(method)); Object value = invokeMethod(method, ctx); return Optional.of(new TypedValue(type, value)); }
Source:
public static void main(String[] args) { try { CLIParse parser = new CLIParse(args); if (parser.hasArg("?") || parser.hasArg("help") || args.length == 0) { printUsage(); return; } if (!validate(parser)) { return; } String alias = "engine"; if (parser.hasArg("alias")) { alias = parser.getArg("alias"); } if (parser.hasArg("enc")) { System.out.println( EncryptionUtils.encrypt( parser.getArg("string"), parser.getArg("store"), parser.getArg("pass"), alias ).trim().replace("\r\n", "") ); } else if (parser.hasArg("dec")) { System.out.println( EncryptionUtils.decrypt( parser.getArg("string"), parser.getArg("store"), parser.getArg("pass"), alias ) ); } else if (parser.hasArg("pvk")) { System.out.write( pvk( parser.getArg("store"), parser.getArg("pass"), alias ) ); } else if (parser.hasArg("pubkey2ssh")) { System.out.println( pubkey2ssh( parser.getArg("store"), parser.getArg("pass"), alias ) ); } System.exit(0); } catch (Exception e) { System.out.println("Operation failed!"); System.exit(1); } }

Target:
public static void main(String[] args) { int exitCode = 0; try { CLIParse parser = new CLIParse(args); if (parser.hasArg("?") || parser.hasArg("help") || args.length == 0) { printUsage(); return; } if (!validate(parser)) { exitCode = 1; return; } String alias = "engine"; if (parser.hasArg("alias")) { alias = parser.getArg("alias"); } if (parser.hasArg("enc")) { System.out.println( EncryptionUtils.encrypt( parser.getArg("string"), parser.getArg("store"), parser.getArg("pass"), alias ).trim().replace("\r\n", "") ); } else if (parser.hasArg("dec")) { System.out.println( EncryptionUtils.decrypt( parser.getArg("string"), parser.getArg("store"), parser.getArg("pass"), alias ) ); } else if (parser.hasArg("pvk")) { System.out.write( pvk( parser.getArg("store"), parser.getArg("pass"), alias ) ); } else if (parser.hasArg("pubkey2ssh")) { System.out.println( pubkey2ssh( parser.getArg("store"), parser.getArg("pass"), alias ) ); } } catch (Exception e) { System.out.println("Operation failed!"); exitCode = 1; } finally { System.exit(exitCode); } }
Source:
public void shutdown() throws InterruptedException { for (VoltNetwork vn : m_networks) { vn.shutdown(); } ReverseDNSCache.m_es.shutdown(); }

Target:
public void shutdown() throws InterruptedException { for (VoltNetwork vn : m_networks) { vn.shutdown(); } }
Source:
public void run(ExternalContext externalContext) { if (isAppModeBatch) { initializeRunId(); } LocalJobPlanner planner = getPlanner(); try { List<JobConfig> jobConfigs = planner.prepareJobs(); if (jobConfigs.isEmpty()) { throw new SamzaException("No jobs to run."); } jobConfigs.forEach(jobConfig -> { LOG.debug("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); StreamProcessor processor = createStreamProcessor(jobConfig, appDesc, sp -> new LocalStreamProcessorLifecycleListener(sp, jobConfig), Optional.ofNullable(externalContext)); processors.add(processor); }); numProcessorsToStart.set(processors.size()); processors.forEach(StreamProcessor::start); } catch (Throwable throwable) { cleanup(); appStatus = ApplicationStatus.unsuccessfulFinish(throwable); shutdownLatch.countDown(); throw new SamzaException(String.format("Failed to start application: %s", new ApplicationConfig(appDesc.getConfig()).getGlobalAppId()), throwable); } }

Target:
public void run(ExternalContext externalContext) { initializeRunId(); LocalJobPlanner planner = getPlanner(); try { List<JobConfig> jobConfigs = planner.prepareJobs(); if (jobConfigs.isEmpty()) { throw new SamzaException("No jobs to run."); } jobConfigs.forEach(jobConfig -> { LOG.debug("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); StreamProcessor processor = createStreamProcessor(jobConfig, appDesc, sp -> new LocalStreamProcessorLifecycleListener(sp, jobConfig), Optional.ofNullable(externalContext)); processors.add(processor); }); numProcessorsToStart.set(processors.size()); processors.forEach(StreamProcessor::start); } catch (Throwable throwable) { cleanup(); appStatus = ApplicationStatus.unsuccessfulFinish(throwable); shutdownLatch.countDown(); throw new SamzaException(String.format("Failed to start application: %s", new ApplicationConfig(appDesc.getConfig()).getGlobalAppId()), throwable); } }
Source:
public static Class<?> getColumnClass(Column column) { switch (column) { case HREF_ID: return Integer.class; case REQUEST_TIMESTAMP: return Date.class; case RESPONSE_TIMESTAMP: return Date.class; case HREF_TYPE: return Integer.class; case METHOD: return String.class; case URL: return String.class; case STATUS_CODE: return Integer.class; case STATUS_REASON: return String.class; case RTT: return Integer.class; case SIZE_MESSAGE: case SIZE_REQUEST_HEADER: case SIZE_REQUEST_BODY: case SIZE_RESPONSE_HEADER: case SIZE_RESPONSE_BODY: return Integer.class; case SESSION_ID: return Long.class; case HIGHEST_ALERT: return AlertRiskTableCellItem.class; case NOTE: return Boolean.class; case TAGS: return String.class; case CUSTOM: return null; case HOSTNAME: return String.class; case PATH_AND_QUERY: return String.class; case PATH: return String.class; case QUERY: return String.class; default: return String.class; } }

Target:
public static Class<?> getColumnClass(Column column) { switch (column) { case HREF_ID: return Integer.class; case REQUEST_TIMESTAMP: return Date.class; case RESPONSE_TIMESTAMP: return Date.class; case HREF_TYPE: return Integer.class; case METHOD: return String.class; case URL: case HOSTNAME: case PATH_AND_QUERY: return String.class; case STATUS_CODE: return Integer.class; case STATUS_REASON: return String.class; case RTT: return Integer.class; case SIZE_MESSAGE: case SIZE_REQUEST_HEADER: case SIZE_REQUEST_BODY: case SIZE_RESPONSE_HEADER: case SIZE_RESPONSE_BODY: return Integer.class; case SESSION_ID: return Long.class; case HIGHEST_ALERT: return AlertRiskTableCellItem.class; case NOTE: return Boolean.class; case TAGS: return String.class; case CUSTOM: return null; default: return String.class; } }
Source:
public List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> getPendingOperations (@HeaderParam("Accept") String acceptHeader, @PathParam("id") String id, List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> resultOperations) { if (log.isDebugEnabled()) { log.debug("Invoking Android pending operations:" + id); } Message message = new Message(); MediaType responseMediaType = AndroidAPIUtils.getResponseMediaType(acceptHeader); try { if (resultOperations != null) { updateOperations(resultOperations); } } catch (OperationManagementException e) { message.setResponseMessage("Issue in retrieving operation management service instance"); log.error(message.getResponseMessage(), e); } DeviceIdentifier deviceIdentifier = AndroidAPIUtils.convertToDeviceIdentifierObject(id); List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> operations; try { operations = AndroidAPIUtils.getPendingOperations(deviceIdentifier); } catch (OperationManagementException e) { message.setResponseMessage("Issue in retrieving operation management service instance"); message.setResponseCode(Response.Status.INTERNAL_SERVER_ERROR.toString()); log.error(message.getResponseMessage(), e); throw new AndroidOperationException(message, responseMediaType); } return operations; }

Target:
public List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> getPendingOperations (@HeaderParam("Accept") String acceptHeader, @PathParam("id") String id, List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> resultOperations) { if (log.isDebugEnabled()) { log.debug("Invoking Android pending operations:" + id); } Message message = new Message(); MediaType responseMediaType = AndroidAPIUtils.getResponseMediaType(acceptHeader); try { if (resultOperations != null) { updateOperations(resultOperations); } } catch (OperationManagementException e) { message.setResponseMessage("Issue in retrieving operation management service instance"); log.error(message.getResponseMessage(), e); } DeviceIdentifier deviceIdentifier = AndroidAPIUtils.convertToDeviceIdentifierObject(id); List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> operations; try { operations = AndroidAPIUtils.getPendingOperations(deviceIdentifier); } catch (OperationManagementException e) { String errorMessage = "Issue in retrieving operation management service instance"; message.setResponseMessage(errorMessage); message.setResponseCode(Response.Status.INTERNAL_SERVER_ERROR.toString()); log.error(errorMessage, e); throw new AndroidOperationException(message, responseMediaType); } return operations; }
Source:
public void handle(String input, Console console) { isInvincible = SolShip.isInvincible; if(hero.isDead()){ console.warn("Cannot make invincible when dead"); return; } if(hero.isTranscendent()){ console.warn("Cannot make invincible when transdencent"); return; } if(isInvincible == false){ console.warn("Set player as invincible"); SolShip.setInvincible(); }else if(isInvincible == true){ console.warn("Set player as non invincible"); SolShip.setNonInvincible(); } }

Target:
public void handle(String input, Console console) { if (hero.isDead()) { console.warn("Cannot make invincible when dead"); return; } if (hero.isTranscendent()) { console.warn("Cannot make invincible when transdencent"); return; } if (!hero.isInvincible()) { console.info("Set player as invincible"); hero.setInvincible(true); } else if (hero.isInvincible()) { console.info("Set player as non invincible"); hero.setInvincible(false); } }
Source:
public static ImmutablePair<String, String> executeCommand(String command, File workingDir) { return executeCommand(command, true, Optional.of(ByteStreams.nullOutputStream()), Optional.of(ByteStreams.nullOutputStream()), workingDir); }

Target:
public static ImmutablePair<String, String> executeCommand(String command, File workingDir) { return executeCommand(command, workingDir, DEFAULT_TIMEOUT_MILLISECONDS); }
Source:
private boolean shouldUpdateDiskProperties() { return getOldDisk().isBoot() != getNewDisk().isBoot() || getOldDisk().getDiskInterface().getValue() != getNewDisk().getDiskInterface().getValue() || getOldDisk().getPropagateErrors().getValue() != getNewDisk().getPropagateErrors().getValue() || getOldDisk().isWipeAfterDelete() != getNewDisk().isWipeAfterDelete() || getOldDisk().isShareable() != getNewDisk().isShareable() || !StringUtils.equalsIgnoreCase(getOldDisk().getDiskDescription(), getNewDisk().getDiskDescription()) || !StringUtils.equalsIgnoreCase(getOldDisk().getDiskAlias(), getNewDisk().getDiskAlias()); }

Target:
private boolean shouldUpdateDiskProperties() { return getOldDisk().isBoot() != getNewDisk().isBoot() || getOldDisk().getDiskInterface().getValue() != getNewDisk().getDiskInterface().getValue() || getOldDisk().getPropagateErrors().getValue() != getNewDisk().getPropagateErrors().getValue() || getOldDisk().isWipeAfterDelete() != getNewDisk().isWipeAfterDelete() || getOldDisk().isShareable() != getNewDisk().isShareable() || !StringUtils.equals(getOldDisk().getDiskDescription(), getNewDisk().getDiskDescription()) || !StringUtils.equals(getOldDisk().getDiskAlias(), getNewDisk().getDiskAlias()); }
Source:
public void convertDataToFileError() throws LargePayloadException { ProvideAndRegisterDocumentSetRequestType request = new ProvideAndRegisterDocumentSetRequestType(); AssertionType assertion = new AssertionType(); AdapterDocSubmissionDeferredRequestProxyObjectFactory adapterFactory = mock(AdapterDocSubmissionDeferredRequestProxyObjectFactory.class); DocSubmissionDeferredRequestAuditLogger auditLogger = mock(DocSubmissionDeferredRequestAuditLogger.class); DocSubmissionUtils dsUtils = mock(DocSubmissionUtils.class); Properties webContextProperties = new Properties(); doThrow(new LargePayloadException()).when(dsUtils).convertDataToFileLocationIfEnabled(request); PassthroughInboundDocSubmissionDeferredRequest passthroughDocSubmission = new PassthroughInboundDocSubmissionDeferredRequest( adapterFactory, auditLogger, dsUtils); XDRAcknowledgementType actualResponse = passthroughDocSubmission.provideAndRegisterDocumentSetBRequest(request, assertion, webContextProperties); assertEquals("XDSRegistryError", actualResponse.getMessage().getRegistryErrorList().getRegistryError().get(0).getErrorCode()); assertEquals("urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure", actualResponse.getMessage().getStatus()); assertEquals("urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error", actualResponse.getMessage().getRegistryErrorList() .getRegistryError().get(0).getSeverity()); verify(auditLogger).auditResponseMessage(eq(request), eq(actualResponse), eq(assertion), isNull( NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.FALSE), eq(webContextProperties), eq(NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME)); }

Target:
public void convertDataToFileError() throws LargePayloadException { ProvideAndRegisterDocumentSetRequestType request = new ProvideAndRegisterDocumentSetRequestType(); AssertionType assertion = new AssertionType(); Properties webContextProperties = new Properties(); doThrow(new LargePayloadException()).when(dsUtils).convertDataToFileLocationIfEnabled(request); PassthroughInboundDocSubmissionDeferredRequest passthroughDocSubmission = new PassthroughInboundDocSubmissionDeferredRequest( adapterFactory, auditLogger, dsUtils); XDRAcknowledgementType actualResponse = passthroughDocSubmission.provideAndRegisterDocumentSetBRequest(request, assertion, webContextProperties); assertEquals("XDSRegistryError", actualResponse.getMessage().getRegistryErrorList().getRegistryError().get(0).getErrorCode()); assertEquals("urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure", actualResponse.getMessage().getStatus()); assertEquals("urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error", actualResponse.getMessage().getRegistryErrorList() .getRegistryError().get(0).getSeverity()); verify(auditLogger).auditResponseMessage(eq(request), eq(actualResponse), eq(assertion), isNull( NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.FALSE), eq(webContextProperties), eq(NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME)); }
Source:
public StanzaIdElement(String id, String by) { this.id = id; this.by = by; }

Target:
public StanzaIdElement(String id, String by) { super(id); this.by = by; }
Source:
protected final synchronized void destroyThreadPool() { if (threadPool != null) { LOG.debug("Destroying thread pool"); HadoopExecutors.shutdown(threadPool, LOG, THREAD_POOL_SHUTDOWN_DELAY, TimeUnit.SECONDS); threadPool = null; } }

Target:
protected synchronized void destroyThreadPool() { if (threadPool != null) { LOG.debug("Destroying thread pool"); HadoopExecutors.shutdown(threadPool, LOG, THREAD_POOL_SHUTDOWN_DELAY_SECONDS, TimeUnit.SECONDS); threadPool = null; } }
Source:
private Instance awaitAvailable(Instance instance, InstanceApi iapi) { for (int n = 0; n < 40; n = n + 1) { Instance updatedInstance = iapi.get(instance.getId()); if (updatedInstance.getStatus() == Instance.Status.ACTIVE) return updatedInstance; if (updatedInstance.getStatus() == Instance.Status.UNRECOGNIZED) return null; try { Thread.sleep(15000); } catch (InterruptedException e) { logger.info(e.getStackTrace().toString()); } } return null; }

Target:
private Instance awaitAvailable(Instance instance, InstanceApi iapi) { for (int n = 0; n < 100; n = n + 1) { Instance updatedInstance = iapi.get(instance.getId()); if (updatedInstance.getStatus() == Instance.Status.ACTIVE) return updatedInstance; if (updatedInstance.getStatus() == Instance.Status.UNRECOGNIZED) return null; Uninterruptibles.sleepUninterruptibly(15, TimeUnit.SECONDS); } return null; }
Source:
public QuotaInfo apply(ProjectResource rsrc) throws ExecutionException { QuotaInfo qi = new QuotaInfo(); Project.NameKey n = rsrc.getNameKey(); qi.used = repoSizeCache.get(n).get(); QuotaSection qs = quotaFinder.firstMatching(n); if (qs == null) { return qi; } Long maxRepoSize = qs.getMaxRepoSize(); if (maxRepoSize != null) { qi.maxRepoSize = maxRepoSize; } qi.namespace = new NamespaceInfo(); qi.namespace.name = qs.getNamespace(); Long maxTotalSize = qs.getMaxTotalSize(); if (maxTotalSize != null) { qi.namespace.maxTotalSize = maxTotalSize; } return qi; }

Target:
public QuotaInfo apply(ProjectResource rsrc) throws ExecutionException { QuotaInfo qi = new QuotaInfo(); Project.NameKey n = rsrc.getNameKey(); qi.repoSize = repoSizeCache.get(n).get(); QuotaSection qs = quotaFinder.firstMatching(n); if (qs == null) { return qi; } qi.maxRepoSize = qs.getMaxRepoSize(); qi.namespace = new NamespaceInfo(); qi.namespace.name = qs.getNamespace(); qi.namespace.maxTotalSize = qs.getMaxTotalSize(); return qi; }
Source:
public <T> void removeTask( ScheduledTask<T> task ) { synchronized ( applicationConfiguration ) { List<CScheduledTask> tasks = getCurrentConfiguration( true ); CScheduledTask foundTask = findTask( task.getId(), tasks ); if ( foundTask != null ) { tasks.remove( foundTask ); } if ( NXCM4979DEBUG ) { logger.info( "Task with ID={} removed, config modified.", task.getId(), foundTask != null ? "IS" : "is NOT", new Exception( "This is an exception only to provide caller backtrace" ) ); } try { applicationConfiguration.saveConfiguration(); } catch ( IOException e ) { logger.warn( "Could not save task changes!", e ); } } }

Target:
public <T> void removeTask( ScheduledTask<T> task ) { synchronized ( applicationConfiguration ) { List<CScheduledTask> tasks = getCurrentConfiguration( true ); CScheduledTask foundTask = findTask( task.getId(), tasks ); if ( foundTask != null ) { tasks.remove( foundTask ); } if ( logger.isTraceEnabled() ) { logger.trace( "Task with ID={} removed, config modified.", task.getId(), foundTask != null ? "IS" : "is NOT", new Exception( "This is an exception only to provide caller backtrace" ) ); } try { applicationConfiguration.saveConfiguration(); } catch ( IOException e ) { logger.warn( "Could not save task changes!", e ); } } }
Source:
public static synchronized void refreshAuthz(PerunSession sess) throws InternalErrorException { Utils.checkPerunSession(sess); log.debug("Refreshing authz roles for session {}.", sess); sess.getPerunPrincipal().setRoles(AuthzResolverBlImpl.getRoles(sess)); prepareServiceRoles(sess); if (sess.getPerunPrincipal().getUser() != null) { sess.getPerunPrincipal().getRoles().putAuthzRole(Role.SELF, sess.getPerunPrincipal().getUser()); if (sess.getPerunPrincipal().getUser().isServiceUser()) { sess.getPerunPrincipal().getRoles().putAuthzRole(Role.SERVICEUSER); } } if(sess.getPerunClient().getType() == PerunClient.Type.OAUTH) { sess.getPerunPrincipal().getRoles().remove(Role.PERUNADMIN); } sess.getPerunPrincipal().setAuthzInitialized(true); }

Target:
public static synchronized void refreshAuthz(PerunSession sess) throws InternalErrorException { Utils.checkPerunSession(sess); log.trace("Refreshing authz roles for session {}.", sess); sess.getPerunPrincipal().setRoles(new AuthzRoles()); prepareServiceRoles(sess); if (sess.getPerunPrincipal().getRoles().isEmpty()) { User user = sess.getPerunPrincipal().getUser(); AuthzRoles roles; if (user == null) { roles = new AuthzRoles(); } else { roles = addAllSubgroupsToAuthzRoles(sess, authzResolverImpl.getRoles(user)); roles.putAuthzRole(Role.SELF, user); if (user.isServiceUser()) { roles.putAuthzRole(Role.SERVICEUSER); } } sess.getPerunPrincipal().setRoles(roles); } if (sess.getPerunClient().getType() == PerunClient.Type.OAUTH) { List<String> oauthScopes = sess.getPerunClient().getScopes(); if(!oauthScopes.contains(PerunClient.PERUN_ADMIN_SCOPE)) { log.debug("removing PERUNADMIN role from session of user {}",sess.getPerunPrincipal().getUserId()); sess.getPerunPrincipal().getRoles().remove(Role.PERUNADMIN); } if(!oauthScopes.contains(PerunClient.PERUN_API_SCOPE)) { log.warn("removing all roles from session {}",sess); sess.getPerunPrincipal().getRoles().clear(); } } log.trace("Refreshed roles: {}", sess.getPerunPrincipal().getRoles()); sess.getPerunPrincipal().setAuthzInitialized(true); }
Source:
public boolean advanceNextPosition() { if (!searchHits.hasNext()) { return false; } SearchHit hit = searchHits.next(); fields = new ArrayList(Collections.nCopies(columnHandles.size(), null)); setFieldIfExists("_id", hit.getId()); setFieldIfExists("_index", hit.getIndex()); extractFromSource(hit); totalBytes += fields.size(); return true; }

Target:
public boolean advanceNextPosition() { if (!searchHits.hasNext()) { return false; } SearchHit hit = searchHits.next(); fields = new ArrayList<>(Collections.nCopies(columnHandles.size(), null)); setFieldIfExists("_id", hit.getId()); setFieldIfExists("_index", hit.getIndex()); extractFromSource(hit); if (hit.getSourceRef() != null) { totalBytes += hit.getSourceRef().length(); } return true; }
Source:
private Object stateToObject(State state) { Object value; if (state instanceof DecimalType) { value = convertBigDecimalToNum(((DecimalType) state).toBigDecimal()); } else if (state instanceof PercentType) { value = convertBigDecimalToNum(((PercentType) state).toBigDecimal()); } else if (state instanceof OnOffType) { value = (OnOffType) state == OnOffType.ON ? 1 : 0; } else if (state instanceof OpenClosedType) { value = (OpenClosedType) state == OpenClosedType.OPEN ? 1 : 0; } else if (state instanceof HSBType) { value = ((HSBType) state).getConstituents(); } else if (state instanceof DateTimeType) { value = ((DateTimeType) state).getCalendar().getTime().getTime(); } else if (state instanceof PointType) { value = ((PointType) state).getConstituents(); } else { value = state.toString(); } return value; }

Target:
private Object stateToObject(State state) { Object value; if (state instanceof DecimalType) { value = convertBigDecimalToNum(((DecimalType) state).toBigDecimal()); } else if (state instanceof OnOffType) { value = (OnOffType) state == OnOffType.ON ? 1 : 0; } else if (state instanceof OpenClosedType) { value = (OpenClosedType) state == OpenClosedType.OPEN ? 1 : 0; } else if (state instanceof HSBType) { value = ((HSBType) state).toString(); } else if (state instanceof DateTimeType) { value = ((DateTimeType) state).toString(); } else { value = state.toString(); } return value; }
Source:
public void resolveHostname(String hostname, Handler<AsyncResult<InetAddress>> resultHandler) { ContextInternal callback = (ContextInternal) vertx.getOrCreateContext(); io.netty.resolver.AddressResolver<InetSocketAddress> resolver = resolverGroup.getResolver(callback.nettyEventLoop()); io.netty.util.concurrent.Future<InetSocketAddress> fut = resolver.resolve(InetSocketAddress.createUnresolved(hostname, 0)); fut.addListener(a -> { callback.runOnContext(v -> { if (a.isSuccess()) { InetSocketAddress address = fut.getNow(); resultHandler.handle(Future.succeededFuture(address.getAddress())); } else { if (Utils.isWindows() && hostname.equals("localhost")) { resultHandler.handle(Future.succeededFuture(LOOPBACK_ADDRESS)); } else { resultHandler.handle(Future.failedFuture(a.cause())); } } }); }); }

Target:
public void resolveHostname(String hostname, Handler<AsyncResult<InetAddress>> resultHandler) { ContextInternal callback = (ContextInternal) vertx.getOrCreateContext(); io.netty.resolver.AddressResolver<InetSocketAddress> resolver = resolverGroup.getResolver(callback.nettyEventLoop()); io.netty.util.concurrent.Future<InetSocketAddress> fut = resolver.resolve(InetSocketAddress.createUnresolved(hostname, 0)); fut.addListener(a -> { callback.runOnContext(v -> { if (a.isSuccess()) { InetSocketAddress address = fut.getNow(); resultHandler.handle(Future.succeededFuture(address.getAddress())); } else { resultHandler.handle(Future.failedFuture(a.cause())); } }); }); }
Source:
public CompletableFuture<Acknowledge> cancel(Time timeout) { synchronized (lock) { if (isInitialized()) { return getJobMasterGateway().thenCompose(jobMasterGateway -> jobMasterGateway.cancel(timeout)); } else { log.info("Cancellation during initialization requested for job {}. Job will be cancelled once JobManager has been initialized.", jobId); jobManagerRunnerFuture .thenCompose(JobManagerRunner::getJobMasterGateway) .thenCompose(jobMasterGateway -> jobMasterGateway.cancel(RpcUtils.INF_TIMEOUT)) .whenComplete((ignored, cancelThrowable) -> { if (cancelThrowable != null) { log.warn("Cancellation of job failed", jobId, cancelThrowable); } }); jobStatus = DispatcherJobStatus.CANCELLING; jobResultFuture.whenComplete(((archivedExecutionGraph, throwable) -> { if (archivedExecutionGraph != null) { jobStatus = DispatcherJobStatus.JOB_MANAGER_RUNNER_INITIALIZED; } })); return jobResultFuture.thenApply(ignored -> Acknowledge.get()); } } }

Target:
public CompletableFuture<Acknowledge> cancel(Time timeout) { synchronized (lock) { if (isInitialized()) { return getJobMasterGateway().thenCompose(jobMasterGateway -> jobMasterGateway.cancel(timeout)); } else { log.info("Cancellation during initialization requested for job {}. Job will be cancelled once JobManager has been initialized.", jobId); CompletableFuture<Acknowledge> cancelFuture = jobManagerRunnerFuture .thenCompose(JobManagerRunner::getJobMasterGateway) .thenCompose(jobMasterGateway -> jobMasterGateway.cancel(timeout)); cancelFuture.whenComplete((ignored, cancelThrowable) -> { if (cancelThrowable != null) { log.warn("Cancellation of job failed", jobId, cancelThrowable); } }); jobStatus = DispatcherJobStatus.CANCELLING; return cancelFuture; } } }
Source:
private void preloadContextCache(List<Class<?>> classes) throws JAXBException { for (Class<?> clazz : classes) { getContext(clazz); } }

Target:
private void preloadContextCache(List<Class<?>> classes) throws JAXBException { if (classes != null && !classes.isEmpty()) { for (Class<?> clazz : classes) { getContext(clazz); } } }
Source:
public boolean canConvertToAuto(Tool tool) { final String repo = tool.getNamespace() + '/' + tool.getName(); final Gson gson = new Gson(); String urlBuilds = QUAY_URL + "repository/" + repo + "/build/?limit=2147483647"; Optional<String> asStringBuilds = ResourceUtilities.asString(urlBuilds, quayToken.getContent(), client); if (asStringBuilds.isPresent()) { String json = asStringBuilds.get(); Map<String, ArrayList> map = new HashMap<>(); map = (Map<String, ArrayList>) gson.fromJson(json, map.getClass()); ArrayList builds = map.get("builds"); for (Object build : builds) { Map<String, Map<String, String>> triggerMetadataMap = (Map<String, Map<String, String>>)build; Map<String, String> triggerMetadata = triggerMetadataMap.get("trigger_metadata"); if (triggerMetadata != null) { String gitUrl = triggerMetadata.get("git_url"); if (Objects.equals(gitUrl, tool.getGitUrl())) { return true; } } } } return false; }

Target:
public boolean canConvertToAuto(Tool tool) { final String repo = tool.getNamespace() + '/' + tool.getName(); final Gson gson = new Gson(); String urlBuilds = QUAY_URL + "repository/" + repo + "/build/?limit=" + Integer.MAX_VALUE; Optional<String> asStringBuilds = ResourceUtilities.asString(urlBuilds, quayToken.getContent(), client); if (asStringBuilds.isPresent()) { String json = asStringBuilds.get(); Map<String, ArrayList> map = new HashMap<>(); map = (Map<String, ArrayList>) gson.fromJson(json, map.getClass()); ArrayList builds = map.get("builds"); for (Object build : builds) { Map<String, Map<String, String>> triggerMetadataMap = (Map<String, Map<String, String>>)build; Map<String, String> triggerMetadata = triggerMetadataMap.get("trigger_metadata"); if (triggerMetadata != null) { String gitUrl = triggerMetadata.get("git_url"); if (Objects.equals(gitUrl, tool.getGitUrl())) { return true; } } } } return false; }
Source:
public List<Group> listGroups(Condition condition, int limit, int offset, String sortBy, String sortOrder) throws UserStoreException { validateCondition(condition); String domain = getDomainFromCondition(condition); handlePreListGroup(condition, domain); List<Group> filteredGroups = new ArrayList<>(); UserStoreManager secManager = getSecondaryUserStoreManager(domain); if (secManager != null) { if (secManager instanceof AbstractUserStoreManager) { if (isUniqueUserIdEnabled(secManager)) { UniqueIDPaginatedSearchResult <Group> groups = ((AbstractUserStoreManager) secManager) .doListGroups(condition, domain, offset, limit, sortBy, sortOrder); filteredGroups = groups.getEntities(); } else { throw new UserStoreException(" listGroups is not supported."); } } } handlePostListGroups(condition, domain, false); return filteredGroups; }

Target:
public List<Group> listGroups(Condition condition, int limit, int offset, String sortBy, String sortOrder) throws UserStoreException { validateCondition(condition); String domain = getDomainFromCondition(condition); handlePreListGroup(condition, domain); List<Group> filteredGroups = new ArrayList<>(); UserStoreManager secManager = getSecondaryUserStoreManager(domain); if (secManager != null) { if (secManager instanceof AbstractUserStoreManager) { if (isUniqueUserIdEnabled(secManager)) { UniqueIDPaginatedSearchResult <Group> groups = ((AbstractUserStoreManager) secManager) .doListGroups(condition, domain, offset, limit, sortBy, sortOrder); filteredGroups = groups.getEntities(); } else { throw new UserStoreException("listGroups is not supported in this: " + this.getClass()); } } } handlePostListGroups(condition, domain, false); return filteredGroups; }
Source:
public void testPrometheusMetrics() throws Exception { SolverInstance solverInstance = solverClient.createSolver(CONTAINER_1_ID, SOLVER_PROMETHEUS_ID, SOLVER_1_CONFIG); assertNotNull(solverInstance); assertEquals(SolverInstance.SolverStatus.NOT_SOLVING, solverInstance.getStatus()); Object planningProblem = loadPlanningProblem(5, 15); solverClient.solvePlanningProblem(CONTAINER_1_ID, SOLVER_PROMETHEUS_ID, planningProblem); solverInstance = solverClient.getSolver(CONTAINER_1_ID, SOLVER_PROMETHEUS_ID); for (int i = 0; i < 5 && solverInstance.getStatus() == SolverInstance.SolverStatus.SOLVING; i++) { Thread.sleep(3000); solverInstance = solverClient.getSolver(CONTAINER_1_ID, SOLVER_PROMETHEUS_ID); assertNotNull(solverInstance); } assertEquals(SolverInstance.SolverStatus.NOT_SOLVING, solverInstance.getStatus()); solverClient.disposeSolver(CONTAINER_1_ID, SOLVER_PROMETHEUS_ID); checkPrometheusMetrics(); }

Target:
public void testPrometheusMetrics() throws Exception { testExecuteSolverHelper(SOLVER_PROMETHEUS_ID); checkPrometheusMetrics(); }
Source:
protected void fillDisplay(final Collection collection) { DecimalFormat format = new DecimalFormat("0.##"); java.util.List<Collectible> list = collection.sort(new RarityComparator()); cContentTable.clear(); System.out.println(list); for (final Collectible collectible : list) { cContentTable.add(new Image(CollectibleDrawer.drawCollectible(collectible))).space(30); } cContentTable.row(); for (final Collectible collectible : list) { cContentTable.add(cGameSkin.generateDefaultLabel(format.format(collectible.getRarity()))); } }

Target:
protected void fillDisplay(final Collection collection) { DecimalFormat format = new DecimalFormat("0.##"); java.util.List<Collectible> list = collection.sort(new RarityComparator()); cContentTable.clear(); for (final Collectible collectible : list) { cContentTable.add(new Image(CollectibleDrawer.drawCollectible(collectible))).space(30); } cContentTable.row(); for (final Collectible collectible : list) { cContentTable.add(cGameSkin.generateDefaultLabel(format.format(collectible.getRarity()))); } }
Source:
private Pair<Long, Boolean> checkArrivals(ObaArrivalInfoResponse response, Cursor c) { final String tripId = c.getString(COL_TRIP_ID); final ObaArrivalInfo[] arrivals = response.getArrivalInfo(); final int length = arrivals.length; for (int i = 0; i < length; ++i) { ObaArrivalInfo info = arrivals[i]; if (tripId.equals(info.getTripId())) { long depart = info.getPredictedArrivalTime(); boolean isArriving = true; if (depart == 0) { depart = info.getScheduledArrivalTime(); isArriving = false; } return new Pair<>(depart, isArriving); } } return null; }

Target:
private Long checkArrivals(ObaArrivalInfoResponse response, Cursor c) { final String tripId = c.getString(COL_TRIP_ID); final ObaArrivalInfo[] arrivals = response.getArrivalInfo(); final int length = arrivals.length; for (int i = 0; i < length; ++i) { ObaArrivalInfo info = arrivals[i]; if (tripId.equals(info.getTripId())) { long depart = info.getPredictedArrivalTime(); if (depart == 0) { depart = info.getScheduledArrivalTime(); } return depart; } } return null; }
Source:
public Observable<DataPoint<RatioMap>> findAvailabilityRatioMap( String tenantId, Map<String, String> tagFilters, long start, long end, int limit, Order order) { checkArgument(isValidTimeRange(start, end), "Invalid time range"); Observable<DataPoint<RatioMap>> result = findMetricsWithFilters(tenantId, AVAILABILITY, tagFilters) .map(metric -> findDataPoints(metric.getMetricId(), start, end, limit, order)) .compose(o -> buildRatioMapSeries(o, order, AvailabilityType::getText)); if (limit > 0) { result = result.limit(limit); } return result; }

Target:
public Observable<DataPoint<RatioMap>> findAvailabilityRatioMap( String tenantId, Map<String, String> tagFilters, long start, long end, int limit, Order order) { checkArgument(isValidTimeRange(start, end), "Invalid time range"); Observable<DataPoint<RatioMap>> result = findMetricsWithFilters(tenantId, AVAILABILITY, tagFilters) .map(metric -> findDataPoints(metric.getMetricId(), start, end, limit, order)) .compose(o -> buildRatioMapSeries(o, order, AvailabilityType::getText)); if (limit > 0) { result = result.take(limit); } return result; }
Source:
void next(ServiceBusReceivedMessageContext message) { try { if (timeoutBeforeNextMessageOperation != null && !timeoutBeforeNextMessageOperation.isDisposed()) { timeoutBeforeNextMessageOperation.dispose(); } emitter.next(message); remaining.decrementAndGet(); timeoutBeforeNextMessageOperation = getShortTimeoutBetweenMessages(); } catch (Exception e) { logger.warning("Exception occurred while publishing downstream.", e); error(e); } }

Target:
void next(ServiceBusReceivedMessageContext message) { try { emitter.next(message); messageReceivedSink.next(message); remaining.decrementAndGet(); } catch (Exception e) { logger.warning("Exception occurred while publishing downstream.", e); error(e); } }
Source:
public String getDescription() { return null; }

Target:
public String getDescription() { return ""; }
Source:
public void simplifyScopedStoragePathTest() { assertThat(FileUtils.simplifyScopedStoragePath(null), is(nullValue())); assertThat(FileUtils.simplifyScopedStoragePath(""), is("")); assertThat(FileUtils.simplifyScopedStoragePath("blahblahblah"), is("blahblahblah")); assertThat(FileUtils.simplifyScopedStoragePath("/storage/emulated/0/Android/data/org.odk.collect.android/files/layers"), is("/sdcard/Android/data/org.odk.collect.android/files/layers")); }

Target:
public void simplifyScopedStoragePathTest() { assertThat(FileUtils.simplifyScopedStoragePath(null), is(nullValue())); assertThat(FileUtils.simplifyScopedStoragePath(""), is("")); assertThat(FileUtils.simplifyScopedStoragePath("blahblahblah"), is("blahblahblah")); assertThat(FileUtils.simplifyScopedStoragePath("/storage/emulated/0/Android/data/org.odk.collect.android/files/layers"), is("/sdcard/Android/data/org.odk.collect.android/files/layers")); assertThat(FileUtils.simplifyScopedStoragePath("/storage/emulated/0/Android/data/org.odk.collect.android/files/layers/countries/countries-raster.mbtiles"), is("/sdcard/Android/data/org.odk.collect.android/files/layers/countries/countries-raster.mbtiles")); }
Source:
public String getName() { if(getEcoreOperation() == null) { return safeName("null"); } return safeName(getEcoreOperation().getName()); }

Target:
public String getName() { if(getEcoreOperation() == null) { return ""; } return safeName(getEcoreOperation().getName()); }