auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void invokeOnAllPartitions() { if (memberPartitions.isEmpty()) { future.setResult(Collections.EMPTY_MAP); if (callback != null) { callback.onResponse(Collections.EMPTY_MAP); } return; } for (final Map.Entry<Address, List<Integer>> mp : memberPartitions.entrySet()) { final Address address = mp.getKey(); List<Integer> partitions = mp.getValue(); PartitionIteratingOperation op = new PartitionIteratingOperation(operationFactory, toIntArray(partitions)); operationService.createInvocationBuilder(serviceName, op, address) .setTryCount(TRY_COUNT) .setTryPauseMillis(TRY_PAUSE_MILLIS) .invoke() <START> .andThen(new FirstAttemptExecutionCallback(mp.getValue())); <END> } }</code><technical_language>a big deal, mp.getValue() is fetched partitions</technical_language>

Target:
private void invokeOnAllPartitions() { if (memberPartitions.isEmpty()) { future.setResult(Collections.EMPTY_MAP); return; } for (final Map.Entry<Address, List<Integer>> mp : memberPartitions.entrySet()) { final Address address = mp.getKey(); List<Integer> partitions = mp.getValue(); PartitionIteratingOperation op = new PartitionIteratingOperation(operationFactory, toIntArray(partitions)); operationService.createInvocationBuilder(serviceName, op, address) .setTryCount(TRY_COUNT) .setTryPauseMillis(TRY_PAUSE_MILLIS) .invoke() .andThen(new FirstAttemptExecutionCallback(partitions)); } }
Source:
<code>protected ScenarioResult fillResult(FactMappingValue expectedResult, FactIdentifier factIdentifier, Supplier<ResultWrapper<?>> resultSupplier, ExpressionEvaluator expressionEvaluator) { ResultWrapper<?> resultValue = resultSupplier.get(); <START> if (!resultValue.isSatisfied() && resultValue.getErrorMessage().isPresent()) { <END> expectedResult.setExceptionMessage(resultValue.getErrorMessage().get()); } else if (!resultValue.isSatisfied()) { expectedResult.setErrorValue(expressionEvaluator.reverseFunction(resultValue.getResult())); } else { expectedResult.resetStatus(); } return new ScenarioResult(factIdentifier, expectedResult, resultValue.getResult()).setResult(resultValue.isSatisfied()); }</code><technical_language>@danielezonca pls semplify this if (!!resultValue.isSatisfied()) { resultValue.getErrorMessage().ifPresent(_lambda) expectedResult.setErrorValue(expressionEvaluator.reverseFunction(resultValue.getResult())); } else ... similar</technical_language>

Target:
protected ScenarioResult fillResult(FactMappingValue expectedResult, FactIdentifier factIdentifier, Supplier<ResultWrapper<?>> resultSupplier, ExpressionEvaluator expressionEvaluator) { ResultWrapper<?> resultValue = resultSupplier.get(); if (!resultValue.isSatisfied() && resultValue.getErrorMessage().isPresent()) { expectedResult.setExceptionMessage(resultValue.getErrorMessage().get()); } else if (!resultValue.isSatisfied()) { expectedResult.setErrorValue(expressionEvaluator.fromObjectToExpression(resultValue.getResult())); } else { expectedResult.resetStatus(); } return new ScenarioResult(factIdentifier, expectedResult, resultValue.getResult()).setResult(resultValue.isSatisfied()); }
Source:
<code>public void testToCalendarWithTimeZoneNull() { <START> try { <END> DateUtils.toCalendar(date1, null); fail("Expected NullPointerException to be thrown when TimeZone is null"); } catch(final NullPointerException npe) { } }</code><technical_language>need a try-catch here. simply @Test(expected=NullPointerException.class)</technical_language>

Target:
public void testToCalendarWithTimeZoneNull() { DateUtils.toCalendar(date1, null); }
Source:
<code>public JSONObject createJsonFromLog(String log) throws JSONException { Pattern compile = Pattern.compile(this.pattern); Matcher m = compile.matcher(log); int count = m.groupCount(); <START> int i = 1; <END> JSONObject logObject = null; if (m.find()) { logObject = new JSONObject(); for(String field: this.getFieldNames()) { if (i > count) { break; } logObject.put(field, m.group(i)); i++; } } return logObject; }</code><technical_language>"i" moved if</technical_language>

Target:
public JSONObject createJsonFromLog(String log) throws JSONException { JSONObject logObject = null; if (this.compiledPattern != null) { Matcher m = this.compiledPattern.matcher(log); int count = m.groupCount(); if (m.find()) { int i = 1; logObject = new JSONObject(); for(String field: this.getFieldNames()) { if (i > count) { break; } logObject.put(field, m.group(i)); i++; } } } return logObject; }
Source:
<code>public void beforeScenario() { <START> this.deviceSimulatorSteps.removeAllTemporaryPropertiesFiles(); <END> this.dlmsDatabaseSteps.prepareDatabaseForScenario(); this.prepareServiceEndpoint(); }</code><technical_language>temporary properties files? Rename method</technical_language>

Target:
public void beforeScenario() { this.deviceSimulatorSteps.clearDlmsAttributeValues(); this.dlmsDatabaseSteps.prepareDatabaseForScenario(); this.prepareServiceEndpoint(); }
Source:
<code>protected String getColorByProgress(int progress) { <START> return "#669966"; END> }</code><technical_language>Please a constant also, wise for future usecases color a constant parameter in case want a red color progress back</technical_language>

Target:
protected String getColorByProgress(int progress) { return color.asCode(); }
Source:
<code>private static File confirmFileSave(File file, File currentFile) { int reply = JOptionPane.NO_OPTION; <START> while (file != null && file.exists() && !file.equals(currentFile) && reply == JOptionPane.NO_OPTION) { <END> reply = JOptionPane.showConfirmDialog(null, file.getAbsoluteFile() + " already exists. Do you want to overwrite it?", "File already exists", JOptionPane.YES_NO_OPTION); if (reply == JOptionPane.NO_OPTION) { file = FileChooserService.getSelectedFile("tex", "TeX files", FileChooserService.DialogType.SAVE, true); } } return file; }</code><technical_language>change [reply == NO_OPTION] [reply != YES_OPTION]. Currently, if I close confirmation window X, saves file. In opinion closing confirmation dialog (and other operation other clicking YES) result in aborting saving</technical_language>

