auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void shouldAuthenticate() throws Exception { mockStatic( ForkedBooter.class ); doCallRealMethod() .when( ForkedBooter.class, "lookupDecoderFactory", anyString() ); try ( final ServerSocketChannel server = ServerSocketChannel.open() ) { if ( server.supportedOptions().contains( SO_REUSEADDR ) ) { server.setOption( SO_REUSEADDR, true ); } if ( server.supportedOptions().contains( TCP_NODELAY ) ) { server.setOption( TCP_NODELAY, true ); } <START> if ( server.supportedOptions().contains( SO_KEEPALIVE ) ) <END> { server.setOption( SO_KEEPALIVE, true ); } server.bind( new InetSocketAddress( 0 ) ); int serverPort = ( (InetSocketAddress) server.getLocalAddress() ).getPort(); final UUID uuid = UUID.randomUUID(); String url = "tcp://127.0.0.1:" + serverPort + "?auth=" + uuid; try ( final MasterProcessChannelProcessorFactory factory = invokeMethod( ForkedBooter.class, "lookupDecoderFactory", url ) ) { assertThat( factory ) .isInstanceOf( SurefireMasterProcessChannelProcessorFactory.class ); FutureTask<Boolean> task = new FutureTask<>( new Callable<Boolean>() { @Override public Boolean call() { try { SocketChannel channel = server.accept(); ByteBuffer bb = ByteBuffer.allocate( UUID_STRING_LENGTH ); int read = channel.read( bb ); assertThat( read ) .isEqualTo( UUID_STRING_LENGTH ); bb.flip(); assertThat( new String( bb.array(), US_ASCII ) ) .isEqualTo( uuid.toString() ); return true; } catch ( IOException e ) { return false; } } } ); Thread t = new Thread( task ); t.setDaemon( true ); t.start(); factory.connect( url ); try { task.get( 10, SECONDS ); } finally { factory.close(); } } } }</code><technical_language>IMO need options in a test</technical_language>

Target:
public void shouldAuthenticate() throws Exception { mockStatic( ForkedBooter.class ); doCallRealMethod() .when( ForkedBooter.class, "lookupDecoderFactory", anyString() ); try ( final ServerSocketChannel server = ServerSocketChannel.open() ) { server.bind( new InetSocketAddress( 0 ) ); int serverPort = ( (InetSocketAddress) server.getLocalAddress() ).getPort(); final String uuid = UUID.randomUUID().toString(); String url = "tcp://localhost:" + serverPort + "?sessionId=" + uuid; try ( final MasterProcessChannelProcessorFactory factory = invokeMethod( ForkedBooter.class, "lookupDecoderFactory", url ) ) { assertThat( factory ) .isInstanceOf( SurefireMasterProcessChannelProcessorFactory.class ); FutureTask<Boolean> task = new FutureTask<>( new Callable<Boolean>() { @Override public Boolean call() { try { SocketChannel channel = server.accept(); ByteBuffer bb = ByteBuffer.allocate( uuid.length() ); int read = channel.read( bb ); assertThat( read ) .isEqualTo( uuid.length() ); bb.flip(); assertThat( new String( bb.array(), US_ASCII ) ) .isEqualTo( uuid ); return true; } catch ( IOException e ) { return false; } } } ); Thread t = new Thread( task ); t.setDaemon( true ); t.start(); factory.connect( url ); try { task.get( 10, SECONDS ); } finally { factory.close(); } } } }
Source:
<code>public static Client getClient(ClientConfig config, String[] servers, int port) throws Exception { config.setTopologyChangeAware(true); final Client client = ClientFactory.createClient(config); for (String server : servers) { try { client.createConnection(server.trim(), port); break; <START> } catch(IOException e) { <END> } } if (client.getConnectedHostList().isEmpty()) { throw new Exception("Unable to connect to any servers."); } return client; }</code><technical_language>blocker: please put a space "catch"</technical_language>

Target:
public static Client getClient(ClientConfig config, String[] servers, int port) throws Exception { config.setTopologyChangeAware(true); final Client client = ClientFactory.createClient(config); for (String server : servers) { try { client.createConnection(server.trim(), port); } catch (IOException e) { } } if (client.getConnectedHostList().isEmpty()) { try { client.close(); } catch (Exception ignore) throw new Exception("Unable to connect to any servers."); } return client; }
Source:
<code>Iterable<? extends Annotatable> getAnnotatablesForTestClass( TestClass testClass) { <START> return asList(testClass); <END> }</code><technical_language>please Collections.singletonList() instead? combination of a static import passing parameter hard this Arrays.asList(T...)</technical_language>

Target:
Iterable<TestClass> getAnnotatablesForTestClass(TestClass testClass) { return singletonList(testClass); }
Source:
<code><START> private Member createSomeMember(final Vo createdVo) throws ExtendMembershipException, AlreadyMemberException, WrongAttributeValueException, WrongReferenceAttributeValueException, InternalErrorException, PrivilegeException { <END> final Candidate candidate = setUpCandidate(); final Member createdMember = perun.getMembersManagerBl().createMemberSync(sess, createdVo, candidate); return createdMember; }</code><technical_language>do Privilege Exception. calling Bl method need throw Privilege Exception all</technical_language>

Target:
private Member createSomeMember(final Vo createdVo) throws ExtendMembershipException, AlreadyMemberException, WrongAttributeValueException, WrongReferenceAttributeValueException, InternalErrorException { final Candidate candidate = setUpCandidate(); final Member createdMember = perun.getMembersManagerBl().createMemberSync(sess, createdVo, candidate); return createdMember; }
Source:
<code>public Model handleUnknownCatalogException(UnknownCatalogException e) { <START> LOG.warn(e.getMessage(), e); <END> return new LinkedHashModel(); }</code><technical_language>WARN for FAIR INFO for other unknown entities</technical_language>

