auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void authzFetchPrincipalRecord() { logger.debug("start authz_fetch_principal_record"); ExtensionProxy authzExtension = getExtensionByName((String) this.actionArgs.get("extension-name")); ExtMap outMap = authzExtension.invoke( new ExtMap().mput( Authz.InvokeKeys.PRINCIPAL, this.actionArgs.get("principal-name") ).mput( Base.InvokeKeys.COMMAND, Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD ).mput( Authz.InvokeKeys.QUERY_FLAGS, getFlags() ) ); processAuthzResult(outMap, "AUTHENTICATE_CREDENTIALS"); logger.info("authz_fetch_principal_record action completed"); }

Target:
private void authzFetchPrincipalRecord() { logger.debug("start authz_fetch_principal_record"); ExtensionProxy authzExtension = getExtensionManager().getExtensionByName((String) this.actionArgs.get("extension-name")); ExtMap outMap = authzExtension.invoke( new ExtMap().mput( Authz.InvokeKeys.PRINCIPAL, this.actionArgs.get("principal-name") ).mput( Base.InvokeKeys.COMMAND, Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD ).mput( Authz.InvokeKeys.QUERY_FLAGS, getFlags() ) ); processAuthzResult(outMap, "AUTHENTICATE_CREDENTIALS"); logger.info("authz_fetch_principal_record action completed"); }
Source:
public String commitMessage(GitRepositoryManager repoManager, Provider<ReviewDb> db) { if (commitMessage == null) { try { PatchSet.Id psId = change(db).currentPatchSetId(); String sha1 = db.get().patchSets().get(psId).getRevision().get(); Project.NameKey name = change.getProject(); Repository repo = repoManager.openRepository(name); RevWalk walk = new RevWalk(repo); try { RevCommit c = walk.parseCommit(ObjectId.fromString(sha1)); commitMessage = c.getFullMessage(); } finally { walk.release(); } } catch (RepositoryNotFoundException e) { log.error("Problem opening change repository", e); } catch (IOException e) { log.error("Problem finding commit message", e); } catch (OrmException e) { log.error("Problem requesting sha1 from database", e); } } return commitMessage; }

Target:
public String commitMessage(GitRepositoryManager repoManager, Provider<ReviewDb> db) { if (commitMessage == null) { PatchSet.Id psId = null; String sha1 = null; Project.NameKey name = null; Repository repo = null; try { psId = change(db).currentPatchSetId(); sha1 = db.get().patchSets().get(psId).getRevision().get(); name = change.getProject(); repo = repoManager.openRepository(name); RevWalk walk = new RevWalk(repo); try { RevCommit c = walk.parseCommit(ObjectId.fromString(sha1)); commitMessage = c.getFullMessage(); } finally { walk.release(); } } catch (RepositoryNotFoundException e) { log.error("Repository not found: " + name.toString(), e); } catch (IOException e) { if(repo == null) { log.error("Problem opening repository: " + name.toString(), e); } else { log.error("Problem parsing commit: " + sha1, e); } } catch (OrmException e) { if (psId != null) { log.error("Problem requesting sha1 from database for patchSetId: " + psId.toString(), e); } else { log.error("Problem requesting change from database for change: " + legacyId.toString(), e); } } } return commitMessage; }
Source:
static void putKeyValueSize( PageCursor cursor, int keySize, int valueSize ) { boolean hasAdditionalKeySize = keySize > MASK_ONE_BYTE_KEY_SIZE; boolean hasValueSize = valueSize > 0; { byte firstByte = (byte) (keySize & MASK_ONE_BYTE_KEY_SIZE); if ( hasAdditionalKeySize ) { firstByte |= FLAG_ADDITIONAL_KEY_SIZE; if ( keySize > MASK_TWO_BYTE_KEY_SIZE ) { throw new IllegalArgumentException( format( "Max supported key size is %d, but tried to store key of size %d", MASK_TWO_BYTE_KEY_SIZE, keySize ) ); } } if ( hasValueSize ) { firstByte |= FLAG_HAS_VALUE_SIZE; } cursor.putByte( firstByte ); if ( hasAdditionalKeySize ) { cursor.putByte( (byte) (keySize >> SHIFT_LSB_KEY_SIZE) ); } } { if ( hasValueSize ) { boolean needsAdditionalValueSize = valueSize > MASK_ONE_BYTE_VALUE_SIZE; byte firstByte = (byte) (valueSize & MASK_ONE_BYTE_VALUE_SIZE); if ( needsAdditionalValueSize ) { if ( valueSize > MASK_TWO_BYTE_VALUE_SIZE ) { throw new IllegalArgumentException( format( "Max supported key size is %d, but tried to store key of size %d", MASK_TWO_BYTE_VALUE_SIZE, valueSize ) ); } firstByte |= FLAG_ADDITIONAL_VALUE_SIZE; } cursor.putByte( firstByte ); if ( needsAdditionalValueSize ) { cursor.putByte( (byte) (valueSize >> SHIFT_LSB_VALUE_SIZE) ); } } } }

Target:
static void putKeyValueSize( PageCursor cursor, int keySize, int valueSize ) { boolean hasAdditionalKeySize = keySize > MASK_ONE_BYTE_KEY_SIZE; boolean hasValueSize = valueSize > 0; { byte firstByte = (byte) (keySize & MASK_ONE_BYTE_KEY_SIZE); if ( hasAdditionalKeySize ) { firstByte |= FLAG_ADDITIONAL_KEY_SIZE; if ( keySize > MAX_TWO_BYTE_KEY_SIZE ) { throw new IllegalArgumentException( format( "Max supported key size is %d, but tried to store key of size %d", MAX_TWO_BYTE_KEY_SIZE, keySize ) ); } } if ( hasValueSize ) { firstByte |= FLAG_HAS_VALUE_SIZE; } cursor.putByte( firstByte ); if ( hasAdditionalKeySize ) { cursor.putByte( (byte) (keySize >> SHIFT_LSB_KEY_SIZE) ); } } { if ( hasValueSize ) { boolean needsAdditionalValueSize = valueSize > MASK_ONE_BYTE_VALUE_SIZE; byte firstByte = (byte) (valueSize & MASK_ONE_BYTE_VALUE_SIZE); if ( needsAdditionalValueSize ) { if ( valueSize > MAX_TWO_BYTE_VALUE_SIZE ) { throw new IllegalArgumentException( format( "Max supported value size is %d, but tried to store value of size %d", MAX_TWO_BYTE_VALUE_SIZE, valueSize ) ); } firstByte |= FLAG_ADDITIONAL_VALUE_SIZE; } cursor.putByte( firstByte ); if ( needsAdditionalValueSize ) { cursor.putByte( (byte) (valueSize >> SHIFT_LSB_VALUE_SIZE) ); } } } }
Source:
void reconnect(int index) { if (this.s == Operators.cancelledSubscription() && S.compareAndSet(this, Operators.cancelledSubscription(), null)) { keepAliveSupport.stop(); logger.debug("Connection[" + index + "] is lost. Reconnecting..."); connectionFactory.retryWhen(retry).timeout(resumeSessionDuration).subscribe(this); } }

