auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected ActiveMQServer createServer(int port) throws Exception { final ActiveMQServer server = this.createServer(true, true); server.getConfiguration().getAcceptorConfigurations().clear(); server.getConfiguration().getAcceptorConfigurations().add(addAcceptorConfiguration(server, port)); server.getConfiguration().setName(BROKER_NAME); server.getConfiguration().setJournalDirectory(server.getConfiguration().getJournalDirectory() + port); server.getConfiguration().setBindingsDirectory(server.getConfiguration().getBindingsDirectory() + port); server.getConfiguration().setPagingDirectory(server.getConfiguration().getPagingDirectory() + port); server.getConfiguration().setJMXManagementEnabled(true); server.getConfiguration().setMessageExpiryScanPeriod(5000); <START> server.getConfiguration().setUseLegacyAMQPQueueNaming(false); <END> server.setMBeanServer(mBeanServer); addAdditionalAcceptors(server); configureAddressPolicy(server); configureBrokerSecurity(server); addConfiguration(server); server.start(); createAddressAndQueues(server); return server; }</code><technical_language>I tests override default this, means of tests testing default behaviour of broker. Explicit tests verify non-default behaviours more appropriate</technical_language>

Target:
protected ActiveMQServer createServer(int port) throws Exception { final ActiveMQServer server = this.createServer(true, true); server.getConfiguration().getAcceptorConfigurations().clear(); server.getConfiguration().getAcceptorConfigurations().add(addAcceptorConfiguration(server, port)); server.getConfiguration().setName(BROKER_NAME); server.getConfiguration().setJournalDirectory(server.getConfiguration().getJournalDirectory() + port); server.getConfiguration().setBindingsDirectory(server.getConfiguration().getBindingsDirectory() + port); server.getConfiguration().setPagingDirectory(server.getConfiguration().getPagingDirectory() + port); server.getConfiguration().setJMXManagementEnabled(true); server.getConfiguration().setMessageExpiryScanPeriod(5000); server.setMBeanServer(mBeanServer); addAdditionalAcceptors(server); configureAddressPolicy(server); configureBrokerSecurity(server); addConfiguration(server); server.start(); createAddressAndQueues(server); return server; }
Source:
<code>public Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) { <START> GlowBed bed = (GlowBed)block.getState(); <END> byte data = bed.getColor().getWoolData(); return Collections.singletonList(new ItemStack(Material.BED, 1, data)); }</code><technical_language>Add a space cast</technical_language>

Target:
public Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) { return Collections.singletonList(new ItemStack(Material.BED, 1, (((GlowBed) block.getState()).getColor().getWoolData()))); }
Source:
<code>public WindowedStream<Tuple.WindowedTuple<KeyValPair<String, List<CompletionCandidate>>>> compose( WindowedStream<CompletionCandidate> input) { TopNByKey topNByKey = new TopNByKey(); topNByKey.setN(candidatesPerPrefix); return input .<KeyValPair<String, CompletionCandidate>, WindowedStream<KeyValPair<String, CompletionCandidate>>>flatMap(new AllPrefixes(minPrefix, 3), name("Extract Prefixes")) .accumulateByKey(topNByKey, new Function.ToKeyValue<KeyValPair<String, CompletionCandidate>, String, CompletionCandidate>() { @Override public Tuple<KeyValPair<String, CompletionCandidate>> f(KeyValPair<String, CompletionCandidate> tuple) { <START> return new Tuple.WindowedTuple<>(Window.GlobalWindow.getInstance(), tuple); <END> } }, name("TopNByKey")); }</code><technical_language>this change</technical_language>

Target:
public WindowedStream<Tuple.WindowedTuple<KeyValPair<String, List<CompletionCandidate>>>> compose( WindowedStream<CompletionCandidate> input) { TopNByKey topNByKey = new TopNByKey(); topNByKey.setN(candidatesPerPrefix); return input .<KeyValPair<String, CompletionCandidate>, WindowedStream<KeyValPair<String, CompletionCandidate>>>flatMap(new AllPrefixes(minPrefix, 3), name("Extract Prefixes")) .accumulateByKey(topNByKey, new Function.ToKeyValue<KeyValPair<String, CompletionCandidate>, String, CompletionCandidate>() { @Override public Tuple<KeyValPair<String, CompletionCandidate>> f(KeyValPair<String, CompletionCandidate> tuple) { return new Tuple.WindowedTuple<>(Window.GlobalWindow.INSTANCE, tuple); } }, name("TopNByKey")); }
Source:
<code>public static boolean tryParse(URI keyUri, AtomicReference<KeyVaultKeyUriProperties> keyVaultUriPropertiesReference) { KeyVaultKeyUriProperties keyVaultUriProperties = null; String[] segments = getSegments(keyUri); if (!((segments.length == 3) && StringUtils.equalsIgnoreCase(segments[0], KeyVaultConstants.KeysSegment))) { return false; } try { keyVaultUriProperties = new KeyVaultKeyUriProperties(keyUri); keyVaultUriProperties.keyName = segments[1]; keyVaultUriProperties.keyVersion = segments[2]; keyVaultUriProperties.keyVaultUri = new URI(keyUri.getScheme(), keyUri.getAuthority(), null, null, null); keyVaultUriPropertiesReference.set(keyVaultUriProperties); } catch (URISyntaxException e) { <START> return false; <END> } return true; }</code><technical_language>Do need some sort of debug / warn error level logging</technical_language>