Target:
public Model handleUnknownCatalogException(UnknownCatalogException e) { LOG.info(e.getMessage(), e); return new LinkedHashModel(); }
Source:
<code>public void testDeletePackageWithOneToMany() { populateUserPermissions(); runAsSystem( () -> { MetaDataService metadataService = dataService.getMeta(); Package package_ = packageFactory.create("package_onetomany").setLabel("package"); metadataService.upsertPackages(Stream.of(package_)); EntityType refEntityType = testHarness.createDynamicRefEntityType("entityType_onetomany", package_); EntityType entityType = testHarness.createDynamicTestEntityType( "refEntityType_onetomany", package_, refEntityType); Attribute oneToManyAttribute = attributeFactory .create("onetomany") .setName("onetomany") .setDataType(AttributeType.ONE_TO_MANY) .setRefEntity(entityType) .setMappedBy(entityType.getAttribute(ATTR_XREF)); refEntityType.addAttribute(oneToManyAttribute); metadataService.upsertEntityTypes(asList(refEntityType, entityType)); List<Entity> entities = createAndAdd(entityType, refEntityType, 5); Set<Entity> refEntities = entities.stream().map(e -> e.getEntity(ATTR_XREF)).collect(toSet()); assertPresent(entityType, entities); assertPresent(refEntityType, newArrayList(refEntities)); dataService.deleteById(PACKAGE, "package_onetomany"); assertEquals(metadataService.getPackage("package_onetomany"), Optional.empty()); <START> assertTrue(dataService.hasEntityType(entityType.getId())); <END> assertTrue(dataService.hasEntityType(refEntityType.getId())); entities.forEach(this::assertNotPresent); refEntities.forEach(this::assertNotPresent); }); }</code><technical_language>suggestion assertFalse(dataService.hasEntityType(entityType.getId()));</technical_language>

Target:
public void testDeletePackageWithOneToMany() { populateUserPermissions(); runAsSystem( () -> { MetaDataService metadataService = dataService.getMeta(); Package package_ = packageFactory.create("package_onetomany").setLabel("package"); metadataService.upsertPackages(Stream.of(package_)); EntityType refEntityType = testHarness.createDynamicRefEntityType("entityType_onetomany", package_); EntityType entityType = testHarness.createDynamicTestEntityType( "refEntityType_onetomany", package_, refEntityType); Attribute oneToManyAttribute = attributeFactory .create("onetomany") .setName("onetomany") .setDataType(AttributeType.ONE_TO_MANY) .setRefEntity(entityType) .setMappedBy(entityType.getAttribute(ATTR_XREF)); refEntityType.addAttribute(oneToManyAttribute); metadataService.upsertEntityTypes(asList(refEntityType, entityType)); List<Entity> entities = createAndAdd(entityType, refEntityType, 5); Set<Entity> refEntities = entities.stream().map(e -> e.getEntity(ATTR_XREF)).collect(toSet()); assertPresent(entityType, entities); assertPresent(refEntityType, newArrayList(refEntities)); dataService.deleteById(PACKAGE, "package_onetomany"); assertEquals(metadataService.getPackage("package_onetomany"), Optional.empty()); assertFalse(dataService.hasEntityType(entityType.getId())); assertFalse(dataService.hasEntityType(refEntityType.getId())); entities.forEach(this::assertNotPresent); refEntities.forEach(this::assertNotPresent); }); }
Source:
<code>public TypeMapper() { <START> boolean javaTime = false; <END> this.xmlJavaMapping = getXmlJavaMapping(javaTime); this.javaXmlMapping = getJavaXmlMapping(javaTime); }</code><technical_language>please call constructor this(null, null, false)</technical_language>

Target:
public TypeMapper() { this(null, null, false); }
Source:
<code>public void subscribe(final boolean subs) throws IOException { this.item.put( new AttributeUpdates().with(DyFriends.ATTR_SUBSCRIPTION, subs) ); <START> Logger.info(this, "bout #%d subscribe to \"%s\"", this.number(), subs); <END> }</code><technical_language>@erimerturk add info subscribed bout</technical_language>

Target:
public void subscribe(final boolean subs) throws IOException { this.item.put( new AttributeUpdates().with(DyFriends.ATTR_SUBSCRIPTION, subs) ); Logger.info( this, "bout #%d subscribe to \"%s\" by %s", this.number(), subs, this.self ); }
Source:
<code>public List<Put> getJobPuts() { <START> if (jobHistoryListener != null) <END> return jobHistoryListener.getJobPuts(); else return null; }</code><technical_language>nit: add braces for if/else statement</technical_language>

Target:
public List<Put> getJobPuts() { if (jobHistoryListener != null) { return jobHistoryListener.getJobPuts(); } else { return null; } }
Source:
<code>public static void parallel(String task, Iterable<Job> jobs) { IProgressMonitor group = getProgressGroup(); try { group.beginTask(task, size(jobs)); for (Job job : jobs) { job.setProgressGroup(group, 1); job.schedule(); } for (Job job : jobs) { <START> job.join(); <END> } } catch (InterruptedException e) { } finally { group.done(); } }</code><technical_language>join block caller</technical_language>

Target:
public static IProgressMonitor parallel(String task, Iterable<Job> jobs) { IProgressMonitor group = getProgressGroup(); try { group.beginTask(task, size(jobs)); for (Job job : jobs) { job.setProgressGroup(group, 1); job.schedule(); } for (Job job : jobs) { job.join(); } } catch (InterruptedException e) { } finally { group.done(); } return group; }
Source:
<code>public void onPackStatistics(PackWriter.Statistics stats) { <START> for (UploadPackLogger logger : loggers) { <END> logger.onPackStatistics(stats); } }</code><technical_language>curly braces</technical_language>

Target:
public void onPackStatistics(PackWriter.Statistics stats) { for (int i = 0; i < count; i++) loggers[i].onPackStatistics(stats); }
Source:
<code>public ClusterDataToSamConverter withTagPerMolecularIndex(final List<String> tagPerMolecularIndex) { <START> if (tagPerMolecularIndex != null) this.tagPerMolecularIndex = tagPerMolecularIndex; <END> return this; }</code><technical_language>this throw a IllegalArgumentException silently ignore a null passed in</technical_language>