Target:
private static File confirmFileSave(File file, File currentFile) { int reply = JOptionPane.NO_OPTION; while (file != null && file.exists() && !file.equals(currentFile) && reply == JOptionPane.NO_OPTION) { reply = JOptionPane.showConfirmDialog(null, file.getAbsoluteFile() + " already exists. Do you want to overwrite it?", "File already exists", JOptionPane.YES_NO_OPTION); if (reply != JOptionPane.YES_OPTION) { file = FileChooserService.getSelectedFile("tex", "TeX files", FileChooserService.DialogType.SAVE, true); } } return file; }
Source:
<code>public static void main(String[] args) { String filename = null; try { <START> filename = args[0]; <END> if (args.length > 1) throw new Exception(); } catch (Exception e) { logger.error("usage: java edu.illinois.cs.cogcomp.lbjava.edu.illinois.cs.cogcomp.lbjava.nlp.WordSplitter <file name>"); System.exit(1); } WordSplitter splitter = new WordSplitter(new SentenceSplitter(filename)); for (LinkedVector s = (LinkedVector) splitter.next(); s != null; s = (LinkedVector) splitter.next()) { if (s.size() > 0) { Word w = (Word) s.get(0); logger.info(w.form); for (w = (Word) w.next; w != null; w = (Word) w.next) logger.info(" " + w.form); } logger.info("\n"); } }</code><technical_language>exception, STDERR</technical_language>

Target:
public static void main(String[] args) { String filename = null; try { filename = args[0]; if (args.length > 1) throw new Exception(); } catch (Exception e) { System.err.println("usage: java edu.illinois.cs.cogcomp.lbjava.edu.illinois.cs.cogcomp.lbjava.nlp.WordSplitter <file name>"); System.exit(1); } WordSplitter splitter = new WordSplitter(new SentenceSplitter(filename)); for (LinkedVector s = (LinkedVector) splitter.next(); s != null; s = (LinkedVector) splitter.next()) { if (s.size() > 0) { Word w = (Word) s.get(0); System.out.print(w.form); for (w = (Word) w.next; w != null; w = (Word) w.next) System.out.print(" " + w.form); } System.out.println(); } }
Source:
<code>protected void showChannelFilters() { List<RemoteRssChannel> feedLabels = new ArrayList<>(feeds.size() +1); feedLabels.add(new RemoteRssChannel() { @Override public String getName() { <START> return "(All recent)"; <END> } @Override public void writeToParcel(Parcel dest, int flags) { } }); feedLabels.addAll(feeds); drawerList.setAdapter(new SimpleListItemAdapter(this, feedLabels)); }</code><technical_language>Is this a server-supplied name? need localize this i.e. put in strings.xml</technical_language>

Target:
protected void showChannelFilters() { List<RemoteRssChannel> feedLabels = new ArrayList<>(feeds.size() +1); feedLabels.add(new RemoteRssChannel() { @Override public String getName() { return getString(R.string.remoterss_filter_allrecent); } @Override public void writeToParcel(Parcel dest, int flags) { } }); feedLabels.addAll(feeds); drawerList.setAdapter(new SimpleListItemAdapter(this, feedLabels)); }
Source:
<code>public void testGetAccount() throws Exception { server.enqueue(jsonResponse("/account.json")); Account account = api.getAccountApi().getMyAccount(); assertNotNull(account); assertEquals("devlab1-online-vendor-devuser1", account.userName()); assertEquals("Donal Lunny", account.fullName()); assertEquals("Donal", account.firstName()); assertEquals("Lunny", account.lastName()); assertEquals("devlab1-online-vendor-devuser1@opsource.net", account.emailAddress()); assertThat(account.roles().contains(Account.RoleType.create("storage"))); assertThat(account.roles().contains(Account.RoleType.create("primary administrator"))); assertEquals("1", account.phone().countryCode()); assertEquals("1234567", account.phone().number()); assertEquals("Marketing", account.department()); assertEquals("custom defined 1", account.customDefined1()); assertEquals("custom defined 2", account.customDefined2()); assertEquals("6ac1e746-b1ea-4da5-a24e-caf1a978789d", account.organization().id()); assertEquals("Eng Customer of DevLab1-homed online sign-up Vendor", account.organization().name()); assertEquals("DevLab1Geo1", account.organization().homeGeoName()); assertEquals("apidevlab1.opsourcecloud.net", account.organization().homeGeoApiHost()); assertEquals("DEVLAB1GEO1", account.organization().homeGeoId()); <START> assertEquals("NORMAL", account.state()); <END> assertSent(server, "GET", "/caas/2.4/user/myUser"); }</code><technical_language>is need verify response deserialization in mock tests, remove asserts. want generated requests expected ones. method basic authentication (via filter), modify assertSent method in base mock test class verify authentication header is too</technical_language>

Target:
public void testGetAccount() throws Exception { server.enqueue(jsonResponse("/account.json")); Account account = api.getAccountApi().getMyAccount(); assertNotNull(account); assertSent("GET", "/caas/2.4/user/myUser"); }
Source:
<code>public Object getObjectValue(ConnectorSession session, Block block, int position) { if (block.isNull(position)) { return null; } <START> return format("<%s>", getTypeSignature()).getBytes(); <END> }</code><technical_language>While a strict contract for getObjectValue return, a good idea return a json-serializable object represents value. This is currently client protocol handy for tests</technical_language>

Target:
public Object getObjectValue(ConnectorSession session, Block block, int position) { if (block.isNull(position)) { return null; } Slice slice = block.getSlice(position, 0, block.getSliceLength(position)); return slice.getInput().readInt(); }
Source:
<code>public String apply(String dimValue) { if (Strings.isNullOrEmpty(dimValue)) { return null; } int len = dimValue.length(); if (index < len) { <START> if (length > 0) { <END> return dimValue.substring(index, Math.min(end, len)); } else { return dimValue.substring(index); } } else { return null; } }</code><technical_language>Is this check required ? this point length greater 0 return null if length is 0 line 62 Strings.isNullOrEmpty(dimValue)</technical_language>