Target:
public static boolean tryParse(URI keyUri, AtomicReference<KeyVaultKeyUriProperties> keyVaultUriPropertiesReference) { KeyVaultKeyUriProperties keyVaultUriProperties = null; String[] segments = getSegments(keyUri); if (!((segments.length == 3) && StringUtils.equalsIgnoreCase(segments[0], KeyVaultConstants.KeysSegment))) { return false; } try { keyVaultUriProperties = new KeyVaultKeyUriProperties(keyUri); keyVaultUriProperties.keyName = segments[1]; keyVaultUriProperties.keyVersion = segments[2]; keyVaultUriProperties.keyVaultUri = new URI(keyUri.getScheme(), keyUri.getAuthority(), null, null, null); keyVaultUriPropertiesReference.set(keyVaultUriProperties); } catch (URISyntaxException e) { logger.error("failed to parse uri {}", keyUri, e); return false; } return true; }
Source:
<code>private void sendAndVerifyOperationRequest(RequestOrResponse request, ServerErrorCode expectedErrorCode, Boolean forceCheckOpReceived) throws InterruptedException, IOException { storageManager.resetStore(); RequestOrResponseType requestType = request.getRequestType(); Response response = sendRequestGetResponse(request, <START> requestType == RequestOrResponseType.GetRequest || requestType == RequestOrResponseType.ReplicaMetadataRequest <END> ? ServerErrorCode.No_Error : expectedErrorCode); if (expectedErrorCode.equals(ServerErrorCode.No_Error) || forceCheckOpReceived) { assertEquals("Operation received at the store not as expected", requestType, MockStorageManager.operationReceived); } if (requestType == RequestOrResponseType.GetRequest) { GetResponse getResponse = (GetResponse) response; for (PartitionResponseInfo info : getResponse.getPartitionResponseInfoList()) { assertEquals("Error code does not match expected", expectedErrorCode, info.getErrorCode()); } } else if (requestType == RequestOrResponseType.ReplicaMetadataRequest) { ReplicaMetadataResponse replicaMetadataResponse = (ReplicaMetadataResponse) response; for (ReplicaMetadataResponseInfo info : replicaMetadataResponse.getReplicaMetadataResponseInfoList()) { assertEquals("Error code does not match expected", expectedErrorCode, info.getError()); } } }</code><technical_language>code this statement slightly more readable? Response response = sendRequestGetResponse(request, EnumSet.of(RequestOrResponseType.GetRequest, RequestOrResponseType.ReplicaMetadataRequest).contains(requestType) ? ServerErrorCode.No_Error : expectedErrorCode);</technical_language>

Target:
private void sendAndVerifyOperationRequest(RequestOrResponse request, ServerErrorCode expectedErrorCode, Boolean forceCheckOpReceived) throws InterruptedException, IOException { storageManager.resetStore(); RequestOrResponseType requestType = request.getRequestType(); Response response = sendRequestGetResponse(request, EnumSet.of(RequestOrResponseType.GetRequest, RequestOrResponseType.ReplicaMetadataRequest).contains(requestType) ? ServerErrorCode.No_Error : expectedErrorCode); if (expectedErrorCode.equals(ServerErrorCode.No_Error) || forceCheckOpReceived) { assertEquals("Operation received at the store not as expected", requestType, MockStorageManager.operationReceived); } if (requestType == RequestOrResponseType.GetRequest) { GetResponse getResponse = (GetResponse) response; for (PartitionResponseInfo info : getResponse.getPartitionResponseInfoList()) { assertEquals("Error code does not match expected", expectedErrorCode, info.getErrorCode()); } } else if (requestType == RequestOrResponseType.ReplicaMetadataRequest) { ReplicaMetadataResponse replicaMetadataResponse = (ReplicaMetadataResponse) response; for (ReplicaMetadataResponseInfo info : replicaMetadataResponse.getReplicaMetadataResponseInfoList()) { assertEquals("Error code does not match expected", expectedErrorCode, info.getError()); } } }
Source:
<code>private static String lockName(Tree syntaxNode) { <START> String name = SyntaxTreeNameFinder.getName(syntaxNode, SyntaxTreeNameFinder.Option.MEMBER_SELECT_CHOOSE_EXPR); <END> return name == null ? "" : name; }</code><technical_language>This option handling is completely over-engineering for a pretty simple problem in opinion useless. check (L#110), method invocations variable (form var.lock()) detected. a lot of get variable name there..</technical_language>

Target:
private static String lockName(Tree syntaxNode) { if (syntaxNode.is(Tree.Kind.METHOD_INVOCATION)) { ExpressionTree methodSelect = ((MethodInvocationTree) syntaxNode).methodSelect(); return SyntaxTreeNameFinder.getName(methodSelect); } return SyntaxTreeNameFinder.getName(syntaxNode); }
Source:
<code>public int size() { try { <START> tryLock(); <END> return super.size(); } finally { unlock(); } }</code><technical_language>move tryLock() out of this try-block? finally try unlock a non-existing lock throw (another) exception</technical_language>

Target:
public int size() { tryLock(); try { return super.size(); } finally { unlock(); } }
Source:
<code>private EntityModelLabelEditor<Date> getInstanceOfDateEditor() { return new EntityModelLabelEditor<Date>(new AbstractRenderer<Date>(){ @Override public String render(Date entity) { if(entity == null) { return constants.unAvailablePropertyLabel(); } return GlusterRebalanceDateTimeRenderer.getLocalizedDateTimeFormat().format(entity); } }, new Parser<Date>() { @Override public Date parse(CharSequence text) throws ParseException { <START> if(text.toString().isEmpty() || text == null) { <END> return null; } else { return new Date(Date.parse(text.toString())); } } }); }</code><technical_language>text == null</technical_language>

Target:
private EntityModelLabelEditor<Date> getInstanceOfDateEditor() { return new EntityModelLabelEditor<Date>(new AbstractRenderer<Date>(){ @Override public String render(Date entity) { if(entity == null) { return constants.unAvailablePropertyLabel(); } return GlusterRebalanceDateTimeRenderer.getLocalizedDateTimeFormat().format(entity); } }, new Parser<Date>() { @Override public Date parse(CharSequence text) throws ParseException { if(text == null || text.toString().isEmpty()) { return null; } else { return new Date(Date.parse(text.toString())); } } }); }
Source:
<code>private static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) { Cursor cursor = null; final String column = "_data"; final String[] projection = { column }; try { cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null); if (cursor != null && cursor.moveToFirst()) { try { final int column_index = cursor.getColumnIndexOrThrow(column); return cursor.getString(column_index); } catch (IllegalArgumentException e) { <START> throw new NoDataColumnForUriException(); <END> } } } finally { if (cursor != null) cursor.close(); } return null; }</code><technical_language>This method declare throws this exception usages forced handle</technical_language>

