auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String toString() { StringBuilder tableBuilder = new StringBuilder(); tableBuilder.append( "<script>$('head').append('<link rel=\"stylesheet\" type=\"text/css\" href=\"<LINK_1>\">');</script>"); tableBuilder.append( "<script src='<LINK_0>'></script>"); for (Entry<String, ModelUsageData> injectorEntry : report.getStatistics().entrySet()) { String header = injectorEntry.getKey(); String id = header.replaceAll(" > ", "-").replaceAll(" ", "_"); renderFlatTable(tableBuilder, id, header, injectorEntry.getValue()); renderTreeTable(tableBuilder, id, header , injectorEntry.getValue()); tableBuilder.append("<hr style='margin-bottom: 20px'>"); } tableBuilder.append("<hr><hr>"); tableBuilder.append( "<form action='' method='get'><input type='hidden' name='reset'><button type='submit'>RESET</button></form>"); tableBuilder.append( "<script>$(document).ready(function() {$(\"tr\").find(\"td:first\").find(\"span[style='padding-left: 0px;']\").remove();});</script>"); return tableBuilder.toString(); }

Target:
public String toString() { StringBuilder tableBuilder = new StringBuilder(); tableBuilder.append("<style type='text/css'>" + getResourceAsString("jquery.treetable.css") + "</style>"); for (Entry<String, ModelUsageData> injectorEntry : injectorsStatistics.entrySet()) { String header = injectorEntry.getKey(); String id = header.replaceAll(" > ", "-").replaceAll(" ", "_"); renderFlatTable(tableBuilder, id, header, injectorEntry.getValue()); renderTreeTable(tableBuilder, id, header, injectorEntry.getValue()); tableBuilder.append("<hr style='margin-bottom: 20px'>"); } tableBuilder.append("<hr><hr>"); tableBuilder.append( "<form action='' method='get'><input type='hidden' name='reset'><button type='submit'>RESET</button></form>"); tableBuilder.append( "<script>$(document).ready(function() {$(\"tr\").find(\"td:first\").find(\"span[style='padding-left: 0px;']\").remove();});</script>"); tableBuilder .append("<script type='text/javascript'>" + getResourceAsString("jquery.treetable.js") + "</script>"); return tableBuilder.toString(); }
Source:
private void writeInterfaceInheritedMembers(MemberSpecification memberSpecification, String title) throws IOException { Map<TypeDeclaration, List<Declaration>> inheritedMembers = interfaceInheritedMembers.get(memberSpecification); for (TypeDeclaration superInterface : inheritedMembers.keySet()) { List<Declaration> members = inheritedMembers.get(superInterface); if (members == null || members.isEmpty()) continue; makeSureInheritedSectionIsOpen(); open("table"); open("tr class='TableHeadingColor'"); open("th"); write(title); open("code"); linkRenderer().to(superInterface).write(); close("code"); close("th"); close("tr"); open("tr class='TableRowColor'"); open("td", "code"); boolean first = true; for (Declaration member : members) { if (!first) { write(", "); } else { first = false; } linkRenderer().to(member).write(); } close("code", "td", "tr", "table"); } }

Target:
private void writeInterfaceInheritedMembers(MemberSpecification memberSpecification, String title) throws IOException { Map<TypeDeclaration, List<Declaration>> inheritedMembers = interfaceInheritedMembers.get(memberSpecification); for (TypeDeclaration superInterface : inheritedMembers.keySet()) { List<Declaration> members = inheritedMembers.get(superInterface); if (members == null || members.isEmpty()) continue; makeSureInheritedSectionIsOpen(); open("table"); open("tr class='TableHeadingColor'"); open("th"); write(title); open("code"); linkToDeclaration(superInterface); close("code"); close("th"); close("tr"); open("tr class='TableRowColor'"); open("td", "code"); boolean first = true; for (Declaration member : members) { if (!first) { write(", "); } else { first = false; } linkToDeclaration(member); } close("code", "td", "tr", "table"); } }
Source:
public void happyPath() throws Exception { context.checking(new Expectations() {{ oneOf(catalog).isSupported(NOT_AVAILABLE.name()); will(returnValue(true)); never(validatorContext).buildConstraintViolationWithTemplate(with(any(String.class))); }}); boolean isValid = validator.isValid(NOT_AVAILABLE.name(), validatorContext); assertTrue(isValid); }

Target:
public void happyPath() throws Exception { context.checking(new Expectations() {{ oneOf(catalog).isSupported("NOT_AVAILABLE"); will(returnValue(true)); never(validatorContext).buildConstraintViolationWithTemplate(with(any(String.class))); }}); boolean isValid = validator.isValid("NOT_AVAILABLE", validatorContext); assertTrue(isValid); }
Source:
protected void cleanup(Work work, Exception exception) { try { work.cleanUp(true, exception); } catch (Exception e) { log.error("Fail to cleanup work: " + work.getId()); } }

Target:
protected void cleanup(Work work, Exception exception) { try { work.cleanUp(true, exception); } catch (Exception e) { log.error(work.getId() + ": Failure on cleanup", e); } }
Source:
private Repository init(URIish u) { InitCommand command = Git.init(); command.setBare(bare); if (directory == null) directory = new File(u.getHumanishName(), Constants.DOT_GIT); if (directory.exists() && directory.listFiles().length != 0) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, directory.getName())); } command.setDirectory(directory); return command.call().getRepository(); }

Target:
private Repository init(URIish u) { InitCommand command = Git.init(); command.setBare(bare); if (directory == null) directory = new File(u.getHumanishName(), Constants.DOT_GIT); if (directory.exists() && directory.listFiles().length != 0) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, directory.getName())); } else { } command.setDirectory(directory); return command.call().getRepository(); }
Source:
public SeenExchanges visitAggregation(AggregationNode node, Void context) { SeenExchanges seenExchanges = aggregatedSeenExchanges(node.getSources()); if (!node.getStep().equals(FINAL) || !node.hasEmptyGroupingSet()) { return NO_EXCHANGES_SEEN; } if (seenExchanges.remoteRepartitionExchange) { return NO_EXCHANGES_SEEN; } ActualProperties globalProperties = PropertyDerivations.derivePropertiesRecursively(node, metadata, session, types, parser); checkArgument(forceSingleNode || globalProperties.isSingleNode(), "Final aggregation with default value not separated from partial aggregation by remote hash exchange"); if (!seenExchanges.localRepartitionExchange) { StreamProperties localProperties = StreamPropertyDerivations.derivePropertiesRecursively(node, metadata, session, types, parser); checkArgument(localProperties.isSingleStream(), "Final aggregation with default value not separated from partial aggregation by local hash exchange"); } return NO_EXCHANGES_SEEN; }