Target:
public String apply(String dimValue) { if (Strings.isNullOrEmpty(dimValue)) { return null; } int len = dimValue.length(); if (index < len) { if (end > 0) { return dimValue.substring(index, Math.min(end, len)); } else { return dimValue.substring(index); } } else { return null; } }
Source:
<code>public Response processStats(BatchedOperatorStats batchedOperatorStats) { Response response = new Response(); int operatorId = batchedOperatorStats.getOperatorId(); long windowId = batchedOperatorStats.getCurrentWindowId(); currentWindowIds.put(operatorId, windowId); long minWindow = Long.MAX_VALUE; long maxWindow = Long.MIN_VALUE; for (Long value : currentWindowIds.values()) { if (value < minWindow) minWindow = value; if (value > maxWindow) maxWindow = value; } logger.debug("Operator min window max window {}", operatorId, minWindow, maxWindow); if (normalState && ((maxWindow - minWindow) > windowThreshold)) { logger.info("Setting suspend"); normalState = false; } else if (!normalState && ((maxWindow - minWindow) <= windowThreshold)) { logger.info("Setting normal"); normalState = true; } if (!normalState) { List<OperatorRequest> operatorRequests = new ArrayList<OperatorRequest>(); operatorRequests.add(new InputSlowdownRequest()); response.operatorRequests = operatorRequests; } else { List<OperatorRequest> operatorRequests = new ArrayList<OperatorRequest>(); operatorRequests.add(new InputNormalRequest()); response.operatorRequests = operatorRequests; <START> } <END> return response; }</code><technical_language>If 2 classes combined, this simplifies to: java List<OperatorRequest> operatorRequests = new ArrayList<OperatorRequest>(); operatorRequests.add(new RegulateRequest(normalState)); response.operatorRequests = operatorRequests;</technical_language>

Target:
public Response processStats(BatchedOperatorStats batchedOperatorStats) { Response response = new Response(); int operatorId = batchedOperatorStats.getOperatorId(); long windowId = batchedOperatorStats.getCurrentWindowId(); currentWindowIds.put(operatorId, windowId); long minWindow = Long.MAX_VALUE; long maxWindow = Long.MIN_VALUE; for (Long value : currentWindowIds.values()) { if (value < minWindow) minWindow = value; if (value > maxWindow) maxWindow = value; } logger.debug("Operator min window max window {}", operatorId, minWindow, maxWindow); if (normalState && ((maxWindow - minWindow) > maxThreshold)) { logger.info("Setting suspend"); normalState = false; } else if (!normalState && ((maxWindow - minWindow) <= minThreshold)) { logger.info("Setting normal"); normalState = true; } if (!normalState) { List<OperatorRequest> operatorRequests = new ArrayList<OperatorRequest>(); operatorRequests.add(new InputSlowdownRequest()); response.operatorRequests = operatorRequests; } else { List<OperatorRequest> operatorRequests = new ArrayList<OperatorRequest>(); operatorRequests.add(new InputNormalRequest()); response.operatorRequests = operatorRequests; } return response; }
Source:
<code>public void deleteUser(TestUser testUser) { checkNotNull(testUser); if (testUser.getSession() != null) { String userId = testUser.getId(); authService.signOut(testUser.getSession()); deleteUser(testUser.getStudy(), userId); } <START> } <END></code><technical_language>user deleted if session</technical_language>

Target:
public void deleteUser(TestUser testUser) { checkNotNull(testUser); String userId = testUser.getId(); if (testUser.getSession() != null) { authService.signOut(testUser.getSession()); } deleteUser(testUser.getStudy(), userId); }
Source:
<code>synchronized void processResponse(TrieNodeRequest req) { dbWriteQueue.add(req); knownHashes.remove(req.nodeHash); nodesInserted++; for (TrieNodeRequest childRequest : req.createChildRequests()) { if (nodesQueue.size() > NODE_QUEUE_BEST_SIZE) { nodesQueue.addFirst(childRequest); } else { nodesQueue.add(childRequest); } <START> knownHashes.add(childRequest.nodeHash); <END> } }</code><technical_language>knownHashes is useless then, remove</technical_language>

Target:
synchronized void processResponse(TrieNodeRequest req) { dbWriteQueue.add(req); for (TrieNodeRequest childRequest : req.createChildRequests()) { if (nodesQueue.size() > NODE_QUEUE_BEST_SIZE) { nodesQueue.addFirst(childRequest); } else { nodesQueue.add(childRequest); } } }
Source:
<code>public void shouldRecordOnlyFirstErrorBeforeGetOnFailedCompletion() throws Exception { final Throwable expectedError = new Throwable(); TestConvertingFutureCallback testCallback = new TestConvertingFutureCallback(); testCallback.onCompletion(expectedError, null); testCallback.onCompletion(new RuntimeException(), null); testCallback.cancel(true); testCallback.onCompletion(null, "420"); assertEquals(0, testCallback.numberOfConversions()); try { <START> testCallback.get(); <END> } catch (ExecutionException e) { assertEquals(expectedError, e.getCause()); } }</code><technical_language>ditto, missing fail() call</technical_language>

Target:
public void shouldRecordOnlyFirstErrorBeforeGetOnFailedCompletion() throws Exception { final Throwable expectedError = new Throwable(); TestConvertingFutureCallback testCallback = new TestConvertingFutureCallback(); testCallback.onCompletion(expectedError, null); testCallback.onCompletion(new RuntimeException(), null); testCallback.cancel(true); testCallback.onCompletion(null, "420"); assertEquals(0, testCallback.numberOfConversions()); try { testCallback.get(); fail("Expected ExecutionException"); } catch (ExecutionException e) { assertEquals(expectedError, e.getCause()); } }
Source:
<code>public boolean setPoint(EntityPlayer player, WorldCoordinate coord) { if (!isTargetLoaded(player, coord, getLocalizationTag())) { return false; } IBlockState state = WorldPlugin.getBlockState(worldObj, coord.getPos()); if (RailcraftBlocks.WORLDSPIKE_POINT.isEqual(state)) { int xChunk = getPos().getX() >> 4; int zChunk = getPos().getZ() >> 4; int xPointChunk = coord.getX() >> 4; int zPointChunk = coord.getZ() >> 4; if (xChunk != xPointChunk && zChunk != zPointChunk) { ChatPlugin.sendLocalizedChatFromServer(player, "gui.railcraft.worldspike.pair.fail.alignment", getLocalizationTag(), state.getBlock().getUnlocalizedName()); return false; } int max = getMaxPointChunks(); if (Math.abs(xChunk - xPointChunk) >= max || Math.abs(zChunk - zPointChunk) >= max) { ChatPlugin.sendLocalizedChatFromServer(player, "gui.railcraft.worldspike.pair.fail.distance", getLocalizationTag(), <START> state.getBlock().getUnlocalizedName()); <END> return false; } pointPos = coord.getPos(); requestTicket(); sendUpdateToClient(); removeTarget(player); ChatPlugin.sendLocalizedChatFromServer(player, "gui.railcraft.worldspike.pair.success", getLocalizationTag()); return true; } ChatPlugin.sendLocalizedChatFromServer(player, "gui.railcraft.worldspike.pair.fail.invalid", getLocalizationTag()); return false; }</code><technical_language>wrong too</technical_language>