Target:
private static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) throws NoDataColumnForUriException { Cursor cursor = null; final String column = "_data"; final String[] projection = { column }; try { cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null); if (cursor != null && cursor.moveToFirst()) { try { final int column_index = cursor.getColumnIndexOrThrow(column); return cursor.getString(column_index); } catch (IllegalArgumentException e) { throw new NoDataColumnForUriException(); } } } finally { if (cursor != null) cursor.close(); } return null; }
Source:
<code>public void test_addValidBudget_newBudgetIsAdded() throws JSONException { String BUDGET_NAME = "Valid Budget"; String BUDGET_AMOUNT = "12345.00"; long BUDGET_ID = -2; solo.enterText(nameField, BUDGET_NAME); solo.enterText(amountField, BUDGET_AMOUNT); solo.sleep(1000); JSONObject serverResponse = new JSONObject(); serverResponse.put("id", BUDGET_ID); testClient.setNextResponse(serverResponse, true); solo.clickOnButton("Add"); solo.sleep(1000); Budget b = Budget.getBudgetById(-2); assertTrue("There should be a budget with ID -2.", b != null); assertEquals("The name of the budget was wrong.", BUDGET_NAME, b.getName()); assertEquals("The amount of the budget was wrong.", (int) (Double.parseDouble(BUDGET_AMOUNT) * 100), b.getBudgetAmount()); <START> Budget.clearBudgets(); <END> }</code><technical_language>Clearing of budgets is done in setup this is redundant</technical_language>

Target:
public void test_addValidBudget_newBudgetIsAdded() throws JSONException { String BUDGET_NAME = "Valid Budget"; String BUDGET_AMOUNT = "12345.00"; long BUDGET_ID = -2; solo.enterText(nameField, BUDGET_NAME); solo.enterText(amountField, BUDGET_AMOUNT); solo.sleep(1000); JSONObject serverResponse = new JSONObject(); serverResponse.put("id", BUDGET_ID); testClient.setNextResponse(serverResponse, true); solo.clickOnButton("Add"); solo.sleep(1000); Budget b = Budget.getBudgetById(-2); assertNotNull("There should be a budget with ID -2.", b); assertEquals("The name of the budget was wrong.", BUDGET_NAME, b.getName()); assertEquals("The amount of the budget was wrong.", (int) (Double.parseDouble(BUDGET_AMOUNT) * 100), b.getBudgetAmount()); }
Source:
<code>public final boolean incrementToken() throws IOException { if (!input.incrementToken()) { return false; } StringBuilder stringBuilder = new <START> StringBuilder(); <END> String str = termAtt.toString(); termAtt.setEmpty(); String converted = this.stemmer.stemWord(str); if (!converted.isEmpty()) { stringBuilder.append(converted); } else { stringBuilder.append(str); } termAtt.resizeBuffer(stringBuilder.length()); termAtt.append(stringBuilder.toString()); termAtt.setLength(stringBuilder.length()); return true; }</code><technical_language>in general try avoid constructing new objects in incrementToken() method, this generally applies if stemming. call StringBuffer in constructor of filter reused. In this case hard remove allocations filter code. A nice java feature in mind is string related classes extend CharSequence, convert method signatures String CharSequence send StringBuffer built in constructor saving some allocations</technical_language>

Target:
public boolean incrementToken() throws IOException { if (input.incrementToken()) { String converted = stemmer.stemWord(termAtt.toString()); if (converted != null) termAtt.setEmpty().append(converted); return true; } else { return false; } }
Source:
<code>protected void addTimeoutToxic() throws Exception { <START> toxiProxy.toxics().timeout(TIMEOUT_NAME, ToxicDirection.DOWNSTREAM, 50).setToxicity <END> (0.5f); }</code><technical_language>I timeout toxicity values pulled out constants TIMEOUT_NAME. worth constructing TIMEOUT_NAME constants stays in sync values if change them</technical_language>

Target:
protected void addTimeoutToxic() throws Exception { toxiProxy.toxics().timeout(TIMEOUT_NAME, ToxicDirection.DOWNSTREAM, TIMEOUT).setToxicity (TOXICITY); }
Source:
<code>public void restore() { final ModuleLogger current = this.current; if (current == null) { <START> Module.setModuleLogger(NoopModuleLogger.getInstance()); <END> } else { Module.setModuleLogger(current); } }</code><technical_language>set module logger calling WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(logModuleClassLoader)? (as is done in activate)</technical_language>

Target:
public void restore() { final Module logModule; try { logModule = moduleLoader.loadModule(MODULE_ID_LOGGING); } catch (final ModuleLoadException mle) { throw EmbeddedLogger.ROOT_LOGGER.moduleLoaderError(mle, MODULE_ID_LOGGING, moduleLoader); } final ModuleClassLoader logModuleClassLoader = logModule.getClassLoader(); final ClassLoader tccl = getTccl(); try { setTccl(logModuleClassLoader); final ModuleLogger loggerToRestore = this.loggerToRestore; if (loggerToRestore == null) { Module.setModuleLogger(NoopModuleLogger.getInstance()); } else { Module.setModuleLogger(loggerToRestore); } } finally { setTccl(tccl); } }
Source:
<code>protected Registration(String id, String endpoint, Identity identity, String lwM2mVersion, Long lifetimeInSec, String smsNumber, BindingMode bindingMode, Link[] objectLinks, InetSocketAddress registrationEndpointAddress, Date registrationDate, Date lastUpdate, Map<String, String> additionalRegistrationAttributes) { Validate.notNull(id); Validate.notEmpty(endpoint); Validate.notNull(identity); Validate.notNull(registrationEndpointAddress); this.id = id; this.identity = identity; this.endpoint = endpoint; this.smsNumber = smsNumber; this.registrationEndpointAddress = registrationEndpointAddress; this.objectLinks = objectLinks; String rootPath = "/"; if (objectLinks != null) { for (Link link : objectLinks) { if (link != null && "oma.lwm2m".equals(link.getAttributes().get("rt"))) { rootPath = link.getUrl(); break; } } } this.rootPath = rootPath; this.lifeTimeInSec = lifetimeInSec == null ? DEFAULT_LIFETIME_IN_SEC : lifetimeInSec; this.lwM2mVersion = lwM2mVersion == null ? DEFAULT_LWM2M_VERSION : lwM2mVersion; this.bindingMode = bindingMode == null ? BindingMode.U : bindingMode; this.registrationDate = registrationDate == null ? new Date() : registrationDate; this.lastUpdate = lastUpdate == null ? new Date() : lastUpdate; if (additionalRegistrationAttributes == null || additionalRegistrationAttributes.isEmpty()) { this.additionalRegistrationAttributes = Collections.emptyMap(); } else { this.additionalRegistrationAttributes = Collections <START> .synchronizedMap(new HashMap<>(additionalRegistrationAttributes)); <END> } }</code><technical_language>Registration immutable</technical_language>