Target:
public Optional<SeenExchanges> visitAggregation(AggregationNode node, Void context) { Optional<SeenExchanges> seenExchangesOptional = aggregatedSeenExchanges(node.getSources()); if (node.getStep().equals(PARTIAL)) { return Optional.of(new SeenExchanges(false, false)); } if (node.getStep().equals(INTERMEDIATE)) { return seenExchangesOptional; } if (!node.getStep().equals(FINAL) || !node.hasEmptyGroupingSet()) { return Optional.empty(); } checkState(seenExchangesOptional.isPresent(), "No partial aggregation below final aggregation"); SeenExchanges seenExchanges = seenExchangesOptional.get(); if (seenExchanges.remoteRepartitionExchange) { return Optional.empty(); } ActualProperties globalProperties = PropertyDerivations.derivePropertiesRecursively(node, metadata, session, types, parser); checkArgument(forceSingleNode || globalProperties.isSingleNode(), "Final aggregation with default value not separated from partial aggregation by remote hash exchange"); if (!seenExchanges.localRepartitionExchange) { StreamProperties localProperties = StreamPropertyDerivations.derivePropertiesRecursively(node, metadata, session, types, parser); checkArgument(localProperties.isSingleStream(), "Final aggregation with default value not separated from partial aggregation by local hash exchange"); } return Optional.empty(); }
Source:
public void write(URL url) throws IllegalArgumentException, IOException, InterruptedException { LockFile lockFile = new LockFile(file.toFile()); for (int retryCount = 0; retryCount < LOCK_ACQUIRE_MAX_RETRY_COUNT; retryCount++) { if (lockFile.lock()) { try { if (snapshot.isModified(file.toFile())) { LOG.debug( "Reading the underlying cookie file '{}' as it has been modified since the last access", file); Set<HttpCookie> cookiesFromFile = NetscapeCookieFile .read(file, creationDate); this.cookies = mergeCookies(cookiesFromFile, cookies); } write(file, cookies, url, creationDate); } finally { lockFile.unlock(); } return; } Thread.sleep(LOCK_ACQUIRE_RETRY_SLEEP); } throw new IOException( MessageFormat.format(JGitText.get().cannotLock, lockFile)); }

Target:
public void write(URL url) throws IllegalArgumentException, IOException, InterruptedException { LockFile lockFile = new LockFile(file.toFile()); for (int retryCount = 0; retryCount < LOCK_ACQUIRE_MAX_RETRY_COUNT; retryCount++) { if (lockFile.lock()) { try { if (snapshot.isModified(file.toFile())) { LOG.debug( "Reading the underlying cookie file '{}' as it has been modified since the last access", file); Set<HttpCookie> cookiesFromFile = NetscapeCookieFile .read(file, creationDate); this.cookies = mergeCookies(cookiesFromFile, cookies); } try (OutputStream output = new BufferedOutputStream( lockFile.getOutputStream()); Writer writer = new OutputStreamWriter(output, StandardCharsets.US_ASCII)) { write(writer, cookies, url, creationDate); } lockFile.commit(); } finally { lockFile.unlock(); } return; } Thread.sleep(LOCK_ACQUIRE_RETRY_SLEEP); } throw new IOException( MessageFormat.format(JGitText.get().cannotLock, lockFile)); }
Source:
public String handleCallBack(HttpMessage msg) throws ApiException { if (observer == null) { this.extension.addAllChannelObserver(this.getWebSocketObserver()); } try { LOG.debug("callback url = " + msg.getRequestHeader().getURI()); String connectionHeader = msg.getRequestHeader().getHeader("connection"); String upgradeHeader = msg.getRequestHeader().getHeader("upgrade"); if (connectionHeader != null && connectionHeader.toLowerCase().contains("upgrade")) { if (upgradeHeader != null && upgradeHeader.equalsIgnoreCase("websocket")) { msg.setResponseHeader(API.getDefaultResponseHeader("101 Switching Protocols", null, 0)); msg.getResponseHeader().setHeader("Content-Type", null); msg.getResponseHeader().setHeader("Connection", "Upgrade"); msg.getResponseHeader().setHeader("Upgrade", "websocket"); String secWebSocketKey = msg.getRequestHeader().getHeader("Sec-WebSocket-Key"); msg.getResponseHeader() .setHeader("Sec-WebSocket-Accept", WebSocketUtils.encodeWebSocketKey(secWebSocketKey)); } } return ""; } catch (Exception e) { throw new ApiException(ApiException.Type.URL_NOT_FOUND, msg.getRequestHeader().getURI().toString()); } }

Target:
public String handleCallBack(HttpMessage msg) throws ApiException { try { if (LOG.isDebugEnabled()) { LOG.debug("callback url = " + msg.getRequestHeader().getURI()); } String connectionHeader = msg.getRequestHeader().getHeader(HttpHeader.CONNECTION); String upgradeHeader = msg.getRequestHeader().getHeader("upgrade"); if (connectionHeader != null && connectionHeader.toLowerCase().contains("upgrade")) { if (upgradeHeader != null && upgradeHeader.equalsIgnoreCase("websocket")) { msg.setResponseHeader(API.getDefaultResponseHeader("101 Switching Protocols", null, 0)); msg.getResponseHeader().setHeader(HttpHeader.CONTENT_TYPE, null); msg.getResponseHeader().setHeader(HttpHeader.CONNECTION, "Upgrade"); msg.getResponseHeader().setHeader("Upgrade", "websocket"); String secWebSocketKey = msg.getRequestHeader().getHeader("Sec-WebSocket-Key"); msg.getResponseHeader() .setHeader("Sec-WebSocket-Accept", WebSocketUtils.encodeWebSocketKey(secWebSocketKey)); } } return ""; } catch (Exception e) { throw new ApiException(ApiException.Type.URL_NOT_FOUND, msg.getRequestHeader().getURI().toString()); } }
Source:
IndexTuningConfig computeTuningConfig() { IndexTuningConfig newTuningConfig = tuningConfig == null ? IndexTuningConfig.createDefault() : tuningConfig; newTuningConfig = newTuningConfig.withPartitionsSpec(newTuningConfig.getGivenOrDefaultPartitionsSpec()); if (newTuningConfig.getPartitionsSpec() instanceof DynamicPartitionsSpec) { final DynamicPartitionsSpec dynamicPartitionsSpec = (DynamicPartitionsSpec) newTuningConfig.getPartitionsSpec(); return newTuningConfig.withPartitionsSpec( new DynamicPartitionsSpec( dynamicPartitionsSpec.getMaxRowsPerSegment(), dynamicPartitionsSpec.getMaxTotalRowsOr(Long.MAX_VALUE) ) ); } else { return newTuningConfig; } }