Target:
public boolean setPoint(EntityPlayer player, WorldCoordinate coord) { if (!isTargetLoaded(player, coord, getLocalizationTag())) { return false; } IBlockState state = WorldPlugin.getBlockState(worldObj, coord.getPos()); if (RailcraftBlocks.WORLDSPIKE_POINT.isEqual(state)) { int xChunk = getPos().getX() >> 4; int zChunk = getPos().getZ() >> 4; int xPointChunk = coord.getX() >> 4; int zPointChunk = coord.getZ() >> 4; if (xChunk != xPointChunk && zChunk != zPointChunk) { ChatPlugin.sendLocalizedChatFromServer(player, "gui.railcraft.worldspike.pair.fail.alignment", getLocalizationTag(), state.getBlock().getLocalizedName()); return false; } int max = getMaxPointChunks(); if (Math.abs(xChunk - xPointChunk) >= max || Math.abs(zChunk - zPointChunk) >= max) { ChatPlugin.sendLocalizedChatFromServer(player, "gui.railcraft.worldspike.pair.fail.distance", getLocalizationTag(), state.getBlock().getLocalizedName()); return false; } pointPos = coord.getPos(); requestTicket(); sendUpdateToClient(); removeTarget(player); ChatPlugin.sendLocalizedChatFromServer(player, "gui.railcraft.worldspike.pair.success", getLocalizationTag()); return true; } ChatPlugin.sendLocalizedChatFromServer(player, "gui.railcraft.worldspike.pair.fail.invalid", getLocalizationTag()); return false; }
Source:
<code>public void handle(Willie bot, Command cmd, CommandType type, Channel channel, User sender, String[] args) { ConfigurationBuilder cb = new ConfigurationBuilder(); TwitterFactory tf = new TwitterFactory(cb.build()); Twitter twitter = tf.getInstance(); try { Trends trend = twitter.getPlaceTrends(1); StringBuilder sb = new StringBuilder(); int trendsToShow = 5; int trendsToShowLeft = 5; for (Trend t : trend.getTrends()) { if (trendsToShow > 0) { trendsToShowLeft--; if (trendsToShowLeft == 0) { sb.append(t.getName()); } else { sb.append(t.getName() + ", "); } } else { bot.send("This command has been configured incorrectly! No trends have been set to be displayed.", channel, sender, CommandType.NOTICE_SENDER); } } if (trendsToShow > 1) { <START> bot.send("Top " + trendsToShow + " Trends on Twitter right now: " + sb.toString(), channel, sender, CommandType.SEND_CHANNEL); <END> } else { bot.send("The top Trend on Twitter right now is " + sb.toString(), channel, sender, CommandType.SEND_CHANNEL); } } catch (TwitterException e) { bot.send("TwitterException occured while executing this command!", channel, sender, CommandType.SEND_CHANNEL); e.printStackTrace(); } }</code><technical_language>needs type</technical_language>

Target:
public void handle(Willie bot, Command cmd, CommandType type, Channel channel, User sender, String[] args) { ConfigurationBuilder cb = new ConfigurationBuilder(); TwitterFactory tf = new TwitterFactory(cb.build()); Twitter twitter = tf.getInstance(); try { Trends trend = twitter.getPlaceTrends(1); StringBuilder sb = new StringBuilder(); int trendsToShow = 5; int trendsToShowLeft = 5; for (Trend t : trend.getTrends()) { if (trendsToShow > 0) { trendsToShowLeft--; if (trendsToShowLeft == 0) { sb.append(t.getName()); } else { sb.append(t.getName() + ", "); } } else { bot.send("This command has been configured incorrectly! No trends have been set to be displayed.", channel, sender, type); } } if (trendsToShow > 1) { bot.send("Top " + trendsToShow + " Trends on Twitter right now: " + sb.toString(), channel, sender, type); } else { bot.send("The top Trend on Twitter right now is " + sb.toString(), channel, sender, type); } } catch (TwitterException e) { bot.send("TwitterException occured while executing this command!", channel, sender, type); e.printStackTrace(); } }
Source:
<code><START> public static Predicate<AbstractProject> isBuildable() { <END> return new Predicate<AbstractProject>() { public boolean apply(AbstractProject job) { return job.isBuildable(); } }; }</code><technical_language>start supporting <code>Job</code>s instead of AbstractProject (workflow, inheritance, etc.)</technical_language>

Target:
public static Predicate<Job> isBuildable() { return new Predicate<Job>() { public boolean apply(Job job) { return job.isBuildable(); } }; }
Source:
<code>public void testFailure_unableToPullFile() throws DeviceNotAvailableException { doReturn(NATIVE_COVERAGE_DEVICE_PATH + "/some/path/to/coverage.gcda\n") .when(mMockDevice) .executeShellCommand(anyString()); doReturn(false).when(mMockDevice).pullFile(anyString(), any()); mCodeCoverageListener.testRunStarted(RUN_NAME, TEST_COUNT); try { Map<String, String> metric = new HashMap<>(); mCodeCoverageListener.testRunEnded( ELAPSED_TIME, TfMetricProtoUtil.upgradeConvert(metric)); <START> fail("Exception not thrown"); } catch (VerifyException expected) { } <END> verify(mFakeListener, never()) .testLog(anyString(), eq(LogDataType.COVERAGE), any(InputStreamSource.class)); }</code><technical_language>org.junit.Assert.assertThrows(..)</technical_language>