Target:
protected Registration(String id, String endpoint, Identity identity, String lwM2mVersion, Long lifetimeInSec, String smsNumber, BindingMode bindingMode, Link[] objectLinks, InetSocketAddress registrationEndpointAddress, Date registrationDate, Date lastUpdate, Map<String, String> additionalRegistrationAttributes) { Validate.notNull(id); Validate.notEmpty(endpoint); Validate.notNull(identity); Validate.notNull(registrationEndpointAddress); this.id = id; this.identity = identity; this.endpoint = endpoint; this.smsNumber = smsNumber; this.registrationEndpointAddress = registrationEndpointAddress; this.objectLinks = objectLinks; String rootPath = "/"; if (objectLinks != null) { for (Link link : objectLinks) { if (link != null && "oma.lwm2m".equals(link.getAttributes().get("rt"))) { rootPath = link.getUrl(); break; } } } this.rootPath = rootPath; this.lifeTimeInSec = lifetimeInSec == null ? DEFAULT_LIFETIME_IN_SEC : lifetimeInSec; this.lwM2mVersion = lwM2mVersion == null ? DEFAULT_LWM2M_VERSION : lwM2mVersion; this.bindingMode = bindingMode == null ? BindingMode.U : bindingMode; this.registrationDate = registrationDate == null ? new Date() : registrationDate; this.lastUpdate = lastUpdate == null ? new Date() : lastUpdate; if (additionalRegistrationAttributes == null || additionalRegistrationAttributes.isEmpty()) { this.additionalRegistrationAttributes = Collections.emptyMap(); } else { this.additionalRegistrationAttributes = Collections .unmodifiableMap(new HashMap<>(additionalRegistrationAttributes)); } }
Source:
<code>private void destroyRaftNodeAsync(CPGroupId groupId) { <START> nodeEngine.getExecutionService().execute(ASYNC_EXECUTOR, () -> raftService.destroyRaftNode(groupId)); <END> }</code><technical_language>I a new CP subsystem specific executor, instead of ASYNC_EXECUTOR</technical_language>

Target:
private void destroyRaftNodeAsync(CPGroupId groupId) { nodeEngine.getExecutionService().execute(CP_SUBSYSTEM_EXECUTOR, () -> raftService.destroyRaftNode(groupId)); }
Source:
<code>public VDI getIsoVDIByURL(final Connection conn, final String vmName, final String isoURL) { SR isoSR = null; String mountpoint = null; <START> if (isoURL.startsWith("xs-tools") || isoURL.startsWith("guest-tools")) { <END> try { final Set<VDI> vdis = VDI.getByNameLabel(conn, isoURL); if (vdis.isEmpty()) { throw new CloudRuntimeException("Could not find ISO with URL: " + isoURL); } return vdis.iterator().next(); } catch (final XenAPIException e) { throw new CloudRuntimeException("Unable to get pv iso: " + isoURL + " due to " + e.toString()); } catch (final Exception e) { throw new CloudRuntimeException("Unable to get pv iso: " + isoURL + " due to " + e.toString()); } } final int index = isoURL.lastIndexOf("/"); mountpoint = isoURL.substring(0, index); URI uri; try { uri = new URI(mountpoint); } catch (final URISyntaxException e) { throw new CloudRuntimeException("isoURL is wrong: " + isoURL); } isoSR = getISOSRbyVmName(conn, vmName); if (isoSR == null) { isoSR = createIsoSRbyURI(conn, uri, vmName, false); } final String isoName = isoURL.substring(index + 1); final VDI isoVDI = getVDIbyLocationandSR(conn, isoName, isoSR); if (isoVDI != null) { return isoVDI; } else { throw new CloudRuntimeException("Could not find ISO with URL: " + isoURL); } }</code><technical_language>Is for isoURL null? If not, is ok is. Otherwise, a good idea StringUtils.startsWith</technical_language>

Target:
public VDI getIsoVDIByURL(final Connection conn, final String vmName, final String isoURL) { SR isoSR = null; String mountpoint = null; if (isoURL.startsWith("xs-tools")) { try { final String actualIsoURL = actualIsoTemplate(conn); final Set<VDI> vdis = VDI.getByNameLabel(conn, actualIsoURL); if (vdis.isEmpty()) { throw new CloudRuntimeException("Could not find ISO with URL: " + actualIsoURL); } return vdis.iterator().next(); } catch (final XenAPIException e) { throw new CloudRuntimeException("Unable to get pv iso: " + isoURL + " due to " + e.toString()); } catch (final Exception e) { throw new CloudRuntimeException("Unable to get pv iso: " + isoURL + " due to " + e.toString()); } } final int index = isoURL.lastIndexOf("/"); mountpoint = isoURL.substring(0, index); URI uri; try { uri = new URI(mountpoint); } catch (final URISyntaxException e) { throw new CloudRuntimeException("isoURL is wrong: " + isoURL); } isoSR = getISOSRbyVmName(conn, vmName); if (isoSR == null) { isoSR = createIsoSRbyURI(conn, uri, vmName, false); } final String isoName = isoURL.substring(index + 1); final VDI isoVDI = getVDIbyLocationandSR(conn, isoName, isoSR); if (isoVDI != null) { return isoVDI; } else { throw new CloudRuntimeException("Could not find ISO with URL: " + isoURL); } }
Source:
<code>private void createMercs() { <START> String fileName = "mercenaries.json"; <END> if (!SaveManager.resourceExists(fileName)) { return; } String path = SaveManager.getRsrcPath(fileName); BufferedReader bufferedReader; try { bufferedReader = new BufferedReader(new FileReader(path)); if (new File(path).length() == 0) { bufferedReader.close(); return; } } catch (IOException e) { return; } Gson gson = new Gson(); Type type = new TypeToken<ArrayList<HashMap<String, String>>>() { }.getType(); ArrayList<HashMap<String, String>> mercs = gson.fromJson(bufferedReader, type); MercItem mercItem; for (HashMap<String, String> node : mercs) { mercItem = new MercItem( new ShipConfig(hullConfigManager.getConfig(node.get("hull")), node.get("items"), Integer.parseInt(node.get("money")), -1f, null, itemManager)); MercenaryUtils.createMerc(this, hero, mercItem); } }</code><technical_language>This string "mercenaries.json" a static variable, in loading logic</technical_language>