Target:
public ClusterDataToSamConverter withTagPerMolecularIndex(final List<String> tagPerMolecularIndex) { if (tagPerMolecularIndex == null) throw new IllegalArgumentException("Null given for tagPerMolecularIndex"); this.tagPerMolecularIndex = tagPerMolecularIndex; return this; }
Source:
<code>public void done() { <START> Flow.get(this).setHistory(History.single(new LoginScreen(new User())), Flow.Direction.REPLACE); <END> }</code><technical_language>ChooseSignupScreen</technical_language>

Target:
public void done() { Flow.get(this).setHistory(History.single(new ChooseSignupScreen()), Flow.Direction.REPLACE); }
Source:
<code>protected GroovyCodeVisitor getTransformer(final ASTNode[] nodes, final SourceUnit sourceUnit) { <START> ClassCodeExpressionTransformer transformer = new ClassCodeExpressionTransformer() { <END> @Override protected SourceUnit getSourceUnit() { return sourceUnit; } @Override public Expression transform(final Expression exp) { if (exp instanceof ConstructorCallExpression) { MethodCallExpression call = exp.getNodeMetaData(MacroTransformation.class); if (call != null) { return call; } } return super.transform(exp); } }; return new TransformingCodeVisitor(transformer) { @Override public void visitConstructorCallExpression(final ConstructorCallExpression call) { ClassNode type = call.getType(); if (type instanceof InnerClassNode) { if (((InnerClassNode) type).isAnonymous() && MACROCLASS_TYPE.getNameWithoutPackage().equals(type.getSuperClass().getNameWithoutPackage())) { try { String source = convertInnerClassToSource(type); MethodCallExpression macroCall = callX( propX(classX(ClassHelper.makeWithoutCaching(MacroBuilder.class, false)), "INSTANCE"), MACRO_METHOD, args( constX(source), MacroGroovyMethods.buildSubstitutionMap(sourceUnit, type), classX(ClassHelper.make(ClassNode.class)) ) ); macroCall.setSpreadSafe(false); macroCall.setSafe(false); macroCall.setImplicitThis(false); call.putNodeMetaData(MacroTransformation.class, macroCall); List<ClassNode> classes = sourceUnit.getAST().getClasses(); for (Iterator<ClassNode> iterator = classes.iterator(); iterator.hasNext(); ) { final ClassNode aClass = iterator.next(); if (aClass == type || type == aClass.getOuterClass()) { iterator.remove(); } } } catch (Exception e) { e.printStackTrace(); } return; } } super.visitConstructorCallExpression(call); } private String convertInnerClassToSource(final ClassNode type) throws Exception { String source = GeneralUtils.convertASTToSource(sourceUnit.getSource(), type); source = source.substring(source.indexOf('{') + 1, source.lastIndexOf('}') - 1); return source; } }; }</code><technical_language>I this benefit a static class. clear interest in keeping a reference transformation itself</technical_language>

Target:
protected GroovyCodeVisitor getTransformer(final ASTNode[] nodes, final SourceUnit sourceUnit) { ClassCodeExpressionTransformer transformer = new MacroClassTransformer(sourceUnit); return new MacroClassTransformingCodeVisitor(transformer, sourceUnit); }
Source:
<code>public TaskConfig deserialize(JsonParser parser, DeserializationContext context) throws IOException { <START> LOGGER.debug("Deserializing the json into TaskConfig object"); <END> JsonNode jsonNode = parser.readValueAsTree(); TaskConfig config = new TaskConfig(); ObjectMapper mapper; ObjectCodec codec = parser.getCodec(); if (codec instanceof ObjectMapper) { mapper = (ObjectMapper) codec; } else { mapper = new ObjectMapper(); } if (jsonNode.has("steps")) { Iterator<JsonNode> steps = jsonNode.get("steps").getElements(); while (steps.hasNext()) { config.add(mapper.readValue(steps.next(), TaskConfigStep.class)); } } return config; }</code><technical_language>useful clutter logs</technical_language>

Target:
public TaskConfig deserialize(JsonParser parser, DeserializationContext context) throws IOException { JsonNode jsonNode = parser.readValueAsTree(); TaskConfig config = new TaskConfig(); ObjectMapper mapper; ObjectCodec codec = parser.getCodec(); if (codec instanceof ObjectMapper) { mapper = (ObjectMapper) codec; } else { mapper = new ObjectMapper(); } if (jsonNode.has("steps")) { Iterator<JsonNode> steps = jsonNode.get("steps").getElements(); while (steps.hasNext()) { config.add(mapper.readValue(steps.next(), TaskConfigStep.class)); } } return config; }
Source:
<code>public int compare(TimedAction action1, TimedAction action2) { if (action1.time == action2.time) { <START> return Long.valueOf(action1.count).compareTo(action2.count); <END> } else { return Long.valueOf(action1.time).compareTo(action2.time); } }</code><technical_language>turn a < b ? -1 : ((a > b) ? 1 : 0) instead</technical_language>

Target:
public int compare(TimedAction action1, TimedAction action2) { if (action1.time == action2.time) { return action1.count < action2.count ? -1 : ((action1.count > action2.count) ? 1 : 0); } else { return action1.time < action2.time ? -1 : ((action1.time > action2.time) ? 1 : 0); } }
Source:
<code><START> default double getDefaultValue() { <END> return this.shadow$getDefaultValue(); }</code><technical_language>If this is intrinsic, needs prefixed</technical_language>

Target:
default double api$getDefaultValue() { return this.shadow$getDefaultValue(); }
Source:
<code>public LocalRouteServiceConfigurator(String serverName, SupplierDependency<String> route) { <START> super(ServiceName.parse(WebDeploymentRequirement.LOCAL_ROUTE.resolve(serverName))); <END> this.route = route; }</code><technical_language><LINK_0></technical_language>