Target:
IndexTuningConfig computeTuningConfig() { IndexTuningConfig newTuningConfig = tuningConfig == null ? IndexTuningConfig.createDefault() : tuningConfig; PartitionsSpec partitionsSpec = newTuningConfig.getGivenOrDefaultPartitionsSpec(); if (partitionsSpec instanceof DynamicPartitionsSpec) { final DynamicPartitionsSpec dynamicPartitionsSpec = (DynamicPartitionsSpec) partitionsSpec; partitionsSpec = new DynamicPartitionsSpec( dynamicPartitionsSpec.getMaxRowsPerSegment(), dynamicPartitionsSpec.getMaxTotalRowsOr(Long.MAX_VALUE) ); } return newTuningConfig.withPartitionsSpec(partitionsSpec); }
Source:
public void processEvent(Schema schema, MaxwellFilter filter, TableMapEvent event) { Long tableId = event.getTableId(); if ( !tableMapCache.containsKey(tableId) ) { String dbName = new String(event.getDatabaseName().getValue()); String tblName = new String(event.getTableName().getValue()); Database db = schema.findDatabase(dbName); if ( db == null ) throw new RuntimeException("Couldn't find database " + dbName); Table tbl = db.findTable(tblName); if ( filter != null && filter.isTableBlacklisted(tbl.getDatabase().getName(), tblName) ) blacklistedTableCache.put(tableId, tblName); else if ( tbl == null ) throw new RuntimeException("Couldn't find table " + tblName); else tableMapCache.put(tableId, tbl); } }

Target:
public void processEvent(Schema schema, MaxwellFilter filter, TableMapEvent event) { Long tableId = event.getTableId(); if ( !tableMapCache.containsKey(tableId) ) { String dbName = new String(event.getDatabaseName().getValue()); String tblName = new String(event.getTableName().getValue()); Database db = schema.findDatabase(dbName); if ( filter != null && filter.isTableBlacklisted(dbName, tblName) ) blacklistedTableCache.put(tableId, tblName); else if ( db == null ) throw new RuntimeException("Couldn't find database " + dbName); else { Table tbl = db.findTable(tblName); if (tbl == null) throw new RuntimeException("Couldn't find table " + tblName); else tableMapCache.put(tableId, tbl); } } }
Source:
public String putBlob(BlobProperties blobProperties, ByteBuffer userMetadata, InputStream blobStream) throws CoordinatorException { if (blobProperties == null) { throw new IllegalArgumentException("BlobProperties argument to put operation is null."); } if (userMetadata == null) { throw new IllegalArgumentException("User metadata argument to put operation is null."); } if (blobStream == null) { throw new IllegalArgumentException("Blob stream argument to put operation is null."); } OperationContext oc = getOperationContext(); PartitionId partitionId = getPartitionForPut(); BlobId blobId = new BlobId(partitionId); new PutOperation(datacenterName, connectionPool, requesterPool, oc, blobId, operationTimeoutMs, blobProperties, userMetadata, blobStream).execute(); return blobId.toString(); }

Target:
public String putBlob(BlobProperties blobProperties, ByteBuffer userMetadata, InputStream blobStream) throws CoordinatorException { if (blobProperties == null) { logger.info("Caller passed in null blobProperties."); throw new CoordinatorException("BlobProperties argument to put operation is null.", CoordinatorError.InvalidPutArgument); } if (userMetadata == null) { logger.info("Caller passed in null userMetadata."); throw new CoordinatorException("UserMetadata argument to put operation is null.", CoordinatorError.InvalidPutArgument); } if (blobStream == null) { logger.info("Caller passed in null blobStream."); throw new CoordinatorException("Blob stream argument to put operation is null.", CoordinatorError.InvalidPutArgument); } PartitionId partitionId = getPartitionForPut(); BlobId blobId = new BlobId(partitionId); PutOperation putOperation = new PutOperation(datacenterName, connectionPool, requesterPool, getOperationContext(), blobId, operationTimeoutMs, blobProperties, userMetadata, blobStream); putOperation.execute(); return blobId.toString(); }
Source:
private static boolean isSameSymbol(ExpressionTree tree, ExpressionTree other) { return Optional.ofNullable(symbol(tree)).map(s -> s.equals(symbol(other))).orElse(false); }

Target:
private static boolean isSameSymbol(ExpressionTree tree, ExpressionTree other) { Symbol s = symbol(tree); return s != null && s.equals(symbol(other)); }
Source:
public boolean changeState(@Selector String name, State state) { Assert.notNull(name, "'name' must not be null"); Assert.notNull(name, "'state' must not be null"); Binding<?> binding = BindingsEndpoint.this.locateBinding(name); if (binding != null) { switch (state) { case STARTED: binding.start(); return true; case STOPPED: binding.stop(); return true; case PAUSED: binding.pause(); return true; case RESUMED: binding.resume(); return true; default: break; } } return false; }

Target:
public void changeState(@Selector String name, State state) { Binding<?> binding = BindingsEndpoint.this.locateBinding(name); if (binding != null) { switch (state) { case STARTED: binding.start(); break; case STOPPED: binding.stop(); break; case PAUSED: binding.pause(); break; case RESUMED: binding.resume(); break; default: break; } } }
Source:
void scheduleMessage() { long sequenceNumberReturned =10; when(managementNode.schedule(any(ServiceBusMessage.class), any(Instant.class))) .thenReturn(just(sequenceNumberReturned)); StepVerifier.create(sender.scheduleMessage(mock(ServiceBusMessage.class), mock(Instant.class))) .expectNext(sequenceNumberReturned) .verifyComplete(); }