Target:
private void createMercs() { if (!SaveManager.resourceExists(MERC_SAVE_FILE)) { return; } String path = SaveManager.getResourcePath(MERC_SAVE_FILE); BufferedReader bufferedReader; try { bufferedReader = new BufferedReader(new FileReader(path)); if (new File(path).length() == 0) { bufferedReader.close(); return; } } catch (IOException e) { logger.error("Could not save mercenaries!"); e.printStackTrace(); return; } Gson gson = new Gson(); Type type = new TypeToken<ArrayList<HashMap<String, String>>>() {}.getType(); ArrayList<HashMap<String, String>> mercs = gson.fromJson(bufferedReader, type); MercItem mercItems; for (HashMap<String, String> node : mercs) { mercItems = new MercItem( new ShipConfig(hullConfigManager.getConfig(node.get("hull")), node.get("items"), Integer.parseInt(node.get("money")), -1f, null, itemManager)); MercenaryUtils.createMerc(this, hero, mercItems); } }
Source:
<code>public int getTaskInstanceCountForTaskName(final String taskname) throws IllegalAccessFault, IllegalArgumentFault, IllegalStateFault, IllegalOperationFault { final int[] taskCountTemp = {0}; final List[] tasklist = new List[1]; try { HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler(). execTransaction(new Callable<Object>() { public Object call() throws Exception { HumanTaskServerHolder.getInstance().getHtServer().getTaskEngine().getDaoConnectionFactory().getConnection(); HumanTaskServer humanTaskServer = HumanTaskServiceComponent.getHumanTaskServer(); HumanTaskEngine humanTaskEngine = humanTaskServer.getTaskEngine(); HumanTaskDAOConnectionFactory humanTaskDAOConnectionFactory = humanTaskEngine.getDaoConnectionFactory(); humanTaskServer.getServerConfig(); HTQueryBuilder htQueryBuilder = new HTQueryBuilder(); EntityManager em = humanTaskDAOConnectionFactory.getConnection().getEntityManager(); Query query = htQueryBuilder.buildQueryToFindTaskInstances(taskname, em); tasklist[0] = query.getResultList(); taskCountTemp[0] = tasklist[0].size(); return null; } }); <START> } catch (Exception ex) { <END> handleException(ex); } return taskCountTemp[0]; }</code><technical_language>Is reason catch top level exception here</technical_language>

Target:
public int getTaskInstanceCountForTaskName(final String taskname) throws Exception { final int[] taskCountTemp = {0}; final List[] tasklist = new List[1]; HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler(). execTransaction(new Callable<Object>() { public Object call() throws Exception { HumanTaskServerHolder.getInstance().getHtServer().getTaskEngine().getDaoConnectionFactory().getConnection(); HumanTaskServer humanTaskServer = HumanTaskServiceComponent.getHumanTaskServer(); HumanTaskEngine humanTaskEngine = humanTaskServer.getTaskEngine(); HumanTaskDAOConnectionFactory humanTaskDAOConnectionFactory = humanTaskEngine.getDaoConnectionFactory(); humanTaskServer.getServerConfig(); HTQueryBuilder htQueryBuilder = new HTQueryBuilder(); EntityManager em = humanTaskDAOConnectionFactory.getConnection().getEntityManager(); Query query = htQueryBuilder.buildQueryToFindTaskInstances(taskname, em); tasklist[0] = query.getResultList(); taskCountTemp[0] = tasklist[0].size(); return null; } }); return taskCountTemp[0]; }
Source:
<code>public void addToOrderBook(Order order) { Class buy = BuyOrder.class; Class sell = SellOrder.class; if (sell.isInstance(order)) { <START> SellOrder s = (SellOrder) order; <END> if (sellOrders.containsKey(s.getStockSymbol())) { ArrayList<Order> temp = sellOrders.get(s.getStockSymbol()); temp.add(s); sellOrders.put(s.getStockSymbol(), temp); } else { ArrayList<Order> temp = new ArrayList<Order>(); temp.add(s); sellOrders.put(s.getStockSymbol(), temp); } } else if (buy.isInstance(order)) { BuyOrder b = (BuyOrder) order; if (buyOrders.containsKey(b.getStockSymbol())) { ArrayList<Order> temp = buyOrders.get(b.getStockSymbol()); temp.add(b); buyOrders.put(b.getStockSymbol(), temp); } else { ArrayList<Order> temp = new ArrayList<Order>(); temp.add(b); buyOrders.put(b.getStockSymbol(), temp); } } }</code><technical_language>S is a good variable name. Rename more descriptive</technical_language>