Target:
public LocalRouteServiceConfigurator(String serverName, SupplierDependency<String> route) { super(ServiceNameFactory.parseServiceName(WebDeploymentRequirement.LOCAL_ROUTE.resolve(serverName))); this.route = route; }
Source:
<code>public boolean aggregate(KeyType key) { final int keyHash = Groupers.hash(key); <START> final int grouperNumber = grouperNumberForKeyHash(keyHash); <END> final Grouper<KeyType> grouper = groupers.get(grouperNumber); synchronized (grouper) { return grouper.aggregate(key, keyHash); } }</code><technical_language>do return aggregate(key, keyHash)</technical_language>

Target:
public boolean aggregate(KeyType key) { return aggregate(key, Groupers.hash(key)); }
Source:
<code><START> public Repository getRepository(String storageId, <END> String repositoryId) throws JAXBException { String url = getContextBaseUrl() + "/api/configuration/strongbox/storages/" + storageId + "/" + repositoryId; WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); final Response response = resource.request(MediaType.APPLICATION_JSON).get(); Repository repository = null; if (response.getStatus() == 200) { repository = response.readEntity(Repository.class); } else { displayResponseError(response); } return repository; }</code><technical_language>I now. In this case, rename *Data classes *Dto...? do think</technical_language>

Target:
public RepositoryData getRepository(String storageId, String repositoryId) throws JAXBException { String url = getContextBaseUrl() + "/api/configuration/strongbox/storages/" + storageId + "/" + repositoryId; WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); final Response response = resource.request(MediaType.APPLICATION_JSON).get(); RepositoryData repository = null; if (response.getStatus() == 200) { repository = response.readEntity(RepositoryData.class); } else { displayResponseError(response); } return repository; }
Source:
<code>private String startPasswordDialog(String user) throws IOException { <START> log.debug("starting password dialog."); <END> BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println(String.format("Please enter a password for %s:",user)); return br.readLine(); }</code><technical_language>a loop</technical_language>

Target:
private String startPasswordDialog(String user) throws IOException { log.debug("starting password dialog."); System.out.println(String.format("Please enter a password for %s:",user)); return new String(System.console().readPassword()); }
Source:
<code>public SentenceSample read() throws IOException { StringBuilder sentencesString = new StringBuilder(); <START> List<Span> sentenceSpans = new LinkedList<Span>(); <END> String sentence; while ((sentence = samples.read()) != null) { int begin = sentencesString.length(); sentence = sentence.trim(); sentencesString.append(sentence); while (sentence != null && !endsWith(sentence,'.', '!', '?')) { sentence = samples.read(); } if (sentence != null) { int end = sentencesString.length(); sentenceSpans.add(new Span(begin, end)); sentencesString.append(' '); } if (sentenceSpans.size() > 24) { break; } } if (sentenceSpans.size() > 0) { return new SentenceSample(sentencesString.toString(), sentenceSpans.toArray(new Span[sentenceSpans.size()])); } else { return null; } }</code><technical_language>need of type RHS</technical_language>

Target:
public SentenceSample read() throws IOException { StringBuilder sentencesString = new StringBuilder(); List<Span> sentenceSpans = new LinkedList<>(); String sentence; for (int i = 0; i < 25 && (sentence = samples.read()) != null; i++) { int begin = sentencesString.length(); sentence = sentence.trim(); sentencesString.append(sentence); int end = sentencesString.length(); sentenceSpans.add(new Span(begin, end)); sentencesString.append(' '); } if (sentenceSpans.size() > 0) { return new SentenceSample(sentencesString.toString(), sentenceSpans.toArray(new Span[sentenceSpans.size()])); } return null; }
Source:
<code>public static ProducerInfo getProducerInfo(String tenantId, Span serverSpan, SpanCache spanCache) { String clientSpanId = SpanUniqueIdGenerator.getClientId(serverSpan.getId()); if (spanCache != null && clientSpanId != null) { Span clientSpan = spanCache.get(tenantId, clientSpanId); Span current = clientSpan; while (current != null && !current.serverSpan() && !current.topLevelSpan()) { current = spanCache.get(tenantId, current.getParentId()); } <START> if (current != null) { <END> ProducerInfo pi = new ProducerInfo(); pi.setDuration(clientSpan.getDuration()); pi.setTimestamp(clientSpan.getTimestamp() / 1000); pi.setFragmentId(clientSpan.getId()); List<Property> spanProperties = clientSpan.properties(); pi.getProperties().addAll(spanProperties); pi.setHostAddress(Span.ipv4Address(spanProperties)); pi.setId(clientSpan.getId()); pi.setMultipleConsumers(false); pi.setSourceOperation(current.operation()); if (current.serverSpan()) { pi.setSourceUri(current.url().getPath()); } else { pi.setSourceUri(Constants.URI_CLIENT_PREFIX + clientSpan.url().getPath()); } return pi; } } return null; }</code><technical_language>current do rootOrSeverSpan? please rename it</technical_language>

Target:
public static ProducerInfo getProducerInfo(String tenantId, Span serverSpan, SpanCache spanCache) { String clientSpanId = SpanUniqueIdGenerator.getClientId(serverSpan.getId()); if (spanCache != null && clientSpanId != null) { Span clientSpan = spanCache.get(tenantId, clientSpanId); Span rootOrServerSpan = findRootOrServerSpan(tenantId, clientSpan, spanCache); if (rootOrServerSpan != null) { ProducerInfo pi = new ProducerInfo(); pi.setDuration(clientSpan.getDuration()); pi.setTimestamp(clientSpan.getTimestamp() / 1000); pi.setFragmentId(clientSpan.getId()); List<Property> spanProperties = clientSpan.properties(); pi.getProperties().addAll(spanProperties); pi.setHostAddress(Span.ipv4Address(spanProperties)); pi.setId(clientSpan.getId()); pi.setMultipleConsumers(false); pi.setSourceOperation(rootOrServerSpan.operation()); if (rootOrServerSpan.serverSpan()) { pi.setSourceUri(rootOrServerSpan.url().getPath()); } else { pi.setSourceUri(Constants.URI_CLIENT_PREFIX + clientSpan.url().getPath()); } return pi; } } return null; }
Source:
<code>public void handle(Request request, Response response) throws Exception { try (DbSession dbSession = dbClient.openSession(false)) { OrganizationDto organization = qProfileWsSupport.getOrganizationByKey(dbSession, request.param(PARAM_ORGANIZATION)); <START> qProfileWsSupport.checkQProfileAdminPermission(organization); <END> CreateRequest createRequest = toRequest(request, organization); writeProtobuf(doHandle(dbSession, createRequest, request, organization), request, response); } }</code><technical_language>worth sharing this method checking permissions: 1. call checkLoggedIn call in method handle do SQL user is logged in 2. this leave method checkQProfileAdminPermission a single method call is useful factor</technical_language>