Target:
public void testFailure_unableToPullFile() throws DeviceNotAvailableException { doReturn("/data/misc/gcov/some/path/to/coverage.gcda\n") .when(mMockDevice) .executeShellCommand(anyString()); doReturn(false).when(mMockDevice).pullFile(anyString(), any()); mCodeCoverageListener.testRunStarted(RUN_NAME, TEST_COUNT); Map<String, String> metric = new HashMap<>(); assertThrows( VerifyException.class, () -> mCodeCoverageListener.testRunEnded( ELAPSED_TIME, TfMetricProtoUtil.upgradeConvert(metric))); assertThat(mFakeListener.getLogs()).isEmpty(); }
Source:
<code>public void refuseBalloonOnPPC() { <START> final ImportVmCommand<ImportVmParameters> c = setupDiskSpaceTest(0); <END> c.getParameters().getVm().setBalloonEnabled(true); c.getParameters().getVm().setClusterArch(ArchitectureType.ppc64); VDSGroup cluster = new VDSGroup(); cluster.setArchitecture(ArchitectureType.ppc64); cluster.setcompatibility_version(Version.getLast()); doReturn(cluster).when(c).getVdsGroup(); when(osRepository.isBalloonEnabled(c.getParameters().getVm().getVmOsId(), cluster.getcompatibility_version())).thenReturn(false); assertFalse(c.canDoAction()); assertTrue(c.getReturnValue() .getCanDoActionMessages() .contains(VdcBllMessages.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH.toString())); }</code><technical_language>problem argument passed setupDiskSpaceTest</technical_language>

Target:
public void refuseBalloonOnPPC() { final ImportVmCommand<ImportVmParameters> c = setupDiskSpaceTest(createParameters()); c.getParameters().getVm().setBalloonEnabled(true); c.getParameters().getVm().setClusterArch(ArchitectureType.ppc64); VDSGroup cluster = new VDSGroup(); cluster.setArchitecture(ArchitectureType.ppc64); cluster.setcompatibility_version(Version.getLast()); doReturn(cluster).when(c).getVdsGroup(); when(osRepository.isBalloonEnabled(c.getParameters().getVm().getVmOsId(), cluster.getcompatibility_version())).thenReturn(false); assertFalse(c.canDoAction()); assertTrue(c.getReturnValue() .getCanDoActionMessages() .contains(VdcBllMessages.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH.toString())); }
Source:
<code>private boolean isWrapperFunction(AstNode node) { if (!node.is(PythonGrammar.FUNCDEF) || node.equals(currentFunction)) { return false; } AstNode parentStatement = node.getParent().getParent(); List<AstNode> ancestorStatements = node.getFirstAncestor(PythonGrammar.FUNCDEF) .getFirstChild(PythonGrammar.SUITE) .getChildren(PythonGrammar.STATEMENT); return ancestorStatements.stream() .filter(statement -> statement != parentStatement) .filter(statement -> !isSimpleReturn(statement)) <START> .count() == 0; <END> }</code><technical_language>noneMatch()</technical_language>

Target:
private boolean isWrapperFunction(AstNode node) { if (!node.is(PythonGrammar.FUNCDEF) || node.equals(currentFunction)) { return false; } AstNode parentStatement = node.getParent().getParent(); List<AstNode> ancestorStatements = node.getFirstAncestor(PythonGrammar.FUNCDEF) .getFirstChild(PythonGrammar.SUITE) .getChildren(PythonGrammar.STATEMENT); return ancestorStatements.stream() .filter(statement -> statement != parentStatement) .allMatch(CognitiveComplexityFunctionCheck::isSimpleReturn); }
Source:
<code>public CompletionStage<Void> evict(int segment, K key) { ConcurrentMap<K, InternalCacheEntry<K, V>> entries = getMapForSegment(segment); if (entries == null) { return CompletableFutures.completedNull(); } ByRef<CompletionStage<Void>> byRef = new ByRef<>(CompletableFutures.completedNull()); entries.computeIfPresent(key, (o, entry) -> { byRef.set(handleEviction(entry, null, passivator.running(), null, this, <START> null)); <END> computeEntryRemoved(o, entry); return null; }); return byRef.get(); }</code><technical_language>Single line</technical_language>

Target:
public CompletionStage<Void> evict(int segment, K key) { ConcurrentMap<K, InternalCacheEntry<K, V>> entries = getMapForSegment(segment); if (entries == null) { return CompletableFutures.completedNull(); } ByRef<CompletionStage<Void>> evictionStageRef = new ByRef<>(CompletableFutures.completedNull()); entries.computeIfPresent(key, (o, entry) -> { evictionStageRef.set(handleEviction(entry, null, passivator.running(), null, this, null)); computeEntryRemoved(o, entry); return null; }); return evictionStageRef.get(); }
Source:
<code>public static void updateNetworkStatus(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo ni = cm.getActiveNetworkInfo(); boolean isAllowedConnectionType = false; if (ni == null) { Log.v(TAG, "Detected flight mode enabled."); isAllowedConnectionType = true; } else { <START> Log.v(TAG, "Detected flight mode disabled."); <END> boolean isWifi = ni.getType() == ConnectivityManager.TYPE_WIFI && ni.isConnected(); boolean isNetworkMetered = (Build.VERSION.SDK_INT >= 16) ? cm.isActiveNetworkMetered() : false; isAllowedConnectionType = isWifi && !isNetworkMetered; } LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context); Intent intent = new Intent(DeviceStateHolder.ACTION_DEVICE_STATE_CHANGED); intent.putExtra(DeviceStateHolder.EXTRA_IS_ALLOWED_NETWORK_CONNECTION, isAllowedConnectionType); lbm.sendBroadcast(intent); }</code><technical_language>This block nothing, needed other logging, logging is cryptic "detected mode disabled", easier in flight mode, in flight mode etc</technical_language>