Target:
public void addToOrderBook(Order order) { Class buy = BuyOrder.class; Class sell = SellOrder.class; if (sell.isInstance(order)) { SellOrder sell = (SellOrder) order; if (sellOrders.containsKey(s.getStockSymbol())) { ArrayList<Order> temp = sellOrders.get(sell.getStockSymbol()); temp.add(sell); sellOrders.put(sell.getStockSymbol(), temp); } else { ArrayList<Order> temp = new ArrayList<Order>(); temp.add(sell); sellOrders.put(sell.getStockSymbol(), temp); } } else if (buy.isInstance(order)) { BuyOrder b = (BuyOrder) order; if (buyOrders.containsKey(b.getStockSymbol())) { ArrayList<Order> temp = buyOrders.get(b.getStockSymbol()); temp.add(b); buyOrders.put(b.getStockSymbol(), temp); } else { ArrayList<Order> temp = new ArrayList<Order>(); temp.add(b); buyOrders.put(b.getStockSymbol(), temp); } } }
Source:
<code>public @NotNull MetaTag getCharsetMetaTag(@NotNull String charsetStr) { <START> ECharset charset = ECharset.getCharset(charsetStr).get(); <END> if (charset != null) { return new MetaTag(charset); } return new MetaTag(ECharset.ATTRIB_NAME, charsetStr, null); }</code><technical_language>This a NPE, instead resolve Optionals checking present()</technical_language>

Target:
public @NotNull MetaTag getCharsetMetaTag(@NotNull String charsetStr) { Optional<ECharset> charset = ECharset.getCharset(charsetStr); if (charset.isPresent()) { return new MetaTag(charset.get()); } return new MetaTag(ECharset.ATTRIB_NAME, charsetStr, null); }
Source:
<code>public RequestMsg simulateSerialization(RequestMsg message) throws IOException { ByteBuf oBuf = Unpooled.buffer(); try (ByteBufOutputStream requestOutputStream = new ByteBufOutputStream(oBuf)) { message.writeTo(requestOutputStream); oBuf.resetReaderIndex(); try (ByteBufInputStream msgInputStream = new ByteBufInputStream(oBuf)) { RequestMsg msg = RequestMsg.parseFrom(msgInputStream); <START> oBuf.release(); <END> return msg; } } }</code><technical_language>release of buffer in a finally block try itself</technical_language>

Target:
public RequestMsg simulateSerialization(RequestMsg message) throws IOException { ByteBuf oBuf = Unpooled.buffer(); RequestMsg msg; try (ByteBufOutputStream requestOutputStream = new ByteBufOutputStream(oBuf)) { message.writeTo(requestOutputStream); oBuf.resetReaderIndex(); try (ByteBufInputStream msgInputStream = new ByteBufInputStream(oBuf)) { msg = RequestMsg.parseFrom(msgInputStream); } } finally { oBuf.release(); } return msg; }
Source:
<code>public void testAvailableStrata() throws Exception { String typeName = "HelloWorld"; prepareXtendBreakpoint(typeName, 3); IJavaThread thread = null; try { thread = launchToBreakpoint(typeName); assertNotNull("Breakpoint not hit within timeout period", thread); IJavaReferenceType type = ((IJavaStackFrame) thread.getTopStackFrame()).getReferenceType(); String[] strata = type.getAvailableStrata(); for (String strataName : strata) { DebugPlugin.log(new Status(IStatus.INFO, "Strata Name: ", strataName)); } DebugPlugin.log(new Status(IStatus.INFO, "Strata count: ", String.valueOf(strata.length))); <START> assertEquals("Wrong number of available strata", 2, <END> strata.length); assertEquals("Wrong strata", "Xtend", strata[0]); assertEquals("Wrong strata", "Java", strata[1]); } finally { terminateAndRemove(thread); removeAllBreakpoints(); } }</code><technical_language>simply add Arrays.toString(strata) assert message here</technical_language>

Target:
public void testAvailableStrata() throws Exception { String typeName = "HelloWorld"; prepareXtendBreakpoint(typeName, 3); IJavaThread thread = null; try { thread = launchToBreakpoint(typeName); assertNotNull("Breakpoint not hit within timeout period", thread); IJavaReferenceType type = ((IJavaStackFrame) thread.getTopStackFrame()).getReferenceType(); String[] strata = type.getAvailableStrata(); for (String strataName : strata) { DebugPlugin.log(new Status(IStatus.INFO, "Strata Name: ", strataName)); } DebugPlugin.log(new Status(IStatus.INFO, "Strata count: ", String.valueOf(strata.length))); assertEquals("Stratas available are: " + Arrays.toString(strata) + ", Wrong number of available strata", 2, strata.length); assertEquals("Wrong strata", "Xtend", strata[0]); assertEquals("Wrong strata", "Java", strata[1]); } finally { terminateAndRemove(thread); removeAllBreakpoints(); } }
Source:
<code>public void close() throws IOException { if (!isClosed) { <START> isClosed = true; <END> for (LineConsumer lineConsumer : lineConsumers) { try { lineConsumer.close(); } catch (IOException e) { LOG.error(String.format("An error occurred while closing the line consumer %s", lineConsumer), e); } } } }</code><technical_language>operations atomic. Consider usage of AtomicBoolean</technical_language>

Target:
public void close() { if (isOpen) { isOpen = false; for (LineConsumer lineConsumer : lineConsumers) { try { lineConsumer.close(); } catch (IOException e) { LOG.error(String.format("An error occurred while closing the line consumer %s", lineConsumer), e); } } } }
Source:
<code><START> public boolean equals(Object o) { <END> if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BetweenPredicate that = (BetweenPredicate) o; if (to != null ? !to.equals(that.to) : that.to != null) { return false; } return from != null ? from.equals(that.from) : that.from == null; }</code><technical_language>Equality/hashCode need account attributeName field defined in superclass AbstractPredicate. a subclasses of AbstractPredicate superclass, a good idea override equals superclass check attributeName equality in abstract superclass</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!super.equals(o)) { return false; } if (!(o instanceof BetweenPredicate)) { return false; } BetweenPredicate that = (BetweenPredicate) o; if (!that.canEqual(this)) { return false; } if (to != null ? !to.equals(that.to) : that.to != null) { return false; } return from != null ? from.equals(that.from) : that.from == null; }
Source:
<code>private static void fireOnFailure(final NodeProvisioner.PlannedNode plannedNode, final Throwable cause) { for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { try { cl.onFailure(plannedNode, cause); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + "processing onFailure() listener call in " + cl + " for agent " + plannedNode.displayName, e); <START> if (e instanceof Error) { <END> throw e; } } } }</code><technical_language>De-facto process errors in logging handler. E.g. logging constructs string, OutOfMemoryError, suppresses original one. vote Errors rethrown processing</technical_language>