Target:
public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn(); try (DbSession dbSession = dbClient.openSession(false)) { OrganizationDto organization = qProfileWsSupport.getOrganizationByKey(dbSession, request.param(PARAM_ORGANIZATION)); userSession.checkPermission(ADMINISTER_QUALITY_PROFILES, organization); CreateRequest createRequest = toRequest(request, organization); writeProtobuf(doHandle(dbSession, createRequest, request, organization), request, response); } }
Source:
<code>public static AbstractReadExecutor getReadExecutor(SinglePartitionReadCommand command, ConsistencyLevel consistencyLevel, long queryStartNanoTime) throws UnavailableException { Keyspace keyspace = Keyspace.open(command.metadata().keyspace); ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(command.metadata().id); SpeculativeRetryPolicy retry = cfs.metadata().params.speculativeRetry; ReplicaPlan.ForTokenRead replicaPlan = ReplicaPlans.forRead(keyspace, command.partitionKey().getToken(), consistencyLevel, retry); if (retry.equals(NeverSpeculativeRetryPolicy.INSTANCE) || consistencyLevel == ConsistencyLevel.EACH_QUORUM) return new NeverSpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime, false); <START> if (replicaPlan.contact().size() == replicaPlan.candidates().size()) <END> { boolean recordFailedSpeculation = consistencyLevel != ConsistencyLevel.ALL; return new NeverSpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime, recordFailedSpeculation); } if (retry.equals(AlwaysSpeculativeRetryPolicy.INSTANCE)) return new AlwaysSpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime); else return new SpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime); }</code><technical_language>I modified >= in earlier version of this patch, decided a silly change rolled back. Pretty definition, if select contact candidates, <=. I guess insert assertion, some point drawn line verify do not. willing put assertion in, I feel is unnecessary, produce contact a call candidates.filter</technical_language>

Target:
public static AbstractReadExecutor getReadExecutor(SinglePartitionReadCommand command, ConsistencyLevel consistencyLevel, long queryStartNanoTime) throws UnavailableException { Keyspace keyspace = Keyspace.open(command.metadata().keyspace); ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(command.metadata().id); SpeculativeRetryPolicy retry = cfs.metadata().params.speculativeRetry; ReplicaPlan.ForTokenRead replicaPlan = ReplicaPlans.forRead(keyspace, command.partitionKey().getToken(), consistencyLevel, retry); if (retry.equals(NeverSpeculativeRetryPolicy.INSTANCE) || consistencyLevel == ConsistencyLevel.EACH_QUORUM) return new NeverSpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime, false); if (replicaPlan.contacts().size() == replicaPlan.candidates().size()) { boolean recordFailedSpeculation = consistencyLevel != ConsistencyLevel.ALL; return new NeverSpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime, recordFailedSpeculation); } if (retry.equals(AlwaysSpeculativeRetryPolicy.INSTANCE)) return new AlwaysSpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime); else return new SpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime); }
Source:
<code>public <R extends HttpRequest> R bindToRequest(R request, Object toBind) { <START> throw new IllegalStateException("CreateInstance is a POST operation"); <END> }</code><technical_language>Is this correct message</technical_language>

Target:
public <R extends HttpRequest> R bindToRequest(R request, Object toBind) { throw new IllegalStateException("Update launch configuration is a POST operation"); }
Source:
<code>private void checkStoreAvailability() { if (!enabled) return; <START> if (!isAvailable()) { <END> throw unavailableException; } }</code><technical_language>this check unavailableException if is null not? need managerAvailable variable then</technical_language>

Target:
private void checkStoreAvailability() { if (!enabled) return; if (unavailableException != null) { throw unavailableException; } }
Source:
<code>public void testCacheHint() throws InterruptedException { final AtomicInteger counter = new AtomicInteger(); Observable<String> o = Observable.create(new OnSubscribe<String>() { @Override public void call(final Subscriber<? super String> observer) { new Thread(new Runnable() { @Override public void run() { counter.incrementAndGet(); observer.onNext("one"); observer.onCompleted(); } }).start(); } }).cache(1); final CountDownLatch latch = new CountDownLatch(2); o.subscribe(new Action1<String>() { @Override public void call(String v) { assertEquals("one", v); latch.countDown(); } }); o.subscribe(new Action1<String>() { @Override public void call(String v) { assertEquals("one", v); latch.countDown(); } }); <START> if (!latch.await(1000, TimeUnit.MILLISECONDS)) { <END> fail("subscriptions did not receive values"); } assertEquals(1, counter.get()); }</code><technical_language>A trick I is assertTrue(latch.await(1000, MILLISECONDS)) behavior in lines</technical_language>

Target:
public void testCacheHint() throws InterruptedException { final AtomicInteger counter = new AtomicInteger(); Observable<String> o = Observable.create(new OnSubscribe<String>() { @Override public void call(final Subscriber<? super String> observer) { new Thread(new Runnable() { @Override public void run() { counter.incrementAndGet(); observer.onNext("one"); observer.onCompleted(); } }).start(); } }).cache(1); final CountDownLatch latch = new CountDownLatch(2); o.subscribe(new Action1<String>() { @Override public void call(String v) { assertEquals("one", v); latch.countDown(); } }); o.subscribe(new Action1<String>() { @Override public void call(String v) { assertEquals("one", v); latch.countDown(); } }); assertTrue("subscriptions did not receive values", latch.await(1000, TimeUnit.MILLISECONDS)); assertEquals(1, counter.get()); }
Source:
<code>public void onNext(final AggregationMessage message) { LOG.log(Level.INFO, "Received aggregation message {0}", message); final String slaveId = message.getSourceId().toString(); final String data = codec.decode(message.getData().array()); if (!slaveIds.contains(slaveId)) { slaveIds.add(slaveId); } if (slaveId.startsWith(RemoteEMDriver.CONTEXT_ID_PREFIX) && data.startsWith(RemoteEMDriver.TASK_ID_PREFIX) && slaveId.substring(RemoteEMDriver.CONTEXT_ID_PREFIX.length()) <START> .equals(data.substring(RemoteEMDriver.TASK_ID_PREFIX.length()))) { <END> msgCountDown.countDown(); } else { throw new RuntimeException(String.format("SlaveId %s should not send message with data %s.", slaveId, data)); } }</code><technical_language>extracting this complex checking logic a method (e.g., matches(slaveId, data))</technical_language>