Target:
void reconnect(int index) { if (this.s == Operators.cancelledSubscription() && S.compareAndSet(this, Operators.cancelledSubscription(), null)) { keepAliveSupport.stop(); logger.debug("Connection[" + index + "] is lost. Reconnecting to resume..."); connectionFactory.retryWhen(retry).timeout(resumeSessionDuration).subscribe(this); } }
Source:
public static void main(String[] args) throws Exception { try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Imputing example started."); IgniteCache<Integer, Person> persons = createCache(ignite); IgniteBiFunction<Integer, Person, Vector> featureExtractor = (k, v) -> VectorUtils.of( v.getAge(), v.getSalary() ); LearningEnvironmentBuilder envBuilder = LearningEnvironmentBuilder.defaultBuilder(); IgniteBiFunction<Integer, Person, Vector> preprocessor = new ImputerTrainer<Integer, Person>() .fit(envBuilder, ignite, persons, featureExtractor); try (SimpleDataset<?> dataset = DatasetFactory.createSimpleDataset(ignite, persons, envBuilder, preprocessor)) { new DatasetHelper(dataset).describe(); } System.out.println(">>> Imputing example completed."); } }

Target:
public static void main(String[] args) throws Exception { try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Imputing example started."); IgniteCache<Integer, Person> persons = createCache(ignite); IgniteBiFunction<Integer, Person, Vector> featureExtractor = (k, v) -> VectorUtils.of( v.getAge(), v.getSalary() ); IgniteBiFunction<Integer, Person, Vector> preprocessor = new ImputerTrainer<Integer, Person>() .fit(ignite, persons, featureExtractor); try (SimpleDataset<?> dataset = DatasetFactory.createSimpleDataset(ignite, persons, preprocessor)) { new DatasetHelper(dataset).describe(); } System.out.println(">>> Imputing example completed."); } }
Source:
public static void prepare_quality_profiles() { ImmutableMap<String, ImmutableMap<String, String>> rulesParameters = ImmutableMap.<String, ImmutableMap<String, String>>builder() .put( "IndentationCheck", ImmutableMap.of("indentationLevel", "4")) .put( "S1451", ImmutableMap.of( "headerFormat", "\n/*\n" + " * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.\n" + " * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.")) .build(); ImmutableSet<String> disabledRules = ImmutableSet.of( "UnusedPrivateMethod", "CallToDeprecatedMethod", "CycleBetweenPackages", "LeftCurlyBraceStartLineCheck" ); ProfileGenerator.generate(orchestrator, "java", "squid", rulesParameters, disabledRules); instantiateTemplateRule("S2253", "stringToCharArray", "className=\"java.lang.String\";methodName=\"toCharArray\""); instantiateTemplateRule("ArchitecturalConstraint", "doNotUseJavaIoFile", "fromClasses=\"**\";toClasses=\"java.io.File\""); instantiateTemplateRule("S124", "commentRegexTest", "regularExpression=\"(?i).*TODO\\(user\\).*\";message=\"bad user\""); instantiateTemplateRule("S3417", "doNotUseCommonsCollections", "dependencyName=\"commons-collections:*\";"); instantiateTemplateRule("S3417", "doNotUseJunitBefore4", "dependencyName=\"junit:junit\";version=\"*-3.9.9\""); instantiateTemplateRule("S3546", "S3546_Example", "constructors=\"org.sonar.api.server.ws.WebService.NewController\";closingMethods=\"org.sonar.api.server.ws.WebService.NewController#done\""); }

Target:
public static void prepare_quality_profiles() { ImmutableMap<String, ImmutableMap<String, String>> rulesParameters = ImmutableMap.<String, ImmutableMap<String, String>>builder() .put( "IndentationCheck", ImmutableMap.of("indentationLevel", "4")) .put( "S1451", ImmutableMap.of( "headerFormat", "\n/*\n" + " * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.\n" + " * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.")) .build(); ImmutableSet<String> disabledRules = ImmutableSet.of( "UnusedPrivateMethod", "CallToDeprecatedMethod", "CycleBetweenPackages", "LeftCurlyBraceStartLineCheck" ); ProfileGenerator.generate(orchestrator, "java", "squid", rulesParameters, disabledRules); instantiateTemplateRule("S2253", "stringToCharArray", "className=\"java.lang.String\";methodName=\"toCharArray\""); instantiateTemplateRule("ArchitecturalConstraint", "doNotUseJavaIoFile", "fromClasses=\"**\";toClasses=\"java.io.File\""); instantiateTemplateRule("S124", "commentRegexTest", "regularExpression=\"(?i).*TODO\\(user\\).*\";message=\"bad user\""); instantiateTemplateRule("S3417", "doNotUseCommonsCollections", "dependencyName=\"commons-collections:*\";"); instantiateTemplateRule("S3417", "doNotUseJunitBefore4", "dependencyName=\"junit:junit\";version=\"*-3.9.9\""); instantiateTemplateRule("S3546", "InstancesOfNewControllerClosedWithDone", "constructors=\"org.sonar.api.server.ws.WebService.NewController\";closingMethods=\"org.sonar.api.server.ws.WebService.NewController#done\""); }
Source:
private Rate createRate(SchedulePeriod period, Schedule paymentSchedule) { int effectiveRateCutOffDaysOffset = (isLastAccrualInPaymentPeriod(period, paymentSchedule) ? rateCutOffDays : 0); LocalDate startDate = index.calculateFixingFromEffective(period.getStartDate()); LocalDate endDate = index.calculateFixingFromEffective(period.getEndDate()); switch (accrualMethod) { case AVERAGED: return OvernightAveragedRate.of(index, startDate, endDate, effectiveRateCutOffDaysOffset); case COMPOUNDED: default: return OvernightCompoundedRate.of(index, startDate, endDate, effectiveRateCutOffDaysOffset); } }

Target:
private Rate createRate(SchedulePeriod period, Schedule paymentSchedule) { int effectiveRateCutOffDaysOffset = (isLastAccrualInPaymentPeriod(period, paymentSchedule) ? rateCutOffDays : 0); LocalDate startDate = index.calculateFixingFromEffective(period.getStartDate()); LocalDate endDate = index.calculateFixingFromEffective(period.getEndDate()); if (accrualMethod == OvernightAccrualMethod.AVERAGED) { return OvernightAveragedRate.of(index, startDate, endDate, effectiveRateCutOffDaysOffset); } else { return OvernightCompoundedRate.of(index, startDate, endDate, effectiveRateCutOffDaysOffset); } }
Source:
public void init() { super.init(); subscribe(master, RedisStore.HOSTNAME, new MasterAttributePropagator()); subscribe(master, RedisStore.ADDRESS, new MasterAttributePropagator()); subscribe(master, RedisStore.SUBNET_HOSTNAME, new MasterAttributePropagator()); subscribe(master, RedisStore.SUBNET_ADDRESS, new MasterAttributePropagator()); subscribe(master, RedisStore.REDIS_PORT, new MasterAttributePropagator()); }

Target:
public void init() { super.init(); RedisStore master = addChild(EntitySpec.create(RedisStore.class)); setAttribute(MASTER, master); DynamicCluster slaves = addChild(EntitySpec.create(DynamicCluster.class) .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(RedisSlave.class).configure(RedisSlave.MASTER, master))); setAttribute(SLAVES, slaves); addEnricher(Enrichers.builder() .propagating(RedisStore.HOSTNAME, RedisStore.ADDRESS, RedisStore.SUBNET_HOSTNAME, RedisStore.SUBNET_ADDRESS, RedisStore.REDIS_PORT) .from(master) .build()); }
Source:
public void activate() { logger.debug("activate"); }

Target:
public void activate() { }
Source:
private int computeHashCode() { int hash = getContig().hashCode(); hash = 31 * hash + getSource().hashCode(); hash = 31 * hash + getType().hashCode(); hash = 31 * hash + getStart(); hash = 31 * hash + getEnd(); hash = 31 * hash + getScore().hashCode(); hash = 31 * hash + getPhase(); hash = 31 * hash + getStrand().hashCode(); hash = 31 * hash + getAttributes().hashCode(); if (getId() != null) { hash = 31 * hash + getId().hashCode(); } if (getName() != null) { hash = 31 * hash + getName().hashCode(); } if (getAlias() != null) { hash = 31 * hash + getAlias().hashCode(); } return hash; }

Target:
private int computeHashCode() { int hash = getContig().hashCode(); hash = 31 * hash + getSource().hashCode(); hash = 31 * hash + getType().hashCode(); hash = 31 * hash + getStart(); hash = 31 * hash + getEnd(); hash = 31 * hash + Double.hashCode(getScore()); hash = 31 * hash + getPhase(); hash = 31 * hash + getStrand().hashCode(); hash = 31 * hash + getAttributes().hashCode(); if (getId() != null) { hash = 31 * hash + getId().hashCode(); } if (getName() != null) { hash = 31 * hash + getName().hashCode(); } if (getAlias() != null) { hash = 31 * hash + getAlias().hashCode(); } return hash; }
Source:
public Predicate<ChangeData> r05_byBranchOpenNext( @Named("P") final ProjectPredicate p, @Named("B") final BranchPredicate b, @Named("S") final SortKeyPredicate.Before s, @Named("L") final IntPredicate<ChangeData> l) { return new PaginatedSource(500, s.getValue(), l.intValue()) { @Override ResultSet<Change> scan(ChangeAccess a, String key, int limit) throws OrmException { return a.byBranchOpenNext( new Branch.NameKey(p.getValueKey(), b.getValue()), key, limit); } @Override public boolean match(ChangeData cd) throws OrmException { return cd.change(dbProvider).getStatus().isOpen() && p.match(cd) && b.match(cd) && s.match(cd); } }; }

Target:
public Predicate<ChangeData> r05_byBranchOpenNext( @Named("P") final ProjectPredicate p, @Named("B") final BranchPredicate b, @Named("S") final SortKeyPredicate.Before s, @Named("L") final IntPredicate<ChangeData> l) { return new PaginatedSource(500, s.getValue(), l.intValue()) { @Override ResultSet<Change> scan(ChangeAccess a, String key, int limit) throws OrmException { return a.byBranchOpenAll(new Branch.NameKey(p.getValueKey(), b .getValue())); } @Override public boolean match(ChangeData cd) throws OrmException { return cd.change(dbProvider).getStatus().isOpen() && p.match(cd) && b.match(cd) && s.match(cd); } }; }
Source:
public void onReceive(final Object message) throws Exception { final Class<?> klass = message.getClass(); final ActorRef self = self(); final ActorRef sender = sender(); if (Observe.class.equals(klass)) { observe(message); } else if (StopObserving.class.equals(klass)) { stopObserving(message); } else if (GetLastSmsRequest.class.equals(klass)) { sender.tell(last, self); } else if (SmsSessionAttribute.class.equals(klass)) { final SmsSessionAttribute attribute = (SmsSessionAttribute) message; attributes.put(attribute.name(), attribute.value()); Object record = attributes.get("record"); try { SmsMessage msg = (SmsMessage)record; logger.debug ("SmsSessionAttribute "+msg.getSid()); } catch (Exception e) { e.printStackTrace(); } if (record != null) { system.eventStream().publish(record); } } else if (SmsSessionRequest.class.equals(klass)) { outbound(message); } else if (message instanceof SipServletRequest) { inbound(message); } else if (message instanceof SipServletResponse) { response(message); } else if (message instanceof SmppInboundMessageEntity) { inbound(message); } }

Target:
public void onReceive(final Object message) throws Exception { final Class<?> klass = message.getClass(); final ActorRef self = self(); final ActorRef sender = sender(); if (Observe.class.equals(klass)) { observe(message); } else if (StopObserving.class.equals(klass)) { stopObserving(message); } else if (GetLastSmsRequest.class.equals(klass)) { sender.tell(last, self); } else if (SmsSessionAttribute.class.equals(klass)) { final SmsSessionAttribute attribute = (SmsSessionAttribute) message; attributes.put(attribute.name(), attribute.value()); Object record = attributes.get("record"); if (record != null) { system.eventStream().publish(record); } } else if (SmsSessionRequest.class.equals(klass)) { outbound(message); } else if (message instanceof SipServletRequest) { inbound(message); } else if (message instanceof SipServletResponse) { response(message); } else if (message instanceof SmppInboundMessageEntity) { inbound(message); } }
Source:
private void writeInterfaceCriteria(final XMLExtendedStreamWriter writer, final Property property, final boolean nested) throws XMLStreamException { final Element element = Element.forName(property.getName()); switch (element) { case INET_ADDRESS: writeInterfaceCriteria(writer, element, Attribute.VALUE, property.getValue(), nested); break; case LOOPBACK_ADDRESS: writeInterfaceCriteria(writer, element, Attribute.VALUE, property.getValue(), false); break; case LINK_LOCAL_ADDRESS: case LOOPBACK: case MULTICAST: case POINT_TO_POINT: case PUBLIC_ADDRESS: case SITE_LOCAL_ADDRESS: case UP: case VIRTUAL: { if (property.getValue().asBoolean(false)) { writer.writeEmptyElement(element.getLocalName()); } break; } case NIC: writeInterfaceCriteria(writer, element, Attribute.NAME, property.getValue(), nested); break; case NIC_MATCH: writeInterfaceCriteria(writer, element, Attribute.PATTERN, property.getValue(), nested); break; case SUBNET_MATCH: writeInterfaceCriteria(writer, element, Attribute.VALUE, property.getValue(), nested); break; case ANY: case NOT: if (nested) { break; } writer.writeStartElement(element.getLocalName()); writeInterfaceCriteria(writer, property.getValue(), true); writer.writeEndElement(); break; case NAME: break; case ANY_ADDRESS: break; default: { throw ControllerLogger.ROOT_LOGGER.unknownCriteriaInterfaceProperty(property.getName()); } } }

Target:
private void writeInterfaceCriteria(final XMLExtendedStreamWriter writer, final Property property, final boolean nested) throws XMLStreamException { final Element element = Element.forName(property.getName()); switch (element) { case INET_ADDRESS: writeInterfaceCriteria(writer, element, Attribute.VALUE, property.getValue(), nested); break; case LOOPBACK_ADDRESS: writeInterfaceCriteria(writer, element, Attribute.VALUE, property.getValue(), false); break; case LINK_LOCAL_ADDRESS: case LOOPBACK: case MULTICAST: case POINT_TO_POINT: case PUBLIC_ADDRESS: case SITE_LOCAL_ADDRESS: case UP: case VIRTUAL: { if (property.getValue().asBoolean(false)) { writer.writeEmptyElement(element.getLocalName()); } break; } case NIC: writeInterfaceCriteria(writer, element, Attribute.NAME, property.getValue(), nested); break; case NIC_MATCH: writeInterfaceCriteria(writer, element, Attribute.PATTERN, property.getValue(), nested); break; case SUBNET_MATCH: writeInterfaceCriteria(writer, element, Attribute.VALUE, property.getValue(), nested); break; case ANY: case NOT: if (nested) { break; } writer.writeStartElement(element.getLocalName()); writeInterfaceCriteria(writer, property.getValue(), true); writer.writeEndElement(); break; case NAME: break; case ANY_ADDRESS: assert property.getValue().asBoolean(false) == false; break; default: { throw ControllerLogger.ROOT_LOGGER.unknownCriteriaInterfaceProperty(property.getName()); } } }
Source:
public KeyMaterial materialize() throws IOException, InterruptedException { final KeyMaterial lhsMaterialized = lhs.materialize(); final KeyMaterial rhsMaterialized; try { rhsMaterialized = rhs.materialize(); } catch (Exception e) { lhsMaterialized.close(); if (e instanceof IOException) { throw (IOException) e; } else if (e instanceof InterruptedException) { throw (InterruptedException) e; } else { throw new IOException("Error materializing credentials.", e); } } EnvVars env = lhsMaterialized.env(); env.putAll(rhsMaterialized.env()); return new KeyMaterial(env) { @Override public void close() throws IOException { try { lhsMaterialized.close(); } finally { rhsMaterialized.close(); } } }; }

Target:
public KeyMaterial materialize() throws IOException, InterruptedException { KeyMaterial lhsMaterialized = lhs.materialize(); KeyMaterial rhsMaterialized = null; try { rhsMaterialized = rhs.materialize(); EnvVars env = lhsMaterialized.env(); env.putAll(rhsMaterialized.env()); return new CompositeKeyMaterial(env, lhsMaterialized, rhsMaterialized); } catch (Exception e) { try { lhsMaterialized.close(); if (e instanceof IOException) { throw (IOException) e; } else if (e instanceof InterruptedException) { throw (InterruptedException) e; } else { throw new IOException("Error materializing credentials.", e); } } finally { if (rhsMaterialized != null) { rhsMaterialized.close(); } } } }
Source:
public SiteRestRepository() { System.out.println("Repository initialized by Spring"); }

Target:
public SiteRestRepository() { }
Source:
private Collection<Map.Entry<String, String>> enrich( final Collection<Map.Entry<String, String>> headers, final Response rsp ) { final List<String> list = rsp.headers().get( this.scvh ); final Map<String, String> map = new ConcurrentHashMap<>(headers.size() + 1); for (final Map.Entry<String, String> entry : headers) { map.put(entry.getKey(), entry.getValue()); } map.put( this.cmch, list.iterator().next() ); return map.entrySet(); }

Target:
private Collection<Map.Entry<String, String>> enrich( final Collection<Map.Entry<String, String>> headers, final Response rsp ) { final Collection<String> list = rsp.headers().get( this.scvh ); final Map<String, String> map = new ConcurrentHashMap<>(headers.size() + 1); for (final Map.Entry<String, String> entry : headers) { map.put(entry.getKey(), entry.getValue()); } map.put( this.cmch, list.iterator().next() ); return map.entrySet(); }
Source:
private String getOutgoingConnectorKind() { TaskRepository repository = getOutgoingRepository(); if (repository != null) { return repository.getConnectorKind(); } else { return task.getConnectorKind(); } }

Target:
private String getOutgoingConnectorKind() { TaskRepository repository = getOutgoingRepository(); if (repository != null) { return repository.getConnectorKind(); } else if (task != null) { return task.getConnectorKind(); } return null; }
Source:
public boolean contains(final String name) { try { return !new JdkRequest(UriBuilder.fromUri(this.home).build()) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttopURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath(String.format("/page/stands/stand[name='%s']", name)) .isEmpty(); } catch (IOException ex) { throw new IllegalStateException(ex); } }

Target:
public boolean contains(final String name) { try { return !new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath(String.format("/page/stands/stand[name='%s']", name)) .isEmpty(); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
public void testLocationScriptDirConfigIsRespected() throws Exception { final String command = "if [[ \"$0\" == \"/var/tmp/\"* ]]; then true; else false; fi"; Map<String, Object> locationConfig = ImmutableMap.<String, Object>builder() .put(SshMachineLocation.SCRIPT_DIR.getName(), "/var/tmp") .build(); LocalhostMachineProvisioningLocation lhp = (LocalhostMachineProvisioningLocation) mgmt.getLocationRegistry().resolve("localhost", true, locationConfig).orNull(); SshMachineLocation sm = lhp.obtain(); int rc = sm.execScript("Test script directory execution", ImmutableList.of(command)); assertEquals(rc, 0); }

Target:
public void testLocationScriptDirConfigIsRespected() throws Exception { final String command = "if [[ \"$0\" == \"/var/tmp/\"* ]]; then true; else false; fi"; Map<String, Object> locationConfig = ImmutableMap.<String, Object>builder() .put(SshMachineLocation.SCRIPT_DIR.getName(), "/var/tmp") .build(); LocalhostMachineProvisioningLocation lhp = (LocalhostMachineProvisioningLocation) mgmt.getLocationRegistry().resolve("localhost", locationConfig); SshMachineLocation sm = lhp.obtain(); int rc = sm.execScript("Test script directory execution", ImmutableList.of(command)); assertEquals(rc, 0); }
Source:
private void updateDomainInProblem(final Guid vdsId, final String vdsName, final Set<Guid> domainsInProblems) { if (domainsInProblems != null) { ((EventQueue) EjbUtils.findBean(BeanType.EVENTQUEUE_MANAGER, BeanProxyType.LOCAL)).submitEventSync(new Event(_storagePoolId, null, EventType.DOMAINMONITORING), new Callable<EventResult>() { @Override public EventResult call() { EventResult result = new EventResult(true, EventType.DOMAINMONITORING); synchronized (_lockObject) { updateProblematicVdsData(vdsId, vdsName, domainsInProblems); } return result; } }); } }

Target:
private void updateDomainInProblem(final Guid vdsId, final String vdsName, final Set<Guid> domainsInProblems) { if (domainsInProblems != null) { ((EventQueue) EjbUtils.findBean(BeanType.EVENTQUEUE_MANAGER, BeanProxyType.LOCAL)).submitEventSync(new Event(_storagePoolId, null, vdsId, EventType.DOMAINMONITORING), new Callable<EventResult>() { @Override public EventResult call() { EventResult result = new EventResult(true, EventType.DOMAINMONITORING); updateProblematicVdsData(vdsId, vdsName, domainsInProblems); return result; } }); } }
Source:
public void nakedS3Get() throws IOException, SignatureException, XmlProcessingException, URISyntaxException, InterruptedException { final WritableByteChannel writeChannel = Channels.newChannel(new OutputStream() { @Override public void write(final int b) throws IOException { } }); final GetObjectResponse getObjectResponse = client.getObject( new GetObjectRequest(BUCKET_NAME, "beowulf.txt", writeChannel)); assertThat(getObjectResponse.getStatusCode(), is(200)); }

Target:
public void nakedS3Get() throws IOException, SignatureException, XmlProcessingException, URISyntaxException, InterruptedException { final WritableByteChannel writeChannel = new NullChannel(); final GetObjectResponse getObjectResponse = client.getObject( new GetObjectRequest(BUCKET_NAME, "beowulf.txt", writeChannel)); assertThat(getObjectResponse.getStatusCode(), is(200)); }
Source:
private void prepareAndCheckSender() { if (plainSender == null || plainSender.isClosed()) { Lock writeLock = senderLock.writeLock(); writeLock.lock(); try { if (plainSender == null || plainSender.isClosed()) { PlainStreamingSender newSender = new PlainStreamingSender(httpClientManager.getClientConfiguration(), plainSender); if (plainSender != null) { log.info("Prepare new sende {}r, close old {}", newSender, plainSender); plainSender.close(); } if (senderFuture != null) { senderFuture.cancel(true); } senderFuture = senderExecutor.submit(newSender); plainSender = newSender; } } finally { writeLock.unlock(); } } lastPingResult = check(); if (lastPingResult) { compareAndSendNewMarker(marker.get()); } }

Target:
private void prepareAndCheckSender() { if (plainSender == null || plainSender.isClosed()) { Lock writeLock = senderLock.writeLock(); writeLock.lock(); try { if (plainSender == null || plainSender.isClosed()) { PlainStreamingSender newSender = new PlainStreamingSender(httpClientManager.getClientConfiguration(), plainSender); if (plainSender != null) { log.info("Prepare new sender {}, close old {}", newSender, plainSender); plainSender.close(); } if (senderFuture != null) { senderFuture.cancel(true); } senderFuture = senderExecutor.submit(newSender); plainSender = newSender; } } finally { writeLock.unlock(); } } lastPingResult = check(); if (lastPingResult) { compareAndSendNewMarker(marker.get()); } }
Source:
public void enableTemperatureNotifications(Consumer<double[]> callback) { Consumer<byte[]> callbackTemp = valueBytes -> callback.accept(calculateTemperature(valueBytes)); BluetoothLeGattCharacteristic tempValueChar; try { tempValueChar = this.gattServices.get(TEMPERATURE) .findCharacteristic(TiSensorTagGatt.UUID_TEMP_SENSOR_VALUE); tempValueChar.enableValueNotifications(callbackTemp); } catch (KuraException e) { logger.error("Temperature notification enable failed", e); } }

Target:
public boolean enableTemperatureNotifications(Consumer<double[]> callback) { boolean result = false; Consumer<byte[]> callbackTemp = valueBytes -> callback.accept(calculateTemperature(valueBytes)); BluetoothLeGattCharacteristic tempValueChar; try { tempValueChar = this.gattServices.get(TEMPERATURE) .findCharacteristic(TiSensorTagGatt.UUID_TEMP_SENSOR_VALUE); tempValueChar.enableValueNotifications(callbackTemp); result = true; } catch (KuraException e) { logger.error("Temperature notification enable failed", e); } return result; }
Source:
private String parseReturnSentence() throws ParseException { int index = nextNonBlank(); if (index < 0 || !expression.startsWith(RETURN_SENTENCE, index)) { throw new ParseException(errorMessage(SENTENCE_EXPECTED_AT_POSITION_ERROR, RETURN_SENTENCE, parseIndex), parseIndex); } setParseIndex(index + RETURN_SENTENCE.length()); if (!isBlank(expression.charAt(parseIndex))) { throw new ParseException(errorMessage(BLANK_AFTER_RETURN_EXPECTED_ERROR, RETURN_SENTENCE), parseIndex); } return RETURN_SENTENCE; }

Target:
private void parseReturnSentence() throws ParseException { int index = nextNonBlank(); if (index < 0 || !expression.startsWith(RETURN_SENTENCE, index)) { throw new ParseException(errorMessage(SENTENCE_EXPECTED_AT_POSITION_ERROR, RETURN_SENTENCE, parseIndex), parseIndex); } setParseIndex(index + RETURN_SENTENCE.length()); if (isNoneBlank(expression.charAt(parseIndex))) { throw new ParseException(errorMessage(BLANK_AFTER_RETURN_EXPECTED_ERROR, RETURN_SENTENCE), parseIndex); } }
Source:
public void scriptBindingClosureVariableCall() throws Exception { assertEvaluate(new GenericWhitelist(), true, "def func = { 1 }; this.func2 = { 1 }; return func() == func2();\n"); }

Target:
public void scriptBindingClosureVariableCall() throws Exception { assertEvaluate(new GenericWhitelist(), true, "def func = { 1 }; this.func2 = { 1 }; return func() == func2();\n"); assertEvaluate(new GenericWhitelist(), true, "def func = { x -> x }; this.func2 = { x -> x }; return func(5) == func2(5);\n"); assertEvaluate(new GenericWhitelist(), true, "def func = { x, y -> x * y }; this.func2 = { x, y -> x * y }; return func(4, 5) == func2(4, 5);\n"); assertEvaluate(new GenericWhitelist(), true, "def func = { it }; this.func2 = { it }; return func(12) == func2(12);\n"); }
Source:
private KeyStore getSecretsStore() { final File secretStoreFile = createStoreIfNeeded(); try { final KeyStore keyStore = KeyStore.getInstance(SECRETS_STORE_KEYSTORE_TYPE); try (InputStream inputStream = Files.newInputStream(secretStoreFile.toPath())) { keyStore.load(inputStream, loadStorePassword()); } return keyStore; } catch (Exception e) { Logger.warn(this.getClass(), "unable to load secrets store " + SECRETS_STORE_FILE + ": " + e); throw new DotRuntimeException(e); } }

Target:
private KeyStore getSecretsStore() { final File secretStoreFile = createStoreIfNeeded(); try { final KeyStore keyStore = KeyStore.getInstance(SECRETS_STORE_KEYSTORE_TYPE); try (InputStream inputStream = Files.newInputStream(secretStoreFile.toPath())) { keyStore.load(inputStream, loadStorePassword()); } return keyStore; } catch (Exception e) { Logger.error(this.getClass(), "unable to load secrets store " + SECRETS_STORE_FILE + ": " + e); throw new DotRuntimeException(e); } }
Source:
protected void doStop() { this.receivingTask.cancel(true); }

Target:
protected void doStop() { this.receivingTask.cancel(true); this.mailReceiver.cancelPing(); }
Source:
public static Map<String, Path> scanIdentitiesFolder( Path dir, boolean strict, Collection<String> types, Transformer<String, String> idGenerator, LinkOption... options) throws IOException { if (GenericUtils.isEmpty(types)) { return Collections.emptyMap(); } if (!Files.exists(dir, options)) { return Collections.emptyMap(); } ValidateUtils.checkTrue(Files.isDirectory(dir, options), "Not a directory: %s", dir); Map<String, Path> paths = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (String t : types) { String fileName = idGenerator.transform(t); Path p = dir.resolve(fileName); if (!Files.exists(p, options)) { continue; } if (strict) { PosixFilePermission perm = KeyUtils.validateStrictKeyFilePermissions(p, options); if (perm != null) { continue; } String owner = KeyUtils.validateStrictKeyFileOwner(p, options); if (owner != null) { continue; } } Path prev = paths.put(t, p); ValidateUtils.checkTrue(prev == null, "Multiple mappings for type=%s", t); } return paths; }

Target:
public static Map<String, Path> scanIdentitiesFolder( Path dir, boolean strict, Collection<String> types, Transformer<String, String> idGenerator, LinkOption... options) throws IOException { if (GenericUtils.isEmpty(types)) { return Collections.emptyMap(); } if (!Files.exists(dir, options)) { return Collections.emptyMap(); } ValidateUtils.checkTrue(Files.isDirectory(dir, options), "Not a directory: %s", dir); Map<String, Path> paths = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (String t : types) { String fileName = idGenerator.transform(t); Path p = dir.resolve(fileName); if (!Files.exists(p, options)) { continue; } if (strict) { if (KeyUtils.validateStrictKeyFilePermissions(p, options) != null) { continue; } } Path prev = paths.put(t, p); ValidateUtils.checkTrue(prev == null, "Multiple mappings for type=%s", t); } return paths; }
Source:
protected void onBind() { Event<EventArgs> entityChangedEvent = getModel().getDiskViewType().getEntityChangedEvent(); entityChangedEvent.addListener(getView().getDiskTypeChangedEventListener()); Event<EventArgs> diskContentTypeEntityChangedEvent = getModel().getDiskContentType().getEntityChangedEvent(); diskContentTypeEntityChangedEvent.addListener(getView().getDiskContentTypeChangedEventListener()); super.onBind(); }

Target:
protected void onBind() { super.onBind(); Event<EventArgs> entityChangedEvent = getModel().getDiskViewType().getEntityChangedEvent(); entityChangedEvent.addListener(getView().getDiskTypeChangedEventListener()); Event<EventArgs> diskContentTypeEntityChangedEvent = getModel().getDiskContentType().getEntityChangedEvent(); diskContentTypeEntityChangedEvent.addListener(getView().getDiskContentTypeChangedEventListener()); }
Source:
void GetFirstReminderBoarder() { HealthDescriptor healthDiscStub = GenerateHealthStub.generateHealthDescriptor(true, 1, 0); StaticAnalysisRun paramStub = mock(StaticAnalysisRun.class); when(paramStub.getTotalSize()).thenReturn(1); HealthSeriesBuilder b = new HealthSeriesBuilder(healthDiscStub); List<Integer> first = b.computeSeries(paramStub); assertThat(first).containsExactly(1, 0, 0); assertThat(first.size()).isEqualTo(3); }

Target:
void GetFirstReminderBoarder() { HealthDescriptor healthDiscStub = generateHealthDescriptor(true, 1, 0); StaticAnalysisRun paramStub = mock(StaticAnalysisRun.class); when(paramStub.getTotalSize()).thenReturn(1); HealthSeriesBuilder b = new HealthSeriesBuilder(healthDiscStub); List<Integer> first = b.computeSeries(paramStub); assertThat(first).containsExactly(1, 0, 0); assertThat(first).hasSize(3); }
Source:
public void setSeltectedDevParams(List<VarDeclaration> selParams) { selectedDevParams = selParams; }

Target:
public void setSeltectedDevParams(List<VarDeclaration> selParams) { selectedDevParams = Collections.unmodifiableList(new ArrayList<>(selParams)); }
Source:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<T> bigtableResultScanner, final Span span) { return new AbstractClientScanner() { int rowCount = 0; @Override public Result next() throws IOException { T row = bigtableResultScanner.next(); if (row == null) { span.end(); return null; } rowCount++; return rowAdapter.adaptResponse(row); } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } finally { span.end(); } } public boolean renewLease() { throw new UnsupportedOperationException("renewLease"); } }; }