Target:
private static void fireOnFailure(final NodeProvisioner.PlannedNode plannedNode, final Throwable cause) { for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { try { cl.onFailure(plannedNode, cause); } catch (Error e) { throw e; } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + "processing onFailure() listener call in " + cl + " for agent " + plannedNode.displayName, e); } } }
Source:
<code>private Getter instantiateGetter(Object targetObject, String attributeName) { String attributeNameWithoutArguments = extractAttributeNameNameWithoutArguments(attributeName); ValueExtractor valueExtractor = extractors.get(attributeNameWithoutArguments); if (valueExtractor != null) { Object arguments = argumentsParser.parse(extractArgumentsFromAttributeName(attributeName)); return new ExtractorGetter(ss, valueExtractor, arguments); } else { if (targetObject instanceof Data) { if (((Data) targetObject).isPortable()) { if (genericPortableGetter == null) { genericPortableGetter = new PortableGetter(ss); } return genericPortableGetter; <START> } else if (((Data) targetObject).getType() == JAVASCRIPT_JSON_SERIALIZATION_TYPE) { <END> return JsonDataGetter.INSTANCE; } else { throw new HazelcastSerializationException("No Data getter found for type " + ((Data) targetObject).getType()); } } else if (targetObject instanceof HazelcastJsonValue) { return JsonGetter.INSTANCE; } else { return ReflectionHelper.createGetter(targetObject, attributeName); } } }</code><technical_language>Minor: add a method Data similar isPortable</technical_language>

Target:
private Getter instantiateGetter(Object targetObject, String attributeName) { String attributeNameWithoutArguments = extractAttributeNameNameWithoutArguments(attributeName); ValueExtractor valueExtractor = extractors.get(attributeNameWithoutArguments); if (valueExtractor != null) { Object arguments = argumentsParser.parse(extractArgumentsFromAttributeName(attributeName)); return new ExtractorGetter(ss, valueExtractor, arguments); } else { if (targetObject instanceof Data) { if (((Data) targetObject).isPortable()) { if (genericPortableGetter == null) { genericPortableGetter = new PortableGetter(ss); } return genericPortableGetter; } else if (((Data) targetObject).isJson()) { return JsonDataGetter.INSTANCE; } else { throw new HazelcastSerializationException("No Data getter found for type " + ((Data) targetObject).getType()); } } else if (targetObject instanceof HazelcastJsonValue) { return JsonGetter.INSTANCE; } else { return ReflectionHelper.createGetter(targetObject, attributeName); } } }
Source:
<code>public void run() { try { Injector injector = makeInjector(); final Server jettyServer = injector.getInstance(Server.class); try { final Lifecycle lifecycle = initLifecycle(injector); Runtime.getRuntime().addShutdownHook( new Thread( new Runnable() { @Override public void run() { log.info("Running shutdown hook"); lifecycle.stop(); } } ) ); injector.getInstance(ExecutorLifecycle.class).join(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } log.info("Finished peon task"); try { <START> jettyServer.stop(); <END> } catch (Exception e) { log.error(e, "Error shutting down jetty"); } } catch (Exception e) { throw Throwables.propagate(e); } }</code><technical_language>is a reason need shut jetty server separately? get stopped part of lifecycle</technical_language>

Target:
public void run() { try { Injector injector = makeInjector(); try { final Lifecycle lifecycle = initLifecycle(injector); Runtime.getRuntime().addShutdownHook( new Thread( new Runnable() { @Override public void run() { log.info("Running shutdown hook"); lifecycle.stop(); } } ) ); injector.getInstance(ExecutorLifecycle.class).join(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } log.info("Finished peon task"); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code>void foo() { int myInt = 4; boolean myBoolean = true; <START> new Integer(myInt).toString(); END> Integer.toString(myInt); A.returnInteger(myInt).toString(); Integer.valueOf(myInt).toString(); bar(new Integer(myInt).toString()); new Boolean(myBoolean).toString(); Boolean.toString(myBoolean); Boolean.valueOf(myBoolean).toString(); Integer myInteger = returnInteger(myInt); myInteger.toString(); new Byte((byte) 0).toString(); new Character('c').toString(); new Short((short) 0).toString(); new Long(0L).toString(); new Float(0.0F).toString(); new Double(0.0).toString(); Integer.valueOf("4").toString(); }</code><technical_language>add case of constructor String parameter</technical_language>

Target:
void foo() { int myInt = 4; boolean myBoolean = true; new Integer(myInt).toString(); Integer.toString(myInt); A.returnInteger(myInt).toString(); Integer.valueOf(myInt).toString(); bar(new Integer(myInt).toString()); new Boolean(myBoolean).toString(); Boolean.toString(myBoolean); Boolean.valueOf(myBoolean).toString(); Integer myInteger = returnInteger(myInt); myInteger.toString(); new Byte((byte) 0).toString(); new Character('c').toString(); new Short((short) 0).toString(); new Long(0L).toString(); new Float(0.0F).toString(); new Double(0.0).toString(); Integer.valueOf("4").toString(); new Integer("4").toString(); }
Source:
<code>public String generateDisplayId(Boolean parentDn){ DiscrepancyNote dn = null; String newDisplayId =null; do { String randomNo = StringUtils.leftPad(Integer.toString(RandomUtils.nextInt(0, 1000000000)), 9, '0'); newDisplayId = parentDn ? "DN_"+randomNo : "CDN_"+randomNo; dn = discrepancyNoteDao.findByDisplayId(newDisplayId); <START> }while(dn != null); <END> return newDisplayId; }</code><technical_language>throw error if unable create a unique display id a number of attempts</technical_language>

Target:
public String generateDisplayId(Boolean parentDn){ DiscrepancyNote dn = null; String newDisplayId =null; int counter = 0; do { String randomNo = StringUtils.leftPad(Integer.toString(RandomUtils.nextInt(0, 1000000000)), 9, '0'); newDisplayId = parentDn ? "DN_"+randomNo : "CDN_"+randomNo; dn = discrepancyNoteDao.findByDisplayId(newDisplayId); counter++; }while(dn != null && counter < 10); if(counter >= 10) throw new OpenClinicaSystemException("Failed", ErrorConstants.ERR_GENERATING_DISCREPANCY_NOTE_ID); return newDisplayId; }
Source:
<code>private List<File> listOutputDirectories() { List<File> outputDirectories = new ArrayList<File>(); <START> addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(module, false)); <END> addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(module, true)); ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (Module dependantModule : moduleRootManager.getDependencies()) { addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(dependantModule, false)); } return outputDirectories; }</code><technical_language>extract true/false constants improve readability of this part (or constants in Idea SDK?)</technical_language>

Target:
private List<File> listOutputDirectories() { List<File> outputDirectories = new ArrayList<File>(); addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(module, TEST_CLASSES)); addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(module, MAIN_CLASSES)); ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (Module dependantModule : moduleRootManager.getDependencies()) { addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(dependantModule, MAIN_CLASSES)); } return outputDirectories; }
Source:
<code>private synchronized Connection getOrCreateConnection() throws IOException { if (connection == null) { <START> logger.info("connectionId[{}] Creating and starting connection to {}:{}", connectionId, <END> handler.getHostname(), handler.getProtocolPort()); final Reactor reactor = reactorProvider.createReactor(connectionId, handler.getMaxFrameSize()); connection = reactor.connectionToHost(handler.getHostname(), handler.getProtocolPort(), handler); reactorExceptionHandler = new ReactorExceptionHandler(); executor = new ReactorExecutor(reactor, Schedulers.single(), connectionId, reactorExceptionHandler, connectionOptions.getRetry().getTryTimeout(), connectionOptions.getFullyQualifiedNamespace()); executor.start(); } return connection; }</code><technical_language>follow other formatting. suggestion logger.info("connectionId[{}]: Creating starting connection {}:{}", connectionId,</technical_language>

Target:
private synchronized Connection getOrCreateConnection() throws IOException { if (connection == null) { logger.info("connectionId[{}]: Creating and starting connection to {}:{}", connectionId, handler.getHostname(), handler.getProtocolPort()); final Reactor reactor = reactorProvider.createReactor(connectionId, handler.getMaxFrameSize()); connection = reactor.connectionToHost(handler.getHostname(), handler.getProtocolPort(), handler); reactorExceptionHandler = new ReactorExceptionHandler(); executor = new ReactorExecutor(reactor, Schedulers.single(), connectionId, reactorExceptionHandler, connectionOptions.getRetry().getTryTimeout(), connectionOptions.getFullyQualifiedNamespace()); executor.start(); } return connection; }
Source:
<code>private void compareAccountMetadata() { Set<Account> primaryAccounts = new HashSet<>(primaryAccountService.getAllAccounts()); Set<Account> secondaryAccounts = new HashSet<>(secondaryAccountService.getAllAccounts()); if (!primaryAccounts.equals(secondaryAccounts)) { accountServiceMetrics.accountMetadataInconsistencyCount.inc(); logger.debug("Inconsistency detected between primary and secondary at for accounts ={}", <START> SystemTime.getInstance().milliseconds(), primaryAccounts.removeAll(secondaryAccounts)); <END> } }</code><technical_language>Note primaryAccounts.removeAll() returns a boolean inconsistent accounts set</technical_language>

Target:
void compareAccountMetadata() { if (!AccountUtils.compareAccounts(primaryAccountService.getAllAccounts(), secondaryAccountService.getAllAccounts())) { accountServiceMetrics.accountDataInconsistencyCount.inc(); } }
Source:
<code>Object convert(byte[] data) throws IOException; } private static DeserializationRuntimeConverter createConverter( LogicalType type, String charsetName, boolean isBigEndian) { final DeserializationRuntimeConverter converter = createNotNullConverter(type, charsetName, isBigEndian); final Consumer<byte[]> validator = createDataLengthValidator(type); return new DeserializationRuntimeConverter() { private static final long serialVersionUID = 1L; @Override public void open() { converter.open(); } @Override public Object convert(byte[] data) throws IOException { <START> if (data == null) { <END> return null; } validator.accept(data); return converter.convert(data); } }; }</code><technical_language>I data is null this location</technical_language>