Target:
public void onNext(final AggregationMessage message) { LOG.log(Level.INFO, "Received aggregation message {0}", message); final String workerId = message.getSourceId().toString(); final String data = codec.decode(message.getData().array()); if (!workerIds.contains(workerId)) { workerIds.add(workerId); } if (validateMsg(workerId, data)) { msgCountDown.countDown(); } else { throw new RuntimeException(String.format("WorkerId %s should not send message with data %s.", workerId, data)); } }
Source:
<code>public void testAssertingIteratorUsesLenientOrdering() { final List<SAMRecord> looselySorted = Arrays.asList(createRecord(1, 10), createRecord(1, 1), createRecord(2, 1)); final SAMRecordCoordinateComparator coordinateComparator = new SAMRecordCoordinateComparator(); final List<SAMRecord> sortedWithFileOrderComparator = looselySorted.stream() .sorted(coordinateComparator::fileOrderCompare) .collect(Collectors.toList()); Assert.assertEquals( <START> sortedWithFileOrderComparator, looselySorted); <END> final List<SAMRecord> sortedWithFullOrderComparator = looselySorted.stream() .sorted(coordinateComparator) .collect(Collectors.toList()); Assert.assertNotEquals(sortedWithFullOrderComparator, looselySorted); final SamReader.AssertingIterator iter = new SamReader.AssertingIterator( wrapInCloseableIterator(looselySorted)); iter.assertSorted(SAMFileHeader.SortOrder.coordinate); int count = 0; while (iter.hasNext()) { iter.next(); count++; } Assert.assertEquals(count, 3); }</code><technical_language>this is wrapped. Is a standard wrap column for htsjdk code</technical_language>

Target:
public void testAssertingIteratorUsesLenientOrdering() { final List<SAMRecord> looselySorted = Arrays.asList(createRecord(1, 10), createRecord(1, 1), createRecord(2, 1)); final SAMRecordCoordinateComparator coordinateComparator = new SAMRecordCoordinateComparator(); final List<SAMRecord> sortedWithFileOrderComparator = looselySorted.stream() .sorted(coordinateComparator::fileOrderCompare) .collect(Collectors.toList()); Assert.assertEquals(sortedWithFileOrderComparator, looselySorted); final List<SAMRecord> sortedWithFullOrderComparator = looselySorted.stream() .sorted(coordinateComparator) .collect(Collectors.toList()); Assert.assertNotEquals(sortedWithFullOrderComparator, looselySorted); final SamReader.AssertingIterator iter = new SamReader.AssertingIterator(new PeekableIterator<>(looselySorted.iterator())); iter.assertSorted(SAMFileHeader.SortOrder.coordinate); int count = 0; while (iter.hasNext()) { iter.next(); count++; } Assert.assertEquals(count, 3); }
Source:
<code>public void removeTuple(EntityKey key) { DBCollection collection = this.getCollection( key ); DBObject toDelete = this.getObject( key ); if ( toDelete != null ) { collection.remove( toDelete ); } else { <START> log.tracef( "Unable to remove %1$s (object not found)", key.getId().toString() ); <END> } }</code><technical_language>if need invoke method create trace message, in this case key.getId().toString(), need ad a if (log.isTraceEnabled()) { log.tracef ... performance loss significant</technical_language>

Target:
public void removeTuple(EntityKey key) { DBCollection collection = this.getCollection( key ); DBObject toDelete = this.getObject( key ); if ( toDelete != null ) { collection.remove( toDelete ); } else { if ( log.isTraceEnabled() ) { log.tracef( "Unable to remove %1$s (object not found)", key.getColumnValues()[0] ); } } }
Source:
<code>public void testLinkPropertiesWithWakeOnLanForActiveNetwork() throws Exception { mWiFiNetworkAgent = new TestNetworkAgentWrapper(TRANSPORT_WIFI); <START> LinkProperties wifiLp = new LinkProperties(); wifiLp.setInterfaceName(WIFI_WOL_IFNAME); wifiLp.setWakeOnLanEnabled(true); mWiFiNetworkAgent.connect(false); mWiFiNetworkAgent.sendLinkProperties(wifiLp); waitForIdle(); assertEquals(wifiLp, mService.getActiveLinkProperties()); <END> reset(mStatsService); }</code><technical_language>tests new code. updateLinkProperties() is supposed manage new property overwrite it. instead a LP WIFI_WOL_IFNAME interface this new property set, some other interface name cleared, of sendLinkProperties</technical_language>

Target:
public void testLinkPropertiesWithWakeOnLanForActiveNetwork() throws Exception { mWiFiNetworkAgent = new TestNetworkAgentWrapper(TRANSPORT_WIFI); LinkProperties wifiLp = new LinkProperties(); wifiLp.setInterfaceName(WIFI_WOL_IFNAME); wifiLp.setWakeOnLanEnabled(false); mWiFiNetworkAgent.connect(false); mWiFiNetworkAgent.sendLinkProperties(wifiLp); waitForIdle(); wifiLp.setWakeOnLanEnabled(true); assertEquals(wifiLp, mService.getActiveLinkProperties()); }
Source:
<code>public Iterator<String> call(Integer partition, Iterator<T> locatedRowIterator) throws Exception { taskContext = TaskContext.get(); if (taskContext != null && taskContext.attemptNumber() > 0) { LOG.trace("KS.c attempts "+taskContext.attemptNumber()); long entriesInKafka = KafkaUtils.messageCount(bootstrapServers, topicName, partition); LOG.trace("KS.c entries "+entriesInKafka); for (long i = 0; i < entriesInKafka; ++i) { locatedRowIterator.next(); } } Properties props = new Properties(); props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers); props.put(ProducerConfig.CLIENT_ID_CONFIG, "spark-producer-dss-ks-"+UUID.randomUUID() ); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, IntegerSerializer.class.getName()); <START> props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ExternalizableSerializer.class.getName()); <END> KafkaProducer<Integer, Externalizable> producer = new KafkaProducer<>(props); int count = 0 ; while (locatedRowIterator.hasNext()) { T lr = locatedRowIterator.next(); if(schema.isPresent() && lr instanceof ValueRow) { lr = ((T)new ValueRow((ValueRow)lr, schema)); } ProducerRecord<Integer, Externalizable> record = new ProducerRecord(topicName, count++, lr); producer.send(record); LOG.trace("KS.c sent "+partition.intValue()+" "+count+" "+lr); } LOG.trace("KS.c count "+partition.intValue()+" "+count); producer.close(); return Arrays.asList("OK").iterator(); }</code><technical_language>need a follow Jira improve serialization, relying Java's serialization is slow</technical_language>