Target:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<T> bigtableResultScanner, final Span span) { return new AbstractClientScanner() { int rowCount = 0; @Override public Result next() throws IOException { T row = bigtableResultScanner.next(); if (row == null) { closeSpan(); return null; } rowCount++; return rowAdapter.adaptResponse(row); } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } finally { closeSpan(); } } protected void closeSpan() { try (AutoCloseable c = Tracing.getTracer().withSpan(span)) { span.end(); } catch (Exception e) { } } public boolean renewLease() { throw new UnsupportedOperationException("renewLease"); } }; }
Source:
public static final boolean isAllowedAttributeValue(final Object value) { if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof String || value instanceof Character || value instanceof Float || value instanceof byte[] || value instanceof short[] || value instanceof int[] || value instanceof float[]) { return true; } if (value instanceof Long) { return isValidUnsignedInteger((Long) value) || ((Long) value >= Integer.MIN_VALUE && (Long) value <= Integer.MAX_VALUE); } return false; }

Target:
protected static boolean isAllowedAttributeValue(final Object value) { if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof String || value instanceof Character || value instanceof Float || value instanceof byte[] || value instanceof short[] || value instanceof int[] || value instanceof float[]) { return true; } if (value instanceof Long) { return SAMUtils.isValidUnsignedIntegerAttribute((Long) value) || ((Long) value >= Integer.MIN_VALUE && (Long) value <= Integer.MAX_VALUE); } return false; }
Source:
public int saveAnnouncement(final Announcement announcement) { LOG.debug("save new announcement"); final SqlSession session = factory.openSession(); int saveId = -1; try { final AnnouncementsMapper mapper = session.getMapper(AnnouncementsMapper.class); saveId = mapper.saveAnnouncement(announcement); session.commit(); } catch (Exception e) { throw new RuntimeException("Failed to save announcement", e); } finally { session.close(); } return saveId; }