Target:
void scheduleMessage() { long sequenceNumberReturned = 10; Instant instant = mock(Instant.class); when(connection.createSendLink(eq(ENTITY_NAME), eq(ENTITY_NAME), any(AmqpRetryOptions.class))) .thenReturn(Mono.just(sendLink)); when(sendLink.getLinkSize()).thenReturn(Mono.just(MAX_MESSAGE_LENGTH_BYTES)); when(managementNode.schedule(eq(message), eq(instant), any(Integer.class))) .thenReturn(just(sequenceNumberReturned)); StepVerifier.create(sender.scheduleMessage(message, instant)) .expectNext(sequenceNumberReturned) .verifyComplete(); verify(managementNode).schedule(message, instant, MAX_MESSAGE_LENGTH_BYTES); }
Source:
protected void sanityCheckTableName(TableReference tableRef) { String tableName = tableRef.getQualifiedName(); Validate.isTrue( (!tableName.startsWith("_") && (tableName.contains("."))) && ALLOWED_TABLE_NAMES.matcher(tableName).matches() || AtlasDbConstants.hiddenTables.contains(tableRef) || tableName.startsWith(AtlasDbConstants.NAMESPACE_PREFIX), "invalid tableName: ", tableName); }

Target:
protected void sanityCheckTableName(TableReference tableRef) { String tableName = tableRef.getQualifiedName(); Validate.isTrue( (!tableName.startsWith("_") && tableName.contains(".") && ALLOWED_TABLE_NAMES.matcher(tableName).matches()) || AtlasDbConstants.hiddenTables.contains(tableRef) || tableName.startsWith(AtlasDbConstants.NAMESPACE_PREFIX), "invalid tableName: ", tableName); }
Source:
protected FastLocalCacheProvider( final PartyLineCacheProvider plCacheProvider, final Cache<String, String> nfsUsageCache, final PathGenerator pathGenerator, final FileEventManager fileEventManager, final TransferDecorator transferDecorator, final ExecutorService executor, final String nfsBaseDir ) { this.plCacheProvider = plCacheProvider; if ( nfsUsageCache != null ) { this.nfsOwnerCache = nfsUsageCache; } else { this.nfsOwnerCache = new NFSOwnerCacheProducer().getCacheMgr().getCache( NFSOwnerCacheProducer.CACHE_NAME ); } this.pathGenerator = pathGenerator; this.fileEventManager = fileEventManager; this.transferDecorator = transferDecorator; this.executor = executor; setNfsBaseDir( nfsBaseDir ); init(); }

Target:
protected FastLocalCacheProvider( final PartyLineCacheProvider plCacheProvider, final Cache<String, String> nfsUsageCache, final PathGenerator pathGenerator, final FileEventManager fileEventManager, final TransferDecorator transferDecorator, final ExecutorService executor, final String nfsBaseDir ) { this.plCacheProvider = plCacheProvider; this.nfsOwnerCache = nfsUsageCache; this.pathGenerator = pathGenerator; this.fileEventManager = fileEventManager; this.transferDecorator = transferDecorator; this.executor = executor; setNfsBaseDir( nfsBaseDir ); init(); }
Source:
public void testDenyReadWrites() throws InterruptedException { RemoteCacheManager cacheManager = ITestUtils.createCacheManager(server2); RemoteCache<Object, Object> cache = cacheManager.getCache(DENY_READ_WRITES_CACHE); String server1OwnedKey = getKeyOwnedByNode(server1Address, cacheManager, cache, 1); String server3OwnedKey = getKeyOwnedByNode(server3Address, cacheManager, cache, 1); partitionCluster(); RemoteCache<Object, Object> denyReadWritesCache1 = ITestUtils.createCacheManager(server1).getCache(DENY_READ_WRITES_CACHE); RemoteCache<Object, Object> denyReadWritesCache3 = ITestUtils.createCacheManager(server3).getCache(DENY_READ_WRITES_CACHE); denyReadWritesCache1.put(server1OwnedKey, "value"); assertEquals("value", denyReadWritesCache1.get(server1OwnedKey)); assertThrowsHotRodClientException(() -> denyReadWritesCache1.put(server3OwnedKey, "value")); assertThrowsHotRodClientException(() -> denyReadWritesCache1.get(server3OwnedKey)); denyReadWritesCache3.put(server3OwnedKey, "value"); assertEquals("value", denyReadWritesCache3.get(server3OwnedKey)); assertThrowsHotRodClientException(() -> denyReadWritesCache3.put(server1OwnedKey, "value")); assertThrowsHotRodClientException(() -> denyReadWritesCache3.get(server1OwnedKey)); healCluster(); }

Target:
public void testDenyReadWrites() throws InterruptedException { testCommonLogic(DENY_READ_WRITES_CACHE); }
Source:
public void shouldRemoveDiscountCode() throws Exception { withCartDiscountAndDiscountCode(sphereClient, discountCode -> { withTaxedFilledAndDiscountedCart(sphereClient, discountCode, cart -> { when(cartInSession.findCartId()).thenReturn(Optional.of(cart.getId())); final Map<String, String> bodyForm = new HashMap<>(); bodyForm.put("discountCodeId", discountCode.getId()); final Result result = route(new Http.RequestBuilder() .uri("/en/cart/discount/remove") .method(POST) .bodyForm(bodyForm)); assertThat(result.status()).isEqualTo(SEE_OTHER); return cart; }); return discountCode; }); }

Target:
public void shouldRemoveDiscountCode() throws Exception { withCartDiscountAndDiscountCode(sphereClient, discountCode -> { withTaxedFilledAndDiscountedCart(sphereClient, discountCode, cart -> { when(cartInSession.findCartId()).thenReturn(Optional.of(cart.getId())); final Map<String, String> bodyForm = new HashMap<>(); bodyForm.put("discountCodeId", discountCode.getId()); final Result result = route(new Http.RequestBuilder() .uri("/en/cart/discount/remove") .method(POST) .bodyForm(bodyForm)); assertThat(result.status()).isEqualTo(SEE_OTHER); assertThat(result.redirectLocation()) .isPresent() .hasValue("/en/cart"); return cart; }); return discountCode; }); }
Source:
public MethodDeclaration method(List<IExtendedModifier> modifiers, String methodName, List<SingleVariableDeclaration> parameters, Block block) { MethodDeclaration methodDeclaration = getAST().newMethodDeclaration(); methodDeclaration.modifiers().addAll(modifiers); methodDeclaration.setName(simpleName(methodName)); methodDeclaration.parameters().addAll(parameters); methodDeclaration.setBody(block); return methodDeclaration; }