Target:
public Iterator<String> call(Integer partition, Iterator<T> locatedRowIterator) throws Exception { taskContext = TaskContext.get(); if (taskContext != null && taskContext.attemptNumber() > 0) { LOG.trace("KS.c attempts "+taskContext.attemptNumber()); long entriesInKafka = KafkaUtils.messageCount(bootstrapServers, topicName, partition); LOG.trace("KS.c entries "+entriesInKafka); for (long i = 0; i < entriesInKafka; ++i) { locatedRowIterator.next(); } } Properties props = new Properties(); props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers); props.put(ProducerConfig.CLIENT_ID_CONFIG, "spark-producer-dss-ks-"+UUID.randomUUID() ); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, IntegerSerializer.class.getName()); props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ExternalizableSerializer.class.getName()); KafkaProducer<Integer, Externalizable> producer = new KafkaProducer<>(props); int count = 0 ; while (locatedRowIterator.hasNext()) { T lr = locatedRowIterator.next(); ProducerRecord<Integer, Externalizable> record = new ProducerRecord(topicName, count++, lr); producer.send(record); LOG.trace("KS.c sent "+partition.intValue()+" "+count+" "+lr); } LOG.trace("KS.c count "+partition.intValue()+" "+count); producer.close(); return Arrays.asList("OK").iterator(); }
Source:
<code>public static Block createTestBlock() { BlockBuilder blockBuilder = IPADDRESS.createBlockBuilder(null, 1); <START> Slice slice = Slices.wrappedBuffer(InetAddresses.forString("2001:db8::ff00:42:8328").getAddress()); <END> IPADDRESS.writeSlice(blockBuilder, slice); return blockBuilder.build(); }</code><technical_language>more values, 4-10. TestBigintType, TestVarcharType, TestBigintArray for ideas</technical_language>

Target:
public static Block createTestBlock() { BlockBuilder blockBuilder = IPADDRESS.createBlockBuilder(null, 1); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8320")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8321")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8322")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8323")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8324")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8325")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8326")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8327")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8328")); IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8329")); return blockBuilder.build(); }
Source:
<code>void updateSelectedOrganizationalUnit() { <START> libraryService.call( new RemoteCallback<OrganizationalUnitRepositoryInfo>() { <END> @Override public void callback( final OrganizationalUnitRepositoryInfo newInfo ) { refreshLibrary( newInfo ); } } ).getOrganizationalUnitRepositoryInfo( getViewSelectedOrganizationalUnit() ); }</code><technical_language>Lamda</technical_language>

Target:
void updateSelectedOrganizationalUnit() { libraryService.call( ( OrganizationalUnitRepositoryInfo newInfo ) -> refreshLibrary( newInfo ) ) .getOrganizationalUnitRepositoryInfo( getViewSelectedOrganizationalUnit() ); }
Source:
<code>ParsedDockerComposeFile(File composeFile) { Yaml yaml = new Yaml(); try (FileInputStream fileInputStream = FileUtils.openInputStream(composeFile)) { composeFileContent = yaml.load(fileInputStream); } catch (Exception e) { <START> throw new IllegalStateException("Unable to parse YAML file from " + composeFile.getAbsolutePath(), e); <END> } this.composeFileName = composeFile.getAbsolutePath(); parseAndValidate(); }</code><technical_language>this bee IllegalArgumentException</technical_language>