Target:
public static void updateNetworkStatus(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo ni = cm.getActiveNetworkInfo(); boolean isAllowedConnectionType = false; if (ni == null) { Log.v(TAG, "In flight mode"); isAllowedConnectionType = true; } else { Log.v(TAG, "Not in flight mode"); boolean isWifi = ni.getType() == ConnectivityManager.TYPE_WIFI && ni.isConnected(); boolean isNetworkMetered = (Build.VERSION.SDK_INT >= 16) ? cm.isActiveNetworkMetered() : false; isAllowedConnectionType = isWifi && !isNetworkMetered; } LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context); Intent intent = new Intent(DeviceStateHolder.ACTION_DEVICE_STATE_CHANGED); intent.putExtra(DeviceStateHolder.EXTRA_IS_ALLOWED_NETWORK_CONNECTION, isAllowedConnectionType); lbm.sendBroadcast(intent); }
Source:
<code>public void isListEmpty() { ArrayNode json = new ArrayNode(factory); assertTrue(expressionEvaluatorMock.isListEmpty(json)); ObjectNode nestedNode = new ObjectNode(factory); json.add(nestedNode); <START> assertTrue(expressionEvaluatorMock.isListEmpty(json)); <END> nestedNode.set("notEmptyField", new TextNode("text")); assertFalse(expressionEvaluatorMock.isListEmpty(json)); }</code><technical_language>please inster this assertion: java nestedNode.set("emptyField", new TextNode("")); assertTrue(expressionEvaluatorMock.isListEmpty(json));</technical_language>

Target:
public void isListEmpty() { ArrayNode json = new ArrayNode(factory); assertTrue(expressionEvaluatorMock.isListEmpty(json)); ObjectNode nestedNode = new ObjectNode(factory); json.add(nestedNode); assertTrue(expressionEvaluatorMock.isListEmpty(json)); nestedNode.set("emptyField", new TextNode("")); assertTrue(expressionEvaluatorMock.isListEmpty(json)); nestedNode.set("notEmptyField", new TextNode("text")); assertFalse(expressionEvaluatorMock.isListEmpty(json)); }
Source:
<code><START> public Iterator<T> iterator() { <END> List<T> copy = Lists.newArrayList(underlying); Collections.shuffle(copy); return copy.iterator(); }</code><technical_language>Recommend this, for easier test guarantees property want. java public class UnstableOrderedIterable<T extends Comparable<? super T>> implements Iterable<T> { private final Iterator<ImmutableList<T>> underlying; public UnstableOrderedIterable(Collection<T> underlying) { this.underlying = Iterables.cycle(Collections2.orderedPermutations(underlying)).iterator(); } @Override public Iterator<T> iterator() { return underlying.next(); } }</technical_language>

Target:
public Iterator<T> iterator() { return orderingIterator.next().iterator(); }
Source:
<code>public void handleGet(ActionParameters params) throws ActionException { try { JSONObject result = new JSONObject(); if (params.getUser().isAdmin()) { result = service.getAdminAnnouncements(); } else { result = service.getAnnouncements(); } <START> System.out.println(result); <END> ResponseHelper.writeResponse(params, 200, result); } catch (Exception e) { LOG.error("Error", e); } }</code><technical_language>Remove sout</technical_language>

Target:
public void handleGet(ActionParameters params) throws ActionException { try { JSONObject result = new JSONObject(); if (params.getUser().isAdmin()) { result = service.getAdminAnnouncements(); } else { result = service.getAnnouncements(); } ResponseHelper.writeResponse(params, 200, result); } catch (Exception e) { throw new ActionException("Cannot get announcements", e); } }
Source:
<code>public CachedTableChecker(List<String> cachedTables) { <START> this.cacheAllTables = cachedTables.contains("*"); <END> if (cacheAllTables) { checkArgument(cachedTables.size() == 1, "Only '*' is expected when caching all tables"); this.cachedTableNames = ImmutableSet.of(); } else { this.cachedTableNames = cachedTables.stream() .map(CachingDirectoryLister::parseTableName) .collect(toImmutableSet()); } }</code><technical_language>s/this.cacheAllTables/cacheAllTables/g I prefer this reference variables</technical_language>