Target:
public MethodDeclaration method(List<IExtendedModifier> modifiers, String methodName, List<SingleVariableDeclaration> parameters, Block block) { MethodDeclaration md = getAST().newMethodDeclaration(); md.modifiers().addAll(modifiers); md.setName(simpleName(methodName)); md.parameters().addAll(parameters); md.setBody(block); return md; }
Source:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { String a = node.getImage(); System.out.println(a); List<ASTMethodDeclaration> methods = node.findDescendantsOfType(ASTMethodDeclaration.class); System.out.println(methods); int count = 0; for (ASTMethodDeclaration method : methods) { System.out.println(method.getName()); if (method.getName().equals("getInstance")) { count++; } } if (count > 1) { System.out.println("error"); addViolation(data, node); } return super.visit(node, data); }

Target:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { List<ASTMethodDeclaration> methods = node.findDescendantsOfType(ASTMethodDeclaration.class); int count = 0; for (ASTMethodDeclaration method : methods) { if (method.getName().equals("getInstance")) { count++; if (count > 1) { addViolation(data, node); break; } } } return super.visit(node, data); }
Source:
@Nonnull private Set<AncestorSource> parseAncestorSourceList() throws DirectiveParseException { Set<AncestorSource> ancestorSources = new LinkedHashSet<>(); if (this.hasNext(DirectiveValueToken.class)) { boolean parseException = false; Token dv = this.advance(); if (trimRHSWS(dv.value).equalsIgnoreCase("'none'")) { ancestorSources.add(None.INSTANCE); return ancestorSources; } for (SubDirectiveValueToken subdv : splitByWSP(dv)) { try { ancestorSources.add(this.parseAncestorSource(subdv)); } catch (DirectiveValueParseException e) { parseException = true; } } if (parseException) { throw INVALID_ANCESTOR_SOURCE_LIST; } } return ancestorSources; }

Target:
@Nonnull private Set<AncestorSource> parseAncestorSourceList() throws DirectiveParseException { Set<AncestorSource> ancestorSources = new LinkedHashSet<>(); if (this.hasNext(DirectiveValueToken.class)) { boolean parseException = false; boolean seenNone = false; Token dv = this.advance(); for (SubDirectiveValueToken subdv : splitByWSP(dv)) { try { AncestorSource as = this.parseAncestorSource(subdv); if (seenNone || as == None.INSTANCE && !ancestorSources.isEmpty()) { this.error(subdv, "The 'none' keyword must not be combined with any other ancestor-source"); throw INVALID_ANCESTOR_SOURCE; } if (as == None.INSTANCE) { seenNone = true; } ancestorSources.add(as); } catch (DirectiveValueParseException e) { parseException = true; } } if (parseException) { throw INVALID_ANCESTOR_SOURCE_LIST; } } return ancestorSources; }
Source:
public static boolean isSafeInline(String contentType, String name) { boolean result = false; ReviewDb db = null; try { int index = name.lastIndexOf('.'); if (index >= 0) { String suffix = name.substring(index + 1); String[] allowedMimeTypes = GerritServer.getInstance().getGerritConfig() .getStringList("viewinline", null, "allow"); for (String allowedMimeType : allowedMimeTypes) { if (allowedMimeType.endsWith(suffix)) { return true; } } } } catch (OrmException e) { e.printStackTrace(); } catch (XsrfException e) { e.printStackTrace(); } return false; }

Target:
public static boolean isSafeInline(String contentType, String name) { try { int index = name.lastIndexOf('.'); if (index >= 0) { String suffix = name.substring(index + 1); String[] allowedMimeTypes = GerritServer.getInstance().getGerritConfig() .getStringList("viewinline", null, "allow"); for (String allowedMimeType : allowedMimeTypes) { if (allowedMimeType.endsWith(suffix)) { return true; } } } } catch (OrmException e) { e.printStackTrace(); } catch (XsrfException e) { e.printStackTrace(); } return false; }
Source:
public void testDDLwithPendingMutations() throws Exception { String tableName = generateUniqueName(); ensureTableCreated(getUrl(), tableName, TestUtil.PTSDB_NAME, null, null, null); Properties props = new Properties(); props.setProperty(QueryServices.PENDING_MUTATIONS_DDL_THROW_ATTRIB, Boolean.toString(true)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.setAutoCommit(false); PreparedStatement stmt = conn.prepareStatement("UPSERT INTO " + tableName + " (inst,host,\"DATE\") VALUES(?,'b',CURRENT_DATE())"); stmt.setString(1, "a"); stmt.execute(); String tableName2 = generateUniqueName(); String ddl = "CREATE TABLE " + tableName2 + " (V BIGINT PRIMARY KEY, K BIGINT)"; exceptionRule.expect(SQLException.class); exceptionRule.expectMessage( SQLExceptionCode.CANNOT_PERFORM_DDL_WITH_PENDING_MUTATIONS.getMessage()); conn.createStatement().execute(ddl); }

Target:
public void testDDLwithPendingMutations() throws Exception { String tableName = generateUniqueName(); ensureTableCreated(getUrl(), tableName, TestUtil.PTSDB_NAME, null, null, null); Properties props = new Properties(); props.setProperty(QueryServices.PENDING_MUTATIONS_DDL_THROW_ATTRIB, Boolean.toString(true)); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.setAutoCommit(false); PreparedStatement stmt = conn.prepareStatement("UPSERT INTO " + tableName + " (inst,host,\"DATE\") VALUES(?,'b',CURRENT_DATE())"); stmt.setString(1, "a"); stmt.execute(); String tableName2 = generateUniqueName(); String ddl = "CREATE TABLE " + tableName2 + " (V BIGINT PRIMARY KEY, K BIGINT)"; exceptionRule.expect(SQLException.class); exceptionRule.expectMessage( SQLExceptionCode.CANNOT_PERFORM_DDL_WITH_PENDING_MUTATIONS.getMessage()); conn.createStatement().execute(ddl); } }
Source:
IndexAccessors(IndexSchemaElement root) { string = root.field( "string", f -> f.asString().projectable( Projectable.YES ) ).createAccessor(); text = root.field( "text", f -> f.asString().analyzer( DefaultAnalysisDefinitions.ANALYZER_STANDARD.name ).projectable( Projectable.YES ) ).createAccessor(); integer = root.field( "integer", f -> f.asInteger().projectable( Projectable.YES ) ).createAccessor(); longNumber = root.field( "longNumber", f -> f.asLong().projectable( Projectable.YES ) ).createAccessor(); bool = root.field( "bool", f -> f.asBoolean().projectable( Projectable.YES ) ).createAccessor(); nativeBool = root.field( "nativeBool", f -> f.extension( LuceneExtension.get() ).asLuceneField( Boolean.class, (absoluteFieldPath, value, collector) -> { if ( value == null ) { return; } Integer intValue = value ? 1 : 0; collector.accept( new StoredField( absoluteFieldPath, intValue ) ); collector.accept( new NumericDocValuesField( absoluteFieldPath, intValue.longValue() ) ); collector.accept( new IntPoint( absoluteFieldPath, intValue ) ); }, field -> { Integer intValue = (Integer) field.numericValue(); return ( intValue > 0 ); } ) ) .createAccessor(); }