Target:
Object convert(byte[] data) throws IOException; } private static DeserializationRuntimeConverter createConverter( LogicalType type, String charsetName, boolean isBigEndian) { switch (type.getTypeRoot()) { case CHAR: case VARCHAR: return createStringConverter(charsetName); case VARBINARY: case BINARY: return data -> data; case RAW: return RawValueData::fromBytes; case BOOLEAN: return data -> data[0] != 0; case TINYINT: return data -> data[0]; case SMALLINT: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getShortBigEndian(0), segment -> segment.getShortLittleEndian(0) ); case INTEGER: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getIntBigEndian(0), segment -> segment.getIntLittleEndian(0) ); case BIGINT: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getLongBigEndian(0), segment -> segment.getLongLittleEndian(0) ); case FLOAT: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getFloatBigEndian(0), segment -> segment.getFloatLittleEndian(0) ); case DOUBLE: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getDoubleBigEndian(0), segment -> segment.getDoubleLittleEndian(0) ); default: throw new UnsupportedOperationException("'raw' format currently doesn't support type: " + type); } }
Source:
<code>public void compress(ByteBuffer input, ByteBuffer output) { <START> byte[] uncompressed = new byte[input.remaining()]; <END> input.get(uncompressed); byte[] compressed = new byte[output.remaining()]; int compressedSize = compress(uncompressed, 0, uncompressed.length, compressed, 0, compressed.length); output.put(compressed, 0, compressedSize); }</code><technical_language>throw unsupported this used</technical_language>

Target:
public void compress(ByteBuffer input, ByteBuffer output) { throw new UnsupportedOperationException(); }
Source:
<code><START> default <T extends AbstractElement> List<T> execute(Query query, Class<T> requestedEntity, Pager pager) { <END> return null; }</code><technical_language>this return a Page<T> instead of a List<T></technical_language>

Target:
default <T extends AbstractElement> Page<T> execute(Query query, Class<T> requestedEntity, Pager pager) { return null; }