Target:
public int saveAnnouncement(final Announcement announcement) { int saveId = -1; try (final SqlSession session = factory.openSession()) { final AnnouncementsMapper mapper = session.getMapper(AnnouncementsMapper.class); saveId = mapper.saveAnnouncement(announcement); return saveId; } catch (Exception e) { throw new ServiceRuntimeException("Failed to save announcements", e); } }
Source:
public static Archive readCollection(final ContentRepoService service, String archiveName, RepoCollectionMetadata collection, Function<? super RepoObjectMetadata, String> entryNameExtractor) { Preconditions.checkNotNull(service); ImmutableMap.Builder<String, RepoVersion> objects = ImmutableMap.builder(); for (RepoObjectMetadata objectMetadata : collection.getObjects()) { RepoVersion version = objectMetadata.getVersion(); String entryName = entryNameExtractor.apply(objectMetadata); if (entryName == null) { Optional<String> downloadName = objectMetadata.getDownloadName(); if (downloadName.isPresent()) { entryName = downloadName.get(); } else { String message = "Could not find archive entry name for object: " + version; throw new RuntimeException(message); } } objects.put(entryName, version); } return new Archive(archiveName, objects.build()) { @Override protected InputStream openFileFrom(Object repoVersion) { try { return service.getRepoObject((RepoVersion) repoVersion); } catch(NotFoundException nfe) { throw new RestClientException(nfe.getMessage(), HttpStatus.NOT_FOUND); } } }; }