Target:
IndexAccessors(IndexSchemaElement root) { string = root.field( "string", f -> f.asString().projectable( Projectable.YES ) ).createAccessor(); text = root.field( "text", f -> f.asString().analyzer( DefaultAnalysisDefinitions.ANALYZER_STANDARD.name ).projectable( Projectable.YES ) ).createAccessor(); integer = root.field( "integer", f -> f.asInteger().projectable( Projectable.YES ) ).createAccessor(); longNumber = root.field( "longNumber", f -> f.asLong().projectable( Projectable.YES ) ).createAccessor(); bool = root.field( "bool", f -> f.asBoolean().projectable( Projectable.YES ) ).createAccessor(); }
Source:
private boolean processInQueue() { while (true) { long cursor = inSubSequence.next(); if (cursor < -1) { LockSupport.parkNanos(1); continue; } if (cursor < 0) { return false; } RetryHolder toRun; try { toRun = inQueue.get(cursor); } finally { inSubSequence.done(cursor); } RetryHolder copy = new RetryHolder(); copy.retry = toRun.retry; copy.waitStartTimestamp = toRun.waitStartTimestamp; copy.attempt = toRun.attempt; copy.lastRunTimestamp = toRun.lastRunTimestamp; copy.nextRunTimestamp = calculateNextTimestamp(toRun.attempt, toRun.waitStartTimestamp, toRun.lastRunTimestamp); nextRerun.add(copy); } }

Target:
private boolean processInQueue() { boolean any = false; while (true) { long cursor = inSubSequence.next(); if (cursor < -1) { continue; } if (cursor < 0) { return any; } Retry retry; try { RetryHolder toRun = inQueue.get(cursor); retry = toRun.retry; toRun.retry = null; } finally { inSubSequence.done(cursor); } retry.getAttemptDetails().nextRunTimestamp = calculateNextTimestamp(retry.getAttemptDetails()); nextRerun.add(retry); any = true; } }
Source:
public CompletionStage<Void> saveMany(Publisher<Map.Entry<K, V>> pairs) { return CompletableFuture.runAsync(() -> { Flowable<Map.Entry<K, V>> entryFlowable = Flowable.fromPublisher(pairs); entryFlowable.subscribe(e -> cache.putAsync(e.getKey(), e.getValue()), err -> new InfinispanException("KeyValueStore - Error in put many", err) ); }, cache.getRemoteCacheManager().getAsyncExecutorService()); }

Target:
public Publisher<WriteResult<K>> saveMany(Publisher<Map.Entry<K, V>> pairs) { UnicastProcessor<WriteResult<K>> unicastProcessor = UnicastProcessor.create(); Flowable<Map.Entry<K, V>> entryFlowable = Flowable.fromPublisher(pairs); entryFlowable.subscribe(e -> { cache.putAsync(e.getKey(), e.getValue()) .whenComplete((r, ex) -> unicastProcessor.onNext(new WriteResult<>(e.getKey(), ex))); }); return unicastProcessor; }
Source:
public String toJSONString() { if (!get(getNode(), getPropertyKeys(), NAME).isDefined()) { throw new IllegalArgumentException("Name of volume source is missing"); } return toJson(true); }

Target:
public String toJSONString() { if (StringUtils.isBlank(getName())) { throw new IllegalArgumentException("Name of volume source is missing"); } return toJson(true); }
Source:
public Set<FieldInfo> candidateRelationshipFields(String relationshipName, Direction relationshipDirection, boolean strict) { Set<FieldInfo> candidateFields = new HashSet<>(); for (FieldInfo fieldInfo : relationshipFields()) { String relationship = strict ? fieldInfo.relationshipTypeAnnotation() : fieldInfo.relationship(); if (relationshipName.equalsIgnoreCase(relationship)) { if (((fieldInfo.relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.INCOMING) || fieldInfo .relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.UNDIRECTED)) && (relationshipDirection.equals(Direction.INCOMING))) || (relationshipDirection.equals(Direction.OUTGOING) && !(fieldInfo .relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.INCOMING)))) { candidateFields.add(fieldInfo); } } } return candidateFields; }

Target:
public Set<FieldInfo> candidateRelationshipFields(String relationshipName, Direction relationshipDirection, boolean strict) { Set<FieldInfo> candidateFields = new HashSet<>(); for (FieldInfo fieldInfo : relationshipFields()) { String relationship = strict ? fieldInfo.relationshipTypeAnnotation() : fieldInfo.relationship(); if (relationshipName.equalsIgnoreCase(relationship)) { Direction declaredDirection = fieldInfo.relationshipDirectionOrDefault(Direction.OUTGOING); if (isActualDirectionCompatibleWithDeclaredDirection(relationshipDirection, declaredDirection)) { candidateFields.add(fieldInfo); } } } return candidateFields; }
Source:
public void stream() throws InterruptedException { currentState = new StreamCreatedState(this); switchState(new StartingState(this)); while (null != currentState) { final Runnable task = taskQueue.poll(1, TimeUnit.MINUTES); try { task.run(); } catch (final RuntimeException ex) { LOG.error("Failed to process task " + task + ", code carefully!", ex); switchState(new CleanupState(this, ex)); } } }