Target:
ParsedDockerComposeFile(File composeFile) { Yaml yaml = new Yaml(); try (FileInputStream fileInputStream = FileUtils.openInputStream(composeFile)) { composeFileContent = yaml.load(fileInputStream); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse YAML file from " + composeFile.getAbsolutePath(), e); } this.composeFileName = composeFile.getAbsolutePath(); parseAndValidate(); }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = getPermissionList(getParameters().getEvent()); if (hasHostExternalStatus()) { <START> permissionList.add(new PermissionSubject(new Guid(getParameters().getEvent().getVdsId().toString()), <END> VdcObjectType.VDS, ActionGroup.EDIT_HOST_CONFIGURATION)); } return permissionList; }</code><technical_language>this part: new Guid(getParameters().getEvent().getVdsId().toString()) replaced with: getParameters().getEvent().getVdsId()</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = getPermissionList(getParameters().getEvent()); if (hasHostExternalStatus()) { permissionList.add(new PermissionSubject(getParameters().getEvent().getVdsId(), VdcObjectType.VDS, ActionGroup.EDIT_HOST_CONFIGURATION)); } return permissionList; }
Source:
<code>public void testDeactivateStorageDomainWithRunningVmWithLeaseFails() { VmStatic vm = new VmStatic(); <START> vm.setName("myRunningVmWithLease"); <END> mockDomain(); when(vmStaticDao.getAllRunningWithLeaseOnForStorageDomain(domain.getId())).thenReturn(Collections.singletonList(vm)); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ERROR_CANNOT_DEACTIVATE_DOMAIN_WITH_RUNNING_VMS_WITH_LEASES); assertTrue(cmd.getReturnValue().getValidationMessages().contains(String.format("$vmNames %s", vm.getName()))); }</code><technical_language>personally test vms verify message contains - prefer</technical_language>

Target:
public void testDeactivateStorageDomainWithRunningVmWithLeaseFails() { VmStatic vm = new VmStatic(); vm.setName("myRunningVmWithLease"); mockDomain(); when(vmStaticDao.getAllRunningWithLeaseOnStorageDomain(domain.getId())).thenReturn(Collections.singletonList(vm)); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ERROR_CANNOT_DEACTIVATE_DOMAIN_WITH_RUNNING_VMS_WITH_LEASES); assertTrue(cmd.getReturnValue().getValidationMessages().contains(String.format("$vmNames %s", vm.getName()))); }
Source:
<code>public static Type merge( Type t1, Type t2 ) <START> { <END> NativeType nativeType = t1.nativeType(); Range cardinality = t1.cardinality(); Map< String, Type > subTypes = new HashMap< String, Type >(); for( Entry< String, Type > entry : t1.subTypes().entrySet()) { subTypes.put( entry.getKey(), entry.getValue() ); } if ( t2 != null ) { for( Entry< String, Type > entry : t2.subTypes().entrySet() ) { subTypes.put( entry.getKey(), entry.getValue() ); } } return create( nativeType, cardinality, false, subTypes ); }</code><technical_language>This method shuold reverted</technical_language>

Target:
public static Type merge( Type t1, Type t2 ) { final NativeType nativeType = t1.nativeType(); final Range cardinality = t1.cardinality(); final Map< String, Type > subTypes = new HashMap<>(); for( Entry< String, Type > entry : t1.subTypes().entrySet() ) { subTypes.put( entry.getKey(), entry.getValue() ); } if ( t2 != null ) { for( Entry< String, Type > entry : t2.subTypes().entrySet() ) { subTypes.put( entry.getKey(), entry.getValue() ); } } return create( nativeType, cardinality, false, subTypes ); }
Source:
<code>private boolean shouldExecute() { <START> if (!buildContext.isIncremental()) { <END> return true; } if (buildContext.hasDelta(new File(workingDirectory, "Gruntfile.js"))) { return true; } if (srcdir == null) { getLog().info("grunt goal doesn't have srcdir set: not checking for modified files"); return true; } Scanner scanner = buildContext.newScanner(srcdir); scanner.scan(); String[] includedFiles = scanner.getIncludedFiles(); return (includedFiles != null && includedFiles.length > 0); }</code><technical_language>add a NPE check for buildContext</technical_language>

Target:
private boolean shouldExecute() { if (buildContext == null || !buildContext.isIncremental()) { return true; } if (triggerfiles != null) { for (int i = 0; i < triggerfiles.length; i++) { if (buildContext.hasDelta(triggerfiles[i])) { return true; } } } else { if (buildContext.hasDelta(new File(workingDirectory, "Gruntfile.js"))) { return true; } } if (srcdir == null) { getLog().info("grunt goal doesn't have srcdir set: not checking for modified files"); return true; } Scanner scanner = buildContext.newScanner(srcdir); scanner.scan(); String[] includedFiles = scanner.getIncludedFiles(); return (includedFiles != null && includedFiles.length > 0); }
Source:
<code>private static long sleepAndGetNextBackoffTime(long sleepTime) { try { <START> Thread.sleep(sleepTime); <END> } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw Throwables.throwUncheckedException(e); } return Math.min(sleepTime * 2, MAX_SLEEP_TIME); }</code><technical_language>some logging here? expect happen if a single mutation happening a time, many, figuring out on</technical_language>

Target:
private static long sleepAndGetNextBackoffTime(long sleepTime) { try { long wait = sleepTime + (long) (sleepTime * getRandomJitter()); log.info("Disagreement on schema versions, waiting for ms and retrying.", SafeArg.of("backoff", wait)); Thread.sleep(wait); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw Throwables.throwUncheckedException(e); } return Math.min(sleepTime * 2, MAX_SLEEP_TIME); }
Source:
<code>public void registerAlias(PathElement address, AliasEntry alias) { RootInvocation rootInvocation = parent == null ? null : getRootInvocation(); AbstractResourceRegistration root = rootInvocation == null ? this : rootInvocation.root; PathAddress myaddr = rootInvocation == null ? PathAddress.EMPTY_ADDRESS : rootInvocation.pathAddress; <START> assert alias.getTarget() instanceof AbstractResourceRegistration : "Unknown alias type"; <END> PathAddress targetAddress = alias.getTarget().getPathAddress(); alias.setAddresses(targetAddress, myaddr.append(address)); AbstractResourceRegistration target = (AbstractResourceRegistration)root.getSubModel(alias.getTargetAddress()); if (target == null) { throw ControllerLogger.ROOT_LOGGER.aliasTargetResourceRegistrationNotFound(alias.getTargetAddress()); } registerAlias(address, alias, target); }</code><technical_language>forget remove this assertion</technical_language>

Target:
public void registerAlias(PathElement address, AliasEntry alias) { RootInvocation rootInvocation = parent == null ? null : getRootInvocation(); AbstractResourceRegistration root = rootInvocation == null ? this : rootInvocation.root; PathAddress myaddr = rootInvocation == null ? PathAddress.EMPTY_ADDRESS : rootInvocation.pathAddress; PathAddress targetAddress = alias.getTarget().getPathAddress(); alias.setAddresses(targetAddress, myaddr.append(address)); AbstractResourceRegistration target = (AbstractResourceRegistration)root.getSubModel(alias.getTargetAddress()); if (target == null) { throw ControllerLogger.ROOT_LOGGER.aliasTargetResourceRegistrationNotFound(alias.getTargetAddress()); } registerAlias(address, alias, target); }