Target:
public static Archive readCollection(final ContentRepoService service, String archiveName, RepoCollectionMetadata collection, Function<? super RepoObjectMetadata, String> entryNameExtractor) { Preconditions.checkNotNull(service); ImmutableMap.Builder<String, RepoVersion> objects = ImmutableMap.builder(); for (RepoObjectMetadata objectMetadata : collection.getObjects()) { RepoVersion version = objectMetadata.getVersion(); String entryName = entryNameExtractor.apply(objectMetadata); if (entryName == null) { Optional<String> downloadName = objectMetadata.getDownloadName(); if (downloadName.isPresent()) { entryName = downloadName.get(); } else { String message = "Could not find archive entry name for object: " + version; throw new RuntimeException(message); } } objects.put(entryName, version); } return new Archive(archiveName, objects.build()) { @Override protected InputStream openFileFrom(Object repoVersion) { try { return service.getRepoObject((RepoVersion) repoVersion); } catch(NotFoundException nfe) { throw new RestClientException(String.format("The object with id: %s doesn't exist", repoVersion), HttpStatus.NOT_FOUND, nfe); } } }; }
Source:
public void checkInterrupted() { Thread thread = Thread.currentThread(); String message; if (isInterruptable() && (message = mInterruptMessage.get(thread)) != null) { thread.interrupt(); throw new RunInterruptedException(message); } }