Target:
public void stream() throws InterruptedException { currentState = new State() { @Override public void onEnter() { } }; switchState(new StartingState()); while (null != currentState) { final Runnable task = taskQueue.poll(1, TimeUnit.MINUTES); try { task.run(); } catch (final SubscriptionWrappedException ex) { LOG.error("Failed to process task " + task + ", will rethrow original error", ex); switchState(new CleanupState(ex.getSourceException())); } catch (final RuntimeException ex) { LOG.error("Failed to process task " + task + ", code carefully!", ex); switchState(new CleanupState(ex)); } } }
Source:
public long restoreMessagesFromDeadLetterQueue(long[] messageIDs, String destinationQueueName) throws BrokerManagerAdminException { long unavailableMessageCount; try { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance().getQueueManagerService(); unavailableMessageCount = queueManagerService.restoreMessagesFromDeadLetterQueue(messageIDs, destinationQueueName); return unavailableMessageCount; } catch (QueueManagerException e) { String errorMessage = e.getMessage(); log.error(errorMessage, e); throw new BrokerManagerAdminException(errorMessage, e); } }

Target:
public long restoreMessagesFromDeadLetterQueue(long[] messageIDs, String destinationQueueName) throws BrokerManagerAdminException { try { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance().getQueueManagerService(); return queueManagerService.restoreMessagesFromDeadLetterQueue(messageIDs, destinationQueueName); } catch (QueueManagerException e) { String errorMessage = e.getMessage(); log.error(errorMessage, e); throw new BrokerManagerAdminException(errorMessage, e); } }
Source:
public void clear() { rwLock.writeLock().lock(); try { nodes = new TreeSet<>(nodeComparator); oldNodesCount = 0L; if (locNode != null) nodes.add(locNode); nodesMap = new HashMap<>(); if (locNode != null) nodesMap.put(locNode.id(), locNode); nodeOrder = 0; maxInternalOrder = locNode.internalOrder(); topVer = 0; minNodeVer = locNode.version(); } finally { rwLock.writeLock().unlock(); } }

Target:
public void clear() { rwLock.writeLock().lock(); try { notSyncClear(); } finally { rwLock.writeLock().unlock(); } }
Source:
private void promptForMultipleChoicePlay(int page, int startSura, int startAyah, List<Integer> startingSuraList) { ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.select_dialog_item); for (Integer integer : startingSuraList) { String suraName = quranInfo.getSuraName(this, integer, false); adapter.add(suraName); } if(startSura != startingSuraList.get(0)) { adapter.insert("Beginning of Page", 0); startingSuraList.add(0, startSura); } new AlertDialog.Builder(this) .setTitle("Where do you want to listen from?") .setAdapter(adapter, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { if(i == 0) playFromAyah(page, startSura, startAyah); else playFromAyah(page, startingSuraList.get(i), 1); } }) .create().show(); }

Target:
private void promptForMultipleChoicePlay(int page, int startSura, int startAyah, List<Integer> startingSuraList) { ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.select_dialog_item); for (Integer integer : startingSuraList) { String suraName = quranInfo.getSuraName(this, integer, false); adapter.add(suraName); } if(startSura != startingSuraList.get(0)) { adapter.insert(getString(R.string.starting_page_label), 0); startingSuraList.add(0, startSura); } AlertDialog.Builder builder = new AlertDialog.Builder(this) .setTitle(getString(R.string.playback_prompt_title)) .setAdapter(adapter, (dialog, i) -> { if (i == 0) { playFromAyah(page, startSura, startAyah); } else { playFromAyah(page, startingSuraList.get(i), 1); } dialog.dismiss(); promptDialog = null; }); promptDialog = builder.create(); promptDialog.show(); }
Source:
protected void updateOriginalTemplate(VmStatic vmStatic) { vmStatic.setOriginalTemplateGuid(getParameters().getVmStaticData().getOriginalTemplateGuid()); vmStatic.setOriginalTemplateName(getParameters().getVmStaticData().getOriginalTemplateName()); }

Target:
protected void updateOriginalTemplate(VmStatic vmStatic) { }
Source:
public void loggedInUserCanVoteOnceInPollOnMobile() { Poll poll = new PostsListPage().open().getPost().clickNthPostWithPoll(0).getPoll(); Assert.assertTrue(poll.getAnswersRadioButtonsList().size() > 0); poll.clickNthAnswer(0); poll.clickNthAnswer(1); poll.clickVoteButton(); Assert.assertTrue(poll.isChosenResultBarDisplayed()); Assert.assertTrue(poll.getBarResultsList().size() > 0); Assert.assertTrue(poll.isAlreadyVotedMessageVisible()); }

Target:
public void loggedInUserCanVoteOnceInPollOnMobile() { Poll poll = new PostsListPage().open().getPost().clickNthPostWithPoll(0).getPoll(); Assert.assertTrue(poll.getAnswersRadioButtonsList().size() > 0); poll.clickNthAnswer(0); poll.clickVoteButton(); Assert.assertTrue(poll.isChosenResultBarDisplayed()); Assert.assertTrue(poll.getBarResultsList().size() > 0); Assert.assertTrue(poll.isAlreadyVotedMessageVisible()); }
Source:
public String toString() { return createToString(this, map( "dataProviderSettings", getDataProviderSettings(), "steps", getSteps() ), super.toString()); }

Target:
public String toString() { return createToString(this, map( "dataProviderSettings", getDataProviderSettings(), "visualizationSettings", getVisualizationSettings(), "steps", getSteps() ), super.toString()); }
Source:
public static SAMLInspectionResult inspectMessage(HttpMessage message) { for (HtmlParameter parameter : message.getUrlParams()) { if (isSAMLParameter(parameter)) { return new SAMLInspectionResult(true, parameter); } } for (HtmlParameter parameter : message.getFormParams()) { if (isSAMLParameter(parameter)) { return new SAMLInspectionResult(true, parameter); } } return new SAMLInspectionResult(false, null); }