Target:
public CachedTableChecker(List<String> cachedTables) { cacheAllTables = cachedTables.contains("*"); if (cacheAllTables) { checkArgument(cachedTables.size() == 1, "Only '*' is expected when caching all tables"); this.cachedTableNames = ImmutableSet.of(); } else { this.cachedTableNames = cachedTables.stream() .map(CachingDirectoryLister::parseTableName) .collect(toImmutableSet()); } }
Source:
<code>public static Date tryToConvert(String dateAsString) { try { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX"); return dateFormat.parse(dateAsString); } catch (ParseException e) { <START> return null; <END> } }</code><technical_language>I swallow exception this give wrong impression. this date format is ES? If I throw exception in this case. else a loud warning try general purpose date converter so</technical_language>

Target:
public static Date tryToConvert(String dateAsString) { try { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX"); return dateFormat.parse(dateAsString); } catch (ParseException e) { return TimeComparator.toDate(dateAsString); } }
Source:
<code>public void generateImageWithRandomText() { String imageExtension = "png"; imagePath = imageFolder + "random_image." + imageExtension; String fontName = "TimesRoman"; int fontStyle = Font.BOLD; int fontSize = 20; Color fontColor = Color.BLUE; int textLength = 16; String imageText = getRandomText(textLength); String actionName = "generate random image"; String actionDescription = "generated image with random text: " + imageText; Graphics2D g2 = imageBuffer.createGraphics(); g2.setPaint(fontColor); Font font = new Font(fontName, fontStyle, fontSize); g2.setFont(font); FontMetrics fontMetrics = g2.getFontMetrics(); int stringWidth = fontMetrics.stringWidth(imageText); int stringHeight = fontMetrics.getAscent(); g2.drawString(imageText, (imageWidth - stringWidth) / 2, imageHeight / 2); try { if (ImageIO.write(imageBuffer, imageExtension, new File(imagePath))) { PageObjectLogging.logOnLowLevel(actionName, actionDescription, true); } } catch (IOException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>throwing RuntimeException here? image generation fails code dependent is fail</technical_language>

Target:
public void generateImageWithRandomText() { int fontStyle = Font.BOLD; int fontSize = 20; int textLength = 16; String fontName = "TimesRoman"; String imageExtension = "png"; String imageText = getRandomText(textLength); Color fontColor = Color.BLUE; this.imagePath = imageFolder + "random_image." + imageExtension; String actionName = "generate random image"; String actionDescription = "generated image with random text: " + imageText; Graphics2D g2 = imageBuffer.createGraphics(); g2.setPaint(fontColor); Font font = new Font(fontName, fontStyle, fontSize); g2.setFont(font); FontMetrics fontMetrics = g2.getFontMetrics(); int stringWidth = fontMetrics.stringWidth(imageText); g2.drawString(imageText, (imageWidth - stringWidth) / 2, imageHeight / 2); try { if (ImageIO.write(imageBuffer, imageExtension, new File(imagePath))) { PageObjectLogging.logOnLowLevel(actionName, actionDescription, true); } } catch (IOException e) { throw new RuntimeException(ExceptionUtils.getStackTrace(e)); } }
Source:
<code>public void testDestroyUnknownCacheAlias() throws Exception { clusteredCacheManagerBuilder.build(true).close(); PersistentCacheManager cacheManager = newCacheManagerBuilder().with(cluster(CLUSTER_URI).expecting()).build(true); <START> cacheManager.destroyCache("clustered-cache"); <END> }</code><technical_language>assert destruction successful somehow</technical_language>

Target:
public void testDestroyUnknownCacheAlias() throws Exception { clusteredCacheManagerBuilder.build(true).close(); PersistentCacheManager cacheManager = newCacheManagerBuilder().with(cluster(CLUSTER_URI).expecting()).build(true); cacheManager.destroyCache("clustered-cache"); try { cacheManager.createCache("clustered-cache", newCacheConfigurationBuilder(Long.class, String.class, newResourcePoolsBuilder() .with(clustered()))); fail("Expected exception as clustered store no longer exists"); } catch (IllegalStateException e) { assertThat(e.getMessage(), containsString("clustered-cache")); } }
Source:
<code>public boolean isEmpty() { BlockBuilder blockBuilder = blockBuilders.get(getGroupId()); <START> return blockBuilder == null || blockBuilder.getPositionCount() == 0; <END> }</code><technical_language>Change part of || assert (verify)</technical_language>

Target:
public boolean isEmpty() { BlockBuilder blockBuilder = blockBuilders.get(getGroupId()); verify(blockBuilder.getPositionCount() != 0); return false; }
Source:
<code>private boolean isGlusterEnabled() { <START> VDSGroup vdsGroup = getVdsGroupDAO().get(getVdsGroupId()); <END> return (vdsGroup.supportsGlusterService()); }</code><technical_language>please getVdsGroup()</technical_language>

Target:
private boolean isGlusterEnabled() { return (getVdsGroup().supportsGlusterService()); }
Source:
<code>protected StreamsDatum newDatum(ObjectNode item) { <START> return new StreamsDatum(item, item.get("id").asText(), new DateTime(item.get("timestamp").asText())); <END> }</code><technical_language>I sense check for presence of id timestamp StreamsDatum constructors depending presence. This assumes a lot item currently is</technical_language>

Target:
protected StreamsDatum newDatum(ObjectNode item) { try { String id = null; if( item.get("id") != null ) id = item.get("id").asText(); DateTime timestamp = null; if( item.get("timestamp") != null ) timestamp = new DateTime(item.get("timestamp").asText()); if( id != null && timestamp != null ) return new StreamsDatum(item, id, timestamp); else if( id != null ) return new StreamsDatum(item, id); else if( timestamp != null ) return new StreamsDatum(item, null, timestamp); else return new StreamsDatum(item); } catch( Exception e ) { return new StreamsDatum(item); } }
Source:
<code>private Map<String, Object> peopleApiConnect(final String userLogin, final String urlEndPoint) throws NotFoundException, BadRequestException, InternalServerErrorException { String fullRequest = urlEndPoint + userLogin; if (urlEndPoint.equals(PEOPLE_ENDPOINT_PROFILE)) { fullRequest += "?format=json"; } try { InputStream resourceStream = UserServiceTGImpl.class.getClassLoader() <START> .getResourceAsStream("people_basic_auth.txt"); <END> String auth = convertStreamToString(resourceStream); URL url = new URL(fullRequest); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setRequestMethod("GET"); conn.setRequestProperty("Authorization", auth); ObjectMapper mapper = new ObjectMapper(); if (conn.getResponseCode() == 200) { Map<String, Object> providerResponse = mapper.readValue(conn.getInputStream(), Map.class); return providerResponse; } else { throw new NotFoundException(i18n.t("User not found")); } } catch (JsonParseException e) { throw new BadRequestException(OPERATION_FAILED); } catch (MalformedURLException e) { throw new BadRequestException(e.getMessage()); } catch (IOException e) { System.err.println("An internal server error ocurred!"); System.err.println(e.getMessage()); throw new InternalServerErrorException(i18n.t("An internal server error ocurred.")); } }</code><technical_language>@tsr-thulio please move this root src/main/resources dir</technical_language>

Target:
private Map<String, Object> peopleApiConnect(final String userLogin, final String urlEndPoint) throws NotFoundException, BadRequestException, InternalServerErrorException { String fullRequest = urlEndPoint + userLogin; if (urlEndPoint.equals(PEOPLE_ENDPOINT_PROFILE)) { fullRequest += "?format=json"; } try { InputStream resourceStream = UserServiceTGImpl.class.getClassLoader() .getResourceAsStream("people_basic_auth.txt"); String auth = convertStreamToString(resourceStream); URL url = new URL(fullRequest); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setRequestMethod("GET"); conn.setRequestProperty("Authorization", auth); ObjectMapper mapper = new ObjectMapper(); if (conn.getResponseCode() == 200) { Map<String, Object> providerResponse = mapper.readValue(conn.getInputStream(), Map.class); return providerResponse; } else { throw new NotFoundException(i18n.t("User not found")); } } catch (JsonParseException e) { throw new BadRequestException(OPERATION_FAILED); } catch (MalformedURLException e) { throw new BadRequestException(e.getMessage()); } catch (IOException e) { log.info("An internal server error ocurred!"); log.info(e.getMessage()); throw new InternalServerErrorException(i18n.t("An internal server error ocurred.")); } }
Source:
<code>public DataType<?> createType() { if (baseTypeName.equalsIgnoreCase(ArrayType.NAME)) { if (parameters.size() == 0) { return new ArrayType<>(UndefinedType.INSTANCE); } DataType<?> innerType = parameters.get(0).createType(); return new ArrayType<>(innerType); } if (baseTypeName.equalsIgnoreCase(ObjectType.NAME)) { var builder = ObjectType.builder(); for (int i = 0; i < parameters.size() - 1;) { var valTypeSignature = parameters.get(i + 1); final String innerTypeName; if (valTypeSignature instanceof NamedTypeSignature) { innerTypeName = ((NamedTypeSignature) valTypeSignature).parameterName(); } else { innerTypeName = String.valueOf(i); <START> } <END> builder.setInnerType(innerTypeName, valTypeSignature.createType()); i += 2; } return builder.build(); } return DataTypes.ofName(baseTypeName); }</code><technical_language>This happen. add assertion</technical_language>

Target:
public DataType<?> createType() { if (baseTypeName.equalsIgnoreCase(ArrayType.NAME)) { if (parameters.size() == 0) { return new ArrayType<>(UndefinedType.INSTANCE); } DataType<?> innerType = parameters.get(0).createType(); return new ArrayType<>(innerType); } if (baseTypeName.equalsIgnoreCase(ObjectType.NAME)) { var builder = ObjectType.builder(); for (int i = 0; i < parameters.size() - 1;) { var valTypeSignature = parameters.get(i + 1); assert valTypeSignature instanceof ObjectParameterTypeSignature : "the inner type signature must be named (must have ObjectParameterTypeSignature type)"; var innerTypeName = ((ObjectParameterTypeSignature) valTypeSignature).parameterName(); builder.setInnerType(innerTypeName, valTypeSignature.createType()); i += 2; } return builder.build(); } return DataTypes.ofName(baseTypeName); }
Source:
<code>public void cancelLongPress() { super.cancelLongPress(); <START> if (isSensorAvailable) { <END> binding.bearingButton.cancelLongPress(); } binding.answerText.cancelLongPress(); }</code><technical_language>Do need this check? I redundant</technical_language>

Target:
public void cancelLongPress() { super.cancelLongPress(); binding.bearingButton.cancelLongPress(); binding.answerText.cancelLongPress(); }
Source:
<code>public static boolean wouldBeSingleBreakend(final byte[] bases) { if ( bases.length <= 1 ) return false; else { <START> return bases[0] == '.' || bases[bases.length - 1] == '.'; <END> } }</code><technical_language>nice constants instead of magic characters > < [ ]</technical_language>

Target:
public static boolean wouldBeSingleBreakend(final byte[] bases) { if ( bases.length <= 1 ) return false; else { return bases[0] == SINGLE_BREAKEND_INDICATOR || bases[bases.length - 1] == SINGLE_BREAKEND_INDICATOR; } }
Source:
<code>int getTop(final HTMLElement element) { <START> final String topString = element.style.getPropertyValue("top") <END> .replace("px", ""); if (StringUtils.isEmpty(topString)) { return 0; } return Integer.valueOf(topString); }</code><technical_language>Please introduce "top" class constant getTop setTop work property. Please do for "px"</technical_language>

Target:
int getTop(final HTMLElement element) { final String topString = element.style.getPropertyValue(TOP) .replace(PX, ""); if (StringUtils.isEmpty(topString)) { return 0; } return Integer.valueOf(topString); }
Source:
<code>public void spec113_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront_shouldFailBy_expectingOnError() throws Throwable { requireTestFailure(new ThrowingRunnable() { @Override public void run() throws Throwable { customPublisherVerification(new Publisher<Integer>() { @Override public void subscribe(final Subscriber<? super Integer> s) { <START> final Random rnd = new Random(); <END> s.onSubscribe(new Subscription() { @Override public void request(long n) { for (int i = 0; i < n; i++) { s.onNext(rnd.nextInt()); } } @Override public void cancel() { } }); } }).spec113_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront(); } }, "Expected elements to be signaled in the same sequence to 1st and 2nd subscribers: Lists differ at element " ); }</code><technical_language>Put this in Subscription? (it's thread safe afaik)</technical_language>

Target:
public void spec113_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront_shouldFailBy_expectingOnError() throws Throwable { requireTestFailure(new ThrowingRunnable() { @Override public void run() throws Throwable { customPublisherVerification(new Publisher<Integer>() { @Override public void subscribe(final Subscriber<? super Integer> s) { s.onSubscribe(new Subscription() { final Random rnd = new Random(); @Override public void request(long n) { for (int i = 0; i < n; i++) { s.onNext(rnd.nextInt()); } } @Override public void cancel() { } }); } }).spec113_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront(); } }, "Expected elements to be signaled in the same sequence to 1st and 2nd subscribers: Lists differ at element "); }
Source:
<code>public PackingPlan(String id, Set<ContainerPlan> containers, Resource resource) { this.id = id; this.containers = containers; this.resource = resource; <START> containersMap = new HashMap<>(); <END> for (ContainerPlan containerPlan : containers) { containersMap.put(containerPlan.getId(), containerPlan); } }</code><technical_language>mentioned in #1324, this map a immutable map</technical_language>

Target:
public PackingPlan(String id, Set<ContainerPlan> containers, Resource resource) { this.id = id; this.containers = ImmutableSet.copyOf(containers); this.resource = resource; containersMap = new HashMap<>(); for (ContainerPlan containerPlan : containers) { containersMap.put(containerPlan.getId(), containerPlan); } }
Source:
<code>public void projectOpened() { HaxeModuleSettings moduleSettings = HaxeModuleSettings.getInstance(mMyModule); <START> String openFLPath = moduleSettings.getOpenFLPath(); <END> setOpenFLPath(openFLPath); }</code><technical_language>If user openfl, register a listener for module. add functionality module settings listener (or dialog 'save' handler) anyway, detect module's "project.xml" file name changes, invalidate cache point. (It call completion contributor clear cache entry, call this listen correct file. depend this listener that, a bit depending a side effect.)</technical_language>

Target:
public void projectOpened() { moduleSettings = HaxeModuleSettings.getInstance(mMyModule); String openFLPath = moduleSettings.getOpenFLPath(); setOpenFLPath(openFLPath); }