Target:
public void checkInterrupted() { Thread thread = Thread.currentThread(); if (isInterruptable()) { String message = mInterruptMessage.remove(thread); if (message != null) { thread.interrupt(); throw new RunInterruptedException(message); } } }
Source:
public void workAllocationBoardAutoCreationTest() { assertEquals(panelControl.getNumberOfSavedBoards(), 0); click("Boards"); push(KeyCode.DOWN); push(KeyCode.DOWN); push(KeyCode.DOWN); push(KeyCode.DOWN); push(KeyCode.DOWN); push(KeyCode.RIGHT); push(KeyCode.DOWN); push(KeyCode.ENTER); PlatformEx.waitOnFxThread(); assertNodeExists(hasText("Work Allocation board has been created and loaded.\n\n" + "It is saved under the name \"Work Allocation\".")); click("OK"); assertEquals(panelControl.getNumberOfPanels(), 5); assertEquals(panelControl.getCurrentlySelectedPanel(), Optional.of(0)); assertEquals(panelControl.getNumberOfSavedBoards(), 1); List<PanelInfo> panelInfos = panelControl.getCurrentPanelInfos(); assertEquals(panelInfos.get(0).getPanelFilter(), "assignee:User 1 sort:milestone,status"); assertEquals(panelInfos.get(1).getPanelFilter(), "assignee:User 10 sort:milestone,status"); assertEquals(panelInfos.get(2).getPanelFilter(), "assignee:User 2 sort:milestone,status"); assertEquals(panelInfos.get(3).getPanelFilter(), "assignee:User 3 sort:milestone,status"); assertEquals(panelInfos.get(4).getPanelFilter(), "assignee:User 4 sort:milestone,status"); assertEquals(panelInfos.get(0).getPanelName(), "Work allocated to User 1"); assertEquals(panelInfos.get(1).getPanelName(), "Work allocated to User 10"); assertEquals(panelInfos.get(2).getPanelName(), "Work allocated to User 2"); assertEquals(panelInfos.get(3).getPanelName(), "Work allocated to User 3"); assertEquals(panelInfos.get(4).getPanelName(), "Work allocated to User 4"); }