Target:
public static SAMLInspectionResult inspectMessage(HttpMessage message) { for (HtmlParameter parameter : message.getUrlParams()) { if (isSAMLParameter(parameter)) { return new SAMLInspectionResult(parameter); } } for (HtmlParameter parameter : message.getFormParams()) { if (isSAMLParameter(parameter)) { return new SAMLInspectionResult(parameter); } } return SAMLInspectionResult.NOT_SAML; }
Source:
public static <M> Window createWindow(AbstractViewController<M> viewBinder) { Assert.requireNonNull(viewBinder, "viewBinder"); return new DolphinWindow<M>(viewBinder); }

Target:
public static final <M> Window createWindow(AbstractViewController<M> viewBinder) { Assert.requireNonNull(viewBinder, "viewBinder"); return new DolphinWindow<M>(viewBinder); }
Source:
private boolean mustChangeAddress (int oldType, int newType) { return (oldType == VmInterfaceType.spaprVlan.getValue() && newType != VmInterfaceType.spaprVlan.getValue()) || (oldType != VmInterfaceType.spaprVlan.getValue() && newType == VmInterfaceType.spaprVlan.getValue()); }

Target:
private boolean mustChangeAddress (int oldType, int newType) { int spaprVlanType = VmInterfaceType.spaprVlan.getValue(); return oldType == spaprVlanType ^ newType == spaprVlanType; }
Source:
public void shouldParseVepOutputWithoutTranscript() { AnnotationLineMapper lineMapper = new AnnotationLineMapper(); VariantAnnotation variantAnnotation = lineMapper.mapLine(VepOutputContent.vepOutputContentWithOutTranscript, 0); List<ConsequenceType> consequenceTypes = variantAnnotation.getConsequenceTypes(); assertNotNull(consequenceTypes); assertTrue(consequenceTypes.size() == 1); ConsequenceType consequenceType = consequenceTypes.get(0); assertNotNull(consequenceType.getSoTerms()); assertNull(consequenceType.getcDnaPosition()); assertNull(consequenceType.getCdsPosition()); assertNull(consequenceType.getAaPosition()); assertNull(consequenceType.getAaChange()); assertNull(consequenceType.getCodon()); }

Target:
public void shouldParseVepOutputWithoutTranscript() { AnnotationLineMapper lineMapper = new AnnotationLineMapper(); VariantAnnotation variantAnnotation = lineMapper.mapLine(VepOutputContent.vepOutputContentWithOutTranscript, 0); List<ConsequenceType> consequenceTypes = variantAnnotation.getConsequenceTypes(); assertNotNull(consequenceTypes); assertEquals(1, consequenceTypes.size()); ConsequenceType consequenceType = consequenceTypes.get(0); assertNotNull(consequenceType.getSoTerms()); assertNull(consequenceType.getcDnaPosition()); assertNull(consequenceType.getCdsPosition()); assertNull(consequenceType.getAaPosition()); assertNull(consequenceType.getAaChange()); assertNull(consequenceType.getCodon()); }
Source:
public ZibaseBindingConfigReceiver(String[] configParameters) { super(configParameters); logger.debug("Item protocol : {}", this.getProtocol()); if (this.getProtocol().equals(ZbProtocol.ZWAVE.toString())) { logger.debug("Item is ZWAVE !"); this.isZWave = true; this.x10Id = this.getId().substring(1); } else { this.x10Id = this.getId(); } logger.debug("Item X10 id set to : {}", this.x10Id); }

Target:
public ZibaseBindingConfigReceiver(String[] configParameters) { super(configParameters); logger.debug("Item protocol : {}", this.getProtocol()); if (getProtocol().equals(ZbProtocol.ZWAVE.toString())) { logger.debug("Item is ZWAVE !"); isZWave = true; x10Id = getId().substring(1); } else { x10Id = getId(); } logger.debug("Item X10 id set to : {}", this.x10Id); }
Source:
public void handle(Request request, Response response) { long qualityGateId = request.mandatoryParamAsLong(QualityGatesWsParameters.PARAM_ID); try (DbSession dbSession = dbClient.openSession(false)) { QualityGateDto qualityGate = finder.getById(dbSession, qualityGateId); Optional<QualityGateDto> defaultQualityGate = finder.getDefault(dbSession); checkArgument(!defaultQualityGate.isPresent() || !defaultQualityGate.get().getId().equals(qualityGate.getId()), "The default quality gate cannot be removed"); wsSupport.checkCanEdit(qualityGate); dbClient.qualityGateDao().delete(qualityGate, dbSession); dbSession.commit(); response.noContent(); } }

Target:
public void handle(Request request, Response response) { long qualityGateId = request.mandatoryParamAsLong(QualityGatesWsParameters.PARAM_ID); try (DbSession dbSession = dbClient.openSession(false)) { OrganizationDto organization = wsSupport.getOrganization(dbSession, request); QGateWithOrgDto qualityGate = finder.getByOrganizationAndId(dbSession, organization, qualityGateId); Optional<QualityGateDto> defaultQualityGate = finder.getDefault(dbSession); checkArgument(!defaultQualityGate.isPresent() || !defaultQualityGate.get().getId().equals(qualityGate.getId()), "The default quality gate cannot be removed"); wsSupport.checkCanEdit(qualityGate); dbClient.qualityGateDao().delete(qualityGate, dbSession); dbSession.commit(); response.noContent(); } }
Source:
public void testEdges() throws TableNotFoundException { CloseableIterable<Edge> edges = graph.getEdges(); Assert.assertEquals(1, Iterables.size(edges)); EntityEdge actualEdge = (EntityEdge) Iterables.get(edges, 0); assertEntitiesEqual(edge, actualEdge.getEntity()); }

Target:
public void testEdges() throws Exception { CloseableIterable<Edge> edges = graph.getEdges(); Assert.assertEquals(1, Iterables.size(edges)); EntityEdge actualEdge = (EntityEdge) Iterables.get(edges, 0); assertEntitiesEqual(edge, actualEdge.getEntity()); }
Source:
public AggregateFunction getAggregateFunction() { if (_function instanceof AggregateFunction) return (AggregateFunction) _function; else return null; }

Target:
public AggregateFunction getAggregateFunction() { if (_function instanceof AggregateFunction) { return (AggregateFunction) _function; } else { return null; } }