Target:
public void workAllocationBoardAutoCreationTest() { assertEquals(panelControl.getNumberOfSavedBoards(), 0); clickMenu("Boards", "Auto-create", "Work Allocation"); PlatformEx.waitOnFxThread(); assertNodeExists(hasText("Work Allocation board has been created and loaded.\n\n" + "It is saved under the name \"Work Allocation\".")); click("OK"); assertEquals(panelControl.getNumberOfPanels(), 5); assertEquals(panelControl.getCurrentlySelectedPanel(), Optional.of(0)); assertEquals(panelControl.getNumberOfSavedBoards(), 1); List<PanelInfo> panelInfos = panelControl.getCurrentPanelInfos(); assertEquals(panelInfos.get(0).getPanelFilter(), "assignee:User 1 sort:milestone,status"); assertEquals(panelInfos.get(1).getPanelFilter(), "assignee:User 10 sort:milestone,status"); assertEquals(panelInfos.get(2).getPanelFilter(), "assignee:User 2 sort:milestone,status"); assertEquals(panelInfos.get(3).getPanelFilter(), "assignee:User 3 sort:milestone,status"); assertEquals(panelInfos.get(4).getPanelFilter(), "assignee:User 4 sort:milestone,status"); assertEquals(panelInfos.get(0).getPanelName(), "Work allocated to User 1"); assertEquals(panelInfos.get(1).getPanelName(), "Work allocated to User 10"); assertEquals(panelInfos.get(2).getPanelName(), "Work allocated to User 2"); assertEquals(panelInfos.get(3).getPanelName(), "Work allocated to User 3"); assertEquals(panelInfos.get(4).getPanelName(), "Work allocated to User 4"); }
Source:
private static InputStream propertiesStream(final String clientPropertiesFileName) throws FileNotFoundException { if (clientPropertiesFileName.startsWith(CLASSPATH_PREFIX)) { String resourcePath = clientPropertiesFileName.split(CLASSPATH_PREFIX)[1]; log.info("Load properties from classpath: {}", resourcePath); return AtsdUtil.class.getResourceAsStream(resourcePath); } else { File file = new File(clientPropertiesFileName); log.info("Load properties from file: {}", file.getAbsolutePath()); return new FileInputStream(file); } }

Target:
private static InputStream propertiesStream(final String clientPropertiesFileName) throws FileNotFoundException { if (clientPropertiesFileName.startsWith(CLASSPATH_PREFIX)) { String resourcePath = StringUtils.substringAfter(clientPropertiesFileName, CLASSPATH_PREFIX); log.info("Load properties from classpath: {}", resourcePath); return AtsdUtil.class.getResourceAsStream(resourcePath); } else { File file = new File(clientPropertiesFileName); log.info("Load properties from file: {}", file.getAbsolutePath()); return new FileInputStream(file); } }
Source:
public void onNodeMainExecutorServiceConnected(final NodeMainExecutorService nodeMainExecutorService) { RosActivity.this.nodeMainExecutorService = nodeMainExecutorService; nodeMainExecutorService.addNodeMainExecutorServiceListener(new NodeMainExecutorServiceListener() { @Override public void onShutdown(NodeMainExecutorService nodeMainExecutorService) { if (!RosActivity.this.isFinishing()) { RosActivity.this.finish(); } } }); Intent notificationIntent = new Intent(nodeMainExecutorService, NodeMainExecutorService.class); notificationIntent.setAction(NodeMainExecutorService.ACTION_SHUTDOWN); PendingIntent pendingIntent = PendingIntent.getService(nodeMainExecutorService, 0, notificationIntent, 0); nodeMainExecutorService.updateNotification(rosActivityComponent.getNotificationTitle(), "Tap to shutdown.",pendingIntent); }

Target:
public void onNodeMainExecutorServiceConnected(final NodeMainExecutorService nodeMainExecutorService) { RosActivity.this.nodeMainExecutorService = nodeMainExecutorService; nodeMainExecutorService.addNodeMainExecutorServiceListener(new NodeMainExecutorServiceListener() { @Override public void onShutdown(NodeMainExecutorService nodeMainExecutorService) { if (!RosActivity.this.isFinishing()) { RosActivity.this.finish(); } } }); nodeMainExecutorService.updateNotification(rosActivityComponent.getNotificationTitle(), "Tap to shutdown.", nodeMainExecutorService.getPendingIntentForShutdown()); }