auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void test_getDeveloperDecertifications_CompletesWithoutError() throws EntityRetrievalException, JsonProcessingException, EntityCreationException{ <START> SecurityContextHolder.getContext().setAuthentication(adminUser); <END> DeveloperDecertificationResponse resp = searchViewController.getDeveloperDecertifications(); assertTrue("DeveloperDecertificationResponse should have size == 2 but has size " + resp.getDeveloperDecertificationResult().size(), resp.getDeveloperDecertificationResult().size() == 2); }</code><technical_language>Again, authenticated user, why</technical_language>

Target:
public void test_getDeveloperDecertifications_CompletesWithoutError() throws EntityRetrievalException, JsonProcessingException, EntityCreationException{ DeveloperDecertificationResponse resp = searchViewController.getDeveloperDecertifications(); assertTrue("DeveloperDecertificationResponse should have size == 2 but has size " + resp.getDeveloperDecertificationResult().size(), resp.getDeveloperDecertificationResult().size() == 2); }
Source:
<code><START> public BigInteger getYear() { <END> return year; }</code><technical_language>Is reason for arbitrary precision arithmetic here? Long.MAX_VALUE is lifetime of 673 million universes</technical_language>

Target:
public long getYear() { return year; }
Source:
<code>public void testRequestNetworkCallback() { final TestNetworkCallback callback = new TestNetworkCallback(); try { <START> mCm.requestNetwork(new NetworkRequest.Builder() .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) .build(), callback); <END> Network internetNetwork = callback.waitForAvailable(); assertNotNull("Did not receive NetworkCallback.onAvailable for INTERNET", internetNetwork); } catch (InterruptedException e) { fail("Broadcast receiver or NetworkCallback wait was interrupted."); } finally { mCm.unregisterNetworkCallback(callback); } }</code><technical_language>move this out of try/catch block? I throw</technical_language>

Target:
public void testRequestNetworkCallback() { final TestNetworkCallback callback = new TestNetworkCallback(); mCm.requestNetwork(new NetworkRequest.Builder() .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) .build(), callback); try { Network internetNetwork = callback.waitForAvailable(); assertNotNull("Did not receive NetworkCallback#onAvailable for INTERNET", internetNetwork); } catch (InterruptedException e) { fail("NetworkCallback wait was interrupted."); } finally { mCm.unregisterNetworkCallback(callback); } }
Source:
<code>public void testDecimal() throws Exception { assertExpression("DECIMAL '12.34'", new DecimalLiteral("12.34")); assertExpression("DECIMAL '12.'", new DecimalLiteral("12.")); assertExpression("DECIMAL '12'", new DecimalLiteral("12")); assertExpression("DECIMAL '.34'", new DecimalLiteral(".34")); assertExpression("DECIMAL '+12.34'", new DecimalLiteral("+12.34")); assertExpression("DECIMAL '+12'", new DecimalLiteral("+12")); assertExpression("DECIMAL '-12.34'", new DecimalLiteral("-12.34")); assertExpression("DECIMAL '-12'", new DecimalLiteral("-12")); assertExpression("DECIMAL '+.34'", new DecimalLiteral("+.34")); assertExpression("DECIMAL '-.34'", new DecimalLiteral("-.34")); assertExpression("123.", new DecimalLiteral("123.")); assertExpression("123.0", new DecimalLiteral("123.0")); <START> assertExpression(".5", new DecimalLiteral(".5")); <END> assertExpression("123.5", new DecimalLiteral("123.5")); }</code><technical_language>I this is a valid literal in SQL, a bug for Presto accept them</technical_language>

Target:
public void testDecimal() throws Exception { assertExpression("DECIMAL '12.34'", new DecimalLiteral("12.34")); assertExpression("DECIMAL '12.'", new DecimalLiteral("12.")); assertExpression("DECIMAL '12'", new DecimalLiteral("12")); assertExpression("DECIMAL '.34'", new DecimalLiteral(".34")); assertExpression("DECIMAL '+12.34'", new DecimalLiteral("+12.34")); assertExpression("DECIMAL '+12'", new DecimalLiteral("+12")); assertExpression("DECIMAL '-12.34'", new DecimalLiteral("-12.34")); assertExpression("DECIMAL '-12'", new DecimalLiteral("-12")); assertExpression("DECIMAL '+.34'", new DecimalLiteral("+.34")); assertExpression("DECIMAL '-.34'", new DecimalLiteral("-.34")); assertInvalidExpression("123.", "Unexpected decimal literal: 123."); assertInvalidExpression("123.0", "Unexpected decimal literal: 123.0"); assertInvalidExpression(".5", "Unexpected decimal literal: .5"); assertInvalidExpression("123.5", "Unexpected decimal literal: 123.5"); }
Source:
<code>public void createsHostsConfiguration() throws IOException { Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS); final File path = this.temp.newFolder(); final SSHD sshd = new SSHD(path); try { <START> sshd.start(); <END> final File key = this.temp.newFile(); FileUtils.write(key, sshd.key()); this.manifest(path, sshd.login(), sshd.port(), key); final String host = "host"; final int sport = 567; final String server = "server"; final File fhosts = this.hosts(path, host); new Nginx().update(host, 1234, server, sport); MatcherAssert.assertThat( FileUtils.readFileToString(fhosts), Matchers.equalTo( Joiner.on('\n').join( "upstream example_servers {", " server 10.0.0.1:80;", " server 10.0.0.2:80;", String.format(" server %s:%d;", server, sport), "}" ) ) ); } finally { sshd.stop(); } }</code><technical_language>I this line try. is need stop if failed start, right</technical_language>

Target:
public void createsHostsConfiguration() throws IOException { Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS); final SSHD sshd = new SSHD(temp); sshd.start(); final File key = File.createTempFile("ssh", "key", temp); FileUtils.write(key, sshd.key()); this.manifest(temp, sshd.login(), sshd.port(), key); final String host = "host"; final int sport = 567; final String server = "server"; final File fhosts = this.hosts(temp, host); try { new Nginx().update(host, 1234, server, sport); } finally { sshd.stop(); } MatcherAssert.assertThat( FileUtils.readFileToString(fhosts), Matchers.equalTo( Joiner.on('\n').join( "upstream example_servers {", " server 10.0.0.1:80;", " server 10.0.0.2:80;", String.format(" server %s:%d;", server, sport), "}" ) ) ); }
Source:
<code>public boolean check(final String login) throws IOException { <START> return false; <END> }</code><technical_language>a bug, throw UnsupportedOperationException a method is implemented</technical_language>

Target:
public boolean check(final String login) throws IOException { throw new UnsupportedOperationException(); }
Source:
<code>WebSocketConnection(final URI serverUri) { this.serverUri = serverUri; pingSender = Timers.fixedRateTimer("websocket-ping-sender") .period(45, TimeUnit.SECONDS) .delay(45, TimeUnit.SECONDS) .task( <START> () -> { <END> if (!client.isOutputClosed()) { client .sendPing(ByteBuffer.wrap("Ping".getBytes(StandardCharsets.UTF_8))) .exceptionally(logWebSocketError("Failed to send ping.")); } }); }</code><technical_language>If ping sent, connection is closed? want users submit bug reports this happens? I suspect want no-op if ping sent</technical_language>

Target:
WebSocketConnection(final URI serverUri) { this.serverUri = serverUri; pingSender = Timers.fixedRateTimer("websocket-ping-sender") .period(45, TimeUnit.SECONDS) .delay(45, TimeUnit.SECONDS) .task( () -> { if (!client.isOutputClosed()) { client .sendPing(ByteBuffer.allocate(0)) .exceptionally(logWebSocketError(Level.INFO, "Failed to send ping.")); } }); }
Source:
<code>public void testEventName() { ITmfTrace trace = initializeTrace(testTrace1); XmlStateSystemModule module = initializeModule(TmfXmlTestFiles.ATTRIBUTE_FILE); try { module.setTrace(trace); module.schedule(); module.waitForCompletion(); ITmfStateSystem ss = module.getStateSystem(); assertNotNull(ss); List<Integer> quarks = ss.getQuarks("*"); assertEquals(2, quarks.size()); for (Integer quark : quarks) { String name = ss.getAttributeName(quark); switch (name) { case "test": { <START> int[] expectedStarts = { 1, 5, 7 }; <END> ITmfStateValue[] expectedValues = { TmfStateValue.newValueInt(1), TmfStateValue.newValueInt(2) }; verifyStateIntervals("test", ss, quark, expectedStarts, expectedValues); } break; case "test1": { int[] expectedStarts = { 1, 3, 7, 7 }; ITmfStateValue[] expectedValues = { TmfStateValue.nullValue(), TmfStateValue.newValueInt(1), TmfStateValue.newValueInt(2) }; verifyStateIntervals("test1", ss, quark, expectedStarts, expectedValues); } break; default: fail("Wrong attribute name " + name); break; } } } catch (TmfAnalysisException | AttributeNotFoundException | StateSystemDisposedException e) { fail(e.getMessage()); } finally { module.dispose(); trace.dispose(); } }</code><technical_language>final? considered magic numbers</technical_language>

Target:
public void testEventName() { ITmfTrace trace = initializeTrace(testTrace1); XmlStateSystemModule module = initializeModule(TmfXmlTestFiles.ATTRIBUTE_FILE); try { module.setTrace(trace); module.schedule(); module.waitForCompletion(); ITmfStateSystem ss = module.getStateSystem(); assertNotNull(ss); List<Integer> quarks = ss.getQuarks("*"); assertEquals(2, quarks.size()); for (Integer quark : quarks) { String name = ss.getAttributeName(quark); switch (name) { case "test": { final int[] expectedStarts = { 1, 5, 7 }; ITmfStateValue[] expectedValues = { TmfStateValue.newValueInt(1), TmfStateValue.newValueInt(2) }; verifyStateIntervals("test", ss, quark, expectedStarts, expectedValues); } break; case "test1": { final int[] expectedStarts = { 1, 3, 7, 7 }; ITmfStateValue[] expectedValues = { TmfStateValue.nullValue(), TmfStateValue.newValueInt(1), TmfStateValue.newValueInt(2) }; verifyStateIntervals("test1", ss, quark, expectedStarts, expectedValues); } break; default: fail("Wrong attribute name " + name); break; } } } catch (TmfAnalysisException | AttributeNotFoundException | StateSystemDisposedException e) { fail(e.getMessage()); } finally { module.dispose(); trace.dispose(); } }
Source:
<code>private void createNonUIThreadControl(Composite composite, int columns) { PixelConverter pixelConverter= new PixelConverter(composite); String str= PreferencesMessages.CodeAssistAdvancedConfigurationBlock_nonUIThread; Button checkbox = addCheckBox(composite, str, PREF_CODEASSIST_NONUITHREAD_COMPUTATION, new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() }, pixelConverter.convertWidthInCharsToPixels(7)); checkbox.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, columns, 1)); CompletionProposalComputerRegistry registry= CompletionProposalComputerRegistry.getDefault(); if (registry.computingCompletionRequiresUIThread()) { checkbox.setSelection(false); checkbox.setEnabled(false); Label label = new Label(composite, SWT.NONE); <START> label.setText(NLS.bind(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_nonUIThread_computersRequiringUIThread, <END> registry.getComputersRequiringUIThreadNames().collect(Collectors.joining(",")))); GridData layoutData= new GridData(GridData.FILL, GridData.FILL, true, false, columns, 1); layoutData.horizontalIndent = 30; label.setLayoutData(layoutData); label.setEnabled(false); } }</code><technical_language>Messages.format(...) instead if NLS.bind(...). next method #createDefaultLabel for example</technical_language>

Target:
private void createNonUIThreadControl(Composite composite, int columns) { PixelConverter pixelConverter= new PixelConverter(composite); String str= PreferencesMessages.CodeAssistAdvancedConfigurationBlock_nonUIThread; Button checkbox = addCheckBox(composite, str, PREF_CODEASSIST_NONUITHREAD_COMPUTATION, new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() }, pixelConverter.convertWidthInCharsToPixels(7)); checkbox.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, columns, 1)); CompletionProposalComputerRegistry registry= CompletionProposalComputerRegistry.getDefault(); if (registry.computingCompletionRequiresUIThread()) { checkbox.setSelection(false); checkbox.setEnabled(false); Label label = new Label(composite, SWT.NONE); label.setText(Messages.format(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_nonUIThread_computersRequiringUIThread, registry.getComputersRequiringUIThreadNames().collect(Collectors.joining(",")))); GridData layoutData= new GridData(GridData.FILL, GridData.FILL, true, false, columns, 1); layoutData.horizontalIndent = 30; label.setLayoutData(layoutData); label.setEnabled(false); } }
Source:
<code>public void message(PubNub pubnub, PNMessageResult message) { <START> Exchange exchange = new DefaultExchange(endpoint, endpoint.getExchangePattern()); <END> Message inmessage = exchange.getIn(); inmessage.setBody(message); inmessage.setHeader(TIMETOKEN, message.getTimetoken()); inmessage.setHeader(CHANNEL, message.getChannel()); try { getProcessor().process(exchange); } catch (Exception e) { exchange.setException(e); getExceptionHandler().handleException("Error processing exchange", exchange, e); } }</code><technical_language>Favor creating exchange endpoint, endpoint.createExchange(...)</technical_language>

Target:
public void message(PubNub pubnub, PNMessageResult message) { Exchange exchange = endpoint.createExchange(); Message inmessage = exchange.getIn(); inmessage.setBody(message); inmessage.setHeader(TIMETOKEN, message.getTimetoken()); inmessage.setHeader(CHANNEL, message.getChannel()); try { getProcessor().process(exchange); } catch (Exception e) { exchange.setException(e); getExceptionHandler().handleException("Error processing exchange", exchange, e); } }
Source:
<code>public void onProjectCreated(CreateProjectEvent event) { final ProjectConfigDto projectConfig = event.getProjectConfig(); if (projectConfig == null) { return; } if (view.isGoIntoActivated()) { view.resetGoIntoMode(); } final ProjectNode node = nodeManager.wrap(projectConfig); view.addNode(null, node); view.select(node, false); <START> if (!projectConfig.getProblems().isEmpty() || Constants.BLANK_ID.equals(projectConfig.getType())) { <END> notificationManager.notify(locale.projectExplorerInvalidProjectDetected(), locale.projectExplorerDetectedUnconfiguredProject(), projectConfig); askUserToSetUpProject(projectConfig); } }</code><technical_language>if project BLANK normal behavior</technical_language>

Target:
public void onProjectCreated(CreateProjectEvent event) { final ProjectConfigDto projectConfig = event.getProjectConfig(); if (projectConfig == null) { return; } if (view.isGoIntoActivated()) { view.resetGoIntoMode(); } final ProjectNode node = nodeManager.wrap(projectConfig); view.addNode(null, node); view.select(node, false); if (!projectConfig.getProblems().isEmpty()) { notificationManager.notify(locale.projectExplorerInvalidProjectDetected(), locale.projectExplorerDetectedUnconfiguredProject(), projectConfig); askUserToSetUpProject(projectConfig); } }
Source:
<code>void migrateDatabase() { <START> <END> Flyway flyway = Flyway.configure() .dataSource(dataSource) .baselineOnMigrate(true) .load(); flyway.migrate(); }</code><technical_language>IMHO a check dataSource == null done a try/catch for NPEs, user a reasonable error message. finally result in EJBException thrown, deployment fails</technical_language>

Target:
void migrateDatabase() { if (dataSource == null){ throw new NullPointerException("Failed to migrate, cannot connect to database"); } Flyway flyway = Flyway.configure() .dataSource(dataSource) .baselineOnMigrate(true) .load(); flyway.migrate(); }
Source:
<code>public String toString() { <START> return "CdpLinkTopologyEntity{" + <END> "id=" + id + ", nodeId=" + nodeId + ", cdpCacheIfIndex=" + cdpCacheIfIndex + ", cdpInterfaceName='" + cdpInterfaceName + '\'' + ", cdpCacheAddress='" + cdpCacheAddress + '\'' + ", cdpCacheDeviceId='" + cdpCacheDeviceId + '\'' + ", cdpCacheDevicePort='" + cdpCacheDevicePort + '\'' + '}'; }</code><technical_language>this a couple of times now, Google Guava's ToStringHelper instead? addressed in a separate issue/pr</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("nodeId", nodeId) .add("cdpCacheIfIndex", cdpCacheIfIndex) .add("cdpInterfaceName", cdpInterfaceName) .add("cdpCacheAddress", cdpCacheAddress) .add("cdpCacheDeviceId", cdpCacheDeviceId) .add("cdpCacheDevicePort", cdpCacheDevicePort) .toString(); }
Source:
<code>public static <T, S> Stream<S> map( List<T> values, Function<T, S> mapper, Executor executor, int concurrency) { int size = values.size(); if (size <= 1 || concurrency == 1) { return values.stream().map(mapper); } List<CompletableFuture<S>> futures = Lists.newArrayListWithCapacity(size); for (int i = 0; i < size; i++) { futures.add(new CompletableFuture<>()); } if (size < concurrency) { concurrency = size; } AtomicInteger nextValueToProcess = new AtomicInteger(0); for (int i = 0; i < concurrency; i++) { executor.execute(() -> { int currentValueToProcess; while ((currentValueToProcess = nextValueToProcess.getAndIncrement()) < size) { T value = values.get(currentValueToProcess); CompletableFuture<S> future = futures.get(currentValueToProcess); try { future.complete(mapper.apply(value)); } catch (Exception e) { <START> future.completeExceptionally(e); <END> } } }); } return streamAllUnchecked(futures); }</code><technical_language>want stop executing tasks if encounter error right? in this case stream is throw exception</technical_language>

Target:
public static <T, S> Stream<S> map( List<T> values, Function<T, S> mapper, Executor executor, int concurrency) { int size = values.size(); if (size <= 1 || concurrency == 1) { return values.stream().map(mapper); } Map<T, CompletableFuture<S>> futuresByValue = values.stream() .collect(Collectors.toMap(Function.identity(), value -> new CompletableFuture<>())); Queue<T> valueQueue = new ConcurrentLinkedQueue<T>(values); if (size < concurrency) { concurrency = size; } for (int i = 0; i < concurrency; i++) { executor.execute(() -> runOperationsAndUpdateFutures(futuresByValue, valueQueue, mapper)); } return streamAllUnchecked(futuresByValue.values()); }
Source:
<code>public void testFilenameBatchedNotUnique() throws Exception { ExportToFileClient client = new ExportToFileClient(); Properties props = new Properties(); props.put("nonce", Long.toString(System.currentTimeMillis())); props.put("type", "csv"); props.put("outdir", m_dir); props.put("period", "1"); props.put("with-schema", "true"); props.put("batched", "true"); props.put("uniquenames", "false"); client.configure(props); final AdvertisedDataSource source = constructTestSource(false, 0); final ExportToFileClient.ExportToFileDecoder decoder = client.constructExportDecoder(source); long l = System.currentTimeMillis(); vtable.addRow(l, l, l, 0, l, l, (byte) 1, (short) 2, 3, 4, 5.5, 6, "xx", new BigDecimal(88), GEOG_POINT, GEOG); vtable.advanceRow(); byte[] rowBytes = ExportEncoder.encodeRow(vtable, "mytable", 0, 1L); ExportRow row = ExportRow.decodeRow(null, 0, 0L, rowBytes); decoder.onBlockStart(row); decoder.processRow(row); decoder.onBlockCompletion(row); boolean validName = true; final File dir = new File(m_dir); final File[] subdirs = dir.listFiles(); List<File> remainingFiles = new ArrayList<>(); if (subdirs != null) { for (File file : subdirs) { if (file.isDirectory()) { remainingFiles.addAll(Arrays.asList(file.listFiles())); } else if (!file.getName().matches("\\d\\-mytable.*\\.[a-z]{3,4}")) { validName = false; break; } } for (File file : remainingFiles) { <START> if (!file.getName().matches("\\d\\-mytable.*\\.[a-z]{3,4}")) { <END> System.out.println(file.getName()); validName = false; break; } } } assertTrue(validName); }</code><technical_language>I assume hostId is 0 in this test. In case, uniquenames, verify filename "(0)"</technical_language>

Target:
public void testFilenameBatchedNotUnique() throws Exception { ExportToFileClient client = new ExportToFileClient(); Properties props = new Properties(); props.put("nonce", Long.toString(System.currentTimeMillis())); props.put("type", "csv"); props.put("outdir", m_dir); props.put("period", "1"); props.put("with-schema", "true"); props.put("batched", "true"); props.put("uniquenames", "false"); client.configure(props); final AdvertisedDataSource source = constructTestSource(false, 0); final ExportToFileClient.ExportToFileDecoder decoder = client.constructExportDecoder(source); long l = System.currentTimeMillis(); vtable.addRow(l, l, l, 0, l, l, (byte) 1, (short) 2, 3, 4, 5.5, 6, "xx", new BigDecimal(88), GEOG_POINT, GEOG); vtable.advanceRow(); byte[] rowBytes = ExportEncoder.encodeRow(vtable, "mytable", 0, 1L); ExportRow row = ExportRow.decodeRow(null, 0, 0L, rowBytes); decoder.onBlockStart(row); decoder.processRow(row); decoder.onBlockCompletion(row); boolean validName = true; final File dir = new File(m_dir); final File[] subdirs = dir.listFiles(); List<File> allFiles = new ArrayList<>(); if (subdirs != null) { for (File file : subdirs) { if (file.isDirectory()) { allFiles.addAll(Arrays.asList(file.listFiles())); } else { allFiles.add(file); } } for (File file : allFiles) { if (!(file.getName().matches("\\d\\-mytable\\.[a-z]{3}") || file.getName().matches("\\d\\-mytable-schema\\.json"))) { validName = false; break; } } } assertTrue(validName); }
Source:
<code><START> public boolean removeVertex(final V v) { <END> final Set<Tuple2<V, I>> edges = adjacent.remove(v); if (edges != null) { inDegrees.remove(v); for (final Tuple2<V, I> edge : edges) { final V neighbor = (V) edge.get(0); final int inDegree = inDegrees.get(neighbor) - 1; inDegrees.put(neighbor, inDegree); if (inDegree == 0) { rootVertices.add(neighbor); } } rootVertices.remove(v); return true; } else { LOG.log(Level.WARNING, "The vertex {0} does exists", new Object[]{v}); return false; } }</code><technical_language>This method a bug: need remove vertex v parent vertices. But, this code remove parent vertices</technical_language>

Target:
public boolean removeVertex(final V v) { final Map<V, I> edges = adjacent.remove(v); if (edges != null) { inDegrees.remove(v); for (final Map.Entry<V, I> edge : edges.entrySet()) { final V neighbor = edge.getKey(); final int inDegree = inDegrees.get(neighbor) - 1; inDegrees.put(neighbor, inDegree); if (inDegree == 0) { rootVertices.add(neighbor); } } rootVertices.remove(v); for (Map.Entry<V, Map<V, I>> entry : adjacent.entrySet()) { entry.getValue().remove(v); } return true; } else { LOG.log(Level.WARNING, "The vertex {0} does exists", new Object[]{v}); return false; } }
Source:
<code>public SummaryCard(String webUrl) throws CardBuilderException { this.cardType = CardType.SUMMARY; <START> webUrl(webUrl); <END> MetaTagModel metaTagModel = MetaTagExtractor.getMetaTags(this.webUrl); summary(new Summary(metaTagModel)); setAppLinkIos(metaTagModel.getAppLinkIos()); setAppLinkAndroid(metaTagModel.getAppLinkAndroid()); }</code><technical_language>super()</technical_language>

Target:
public SummaryCard(String webUrl) throws CardBuilderException { super(webUrl); this.cardType = CardType.SUMMARY; summary(new Summary(this.getMetaTagModel())); }
Source:
<code>private Set<Achievement> loadMulti(String category) { Set<Achievement> achievement = new HashSet<>(); <START> for (String key : mainConfig.getConfigurationSection(category).getKeys(false)) { <END> String innerSection = category + "." + key; achievement.addAll(loadInner(innerSection, category)); } return achievement; }</code><technical_language>getShallowKeys helper method</technical_language>

Target:
private Set<Achievement> loadMulti(String category) { Set<Achievement> achievement = new HashSet<>(); for (String key : mainConfig.getShallowKeys(category)) { String innerSection = category + "." + key; achievement.addAll(loadInner(innerSection, category, key)); } return achievement; }
Source:
<code>public Object load(int operatorId, long windowId) { Object obj = null; try { obj = retrieve(generateKey(operatorId, windowId)); <START> logger.info("retrieved object from store key region ", generateKey(operatorId, windowId), applicationId); <END> } catch (Exception ex) { logger.info("while loading {}", operatorId, windowId, ex); throw new RuntimeException(ex); } return obj; }</code><technical_language>change this debug</technical_language>

Target:
public Object load(int operatorId, long windowId) { Object obj = null; try { obj = retrieve(generateKey(operatorId, windowId)); logger.debug("retrieved object from store key region ", generateKey(operatorId, windowId), applicationId); } catch (Exception ex) { throw new RuntimeException(ex); } return obj; }
Source:
<code>public String getConsumerAutoOffsetResetConfig() { <START> return _consumerProps.getProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "NOT SET"); <END> }</code><technical_language>return a null string instead of "NOT SET"</technical_language>

Target:
public String getConsumerAutoOffsetResetConfig() { return _consumerProps.getProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, ""); }
Source:
<code>public void dispose() { phone.mCM.unregisterForAvailable(this); phone.mCM.unregisterForOffOrNotAvailable(this); ((CDMAPhone) phone).mRuimRecords.unregisterForRecordsLoaded(this); phone.mCM.unregisterForNVReady(this); phone.mCM.unregisterForDataStateChanged(this); <START> ((CDMAPhone) phone).mCT.unregisterForVoiceCallEnded(this); <END> ((CDMAPhone) phone).mCT.unregisterForVoiceCallStarted(this); ((CDMAPhone) phone).mSST.unregisterForCdmaDataConnectionAttached(this); ((CDMAPhone) phone).mSST.unregisterForCdmaDataConnectionDetached(this); ((CDMAPhone) phone).mSST.unregisterForRoamingOn(this); ((CDMAPhone) phone).mSST.unregisterForRoamingOff(this); this.removeCallbacksAndMessages(null); phone.getContext().unregisterReceiver(this.alarmReceiver); phone.getContext().unregisterReceiver(this.screenOnOffReceiver); destroyAllDataConnectionList(); this.netstat = null; this.mActiveDataConnection = null; this.filter = null; this.filterS = null; this.screenOnOffReceiver = null; this.mDataConnectionTracker = null; this.dataEnabled = null; this.phone = null; }</code><technical_language>casts necessary</technical_language>

Target:
public void dispose() { phone.mCM.unregisterForAvailable(this); phone.mCM.unregisterForOffOrNotAvailable(this); ((CDMAPhone) phone).mRuimRecords.unregisterForRecordsLoaded(this); phone.mCM.unregisterForNVReady(this); phone.mCM.unregisterForDataStateChanged(this); ((CDMAPhone) phone).mCT.unregisterForVoiceCallEnded(this); ((CDMAPhone) phone).mCT.unregisterForVoiceCallStarted(this); ((CDMAPhone) phone).mSST.unregisterForCdmaDataConnectionAttached(this); ((CDMAPhone) phone).mSST.unregisterForCdmaDataConnectionDetached(this); ((CDMAPhone) phone).mSST.unregisterForRoamingOn(this); ((CDMAPhone) phone).mSST.unregisterForRoamingOff(this); phone.getContext().unregisterReceiver(this.alarmReceiver); phone.getContext().unregisterReceiver(this.screenOnOffReceiver); destroyAllDataConnectionList(); }
Source:
<code>public DotRunnableThread(final List<DotRunnable> allListeners) { this.listeners = getListeners(allListeners); this.flushers = getFlushers(allListeners); <START> this.networkCacheFlushThread.start(); <END> }</code><technical_language>![BLOCKER](<LINK_0> 'Severity: BLOCKER') Move this "start" call another method. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
public DotRunnableThread(final List<DotRunnable> allListeners) { this.listeners = getListeners(allListeners); this.flushers = getFlushers(allListeners); }
Source:
<code>public void visitToken(DetailAST ast) { final DetailAST landNode = ast.findFirstToken(TokenTypes.EXPR) .findFirstToken(TokenTypes.LAND); if (landNode == null) { if (checkOnNextLine(ast)) { log(ast, MSG_KEY); } } else { final DetailAST notEqualNode = landNode.findFirstToken(TokenTypes.NOT_EQUAL); final DetailAST instanceOfNode = landNode.findFirstToken(TokenTypes.LITERAL_INSTANCEOF); if (notEqualNode != null && instanceOfNode != null && notEqualNode.findFirstToken(TokenTypes.LITERAL_NULL) != null) { final DetailAST dotNode1 = getDotNode(notEqualNode); final DetailAST dotNode2 = getDotNode(instanceOfNode); final String string1; if (dotNode1 == null) { <START> string1 = getIdentNode(notEqualNode).getText(); <END> } else { final DetailAST identNode1 = getIdentNode(dotNode1); string1 = getText(identNode1); } final String string2; if (dotNode2 == null) { string2 = getIdentNode(instanceOfNode).getText(); } else { final DetailAST identNode2 = getIdentNode(dotNode2); string2 = getText(identNode2); } if (string1.equals(string2)) { log(ast, MSG_KEY); } } } }</code><technical_language>I recursively get full field name, is field more dot, for example person.department.name</technical_language>

Target:
public void visitToken(DetailAST ast) { final DetailAST landNode = getExprChildNode(ast, TokenTypes.LAND); if (landNode == null) { if (checkOuterNotEqual(ast) || checkOuterInstanceOf(ast)) { log(ast, MSG_KEY); } } else { final DetailAST notEqualNode = landNode.findFirstToken(TokenTypes.NOT_EQUAL); final DetailAST instanceOfNode = landNode.findFirstToken(TokenTypes.LITERAL_INSTANCEOF); if (isTextEqual(instanceOfNode, notEqualNode)) { log(ast, MSG_KEY); } } }
Source:
<code>@Test void testHashJoinLeftOuterJoinPushDownSort() { final String sql = "select * from\n" + "(select ename from sales.emp UNION ALL select ename from sales.emp UNION ALL select ename from sales.emp UNION ALL select ename from sales.emp UNION ALL select ename from sales.emp UNION ALL select ename from sales.emp UNION ALL select ename from sales.emp UNION ALL select ename from sales.emp UNION ALL select ename from sales.emp) r left outer join\n" + "(select ename from sales.bonus UNION ALL select ename from sales.bonus UNION ALL select ename from sales.bonus UNION ALL select ename from sales.bonus UNION ALL select ename from sales.bonus UNION ALL select ename from sales.bonus UNION ALL select ename from sales.bonus UNION ALL select ename from sales.bonus UNION ALL select ename from sales.bonus UNION ALL select ename from sales.bonus) s\n" + "on r.ename=s.ename\n" <START> + "order by r.ename nulls first"; <END> Query.create(sql) .removeRule(EnumerableRules.ENUMERABLE_MERGE_JOIN_RULE) .removeRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE) .removeRule(SortJoinTransposeRule.INSTANCE) .removeRule(SortJoinCopyRule.INSTANCE) .removeRule(EnumerableRules.ENUMERABLE_SORT_RULE) .check(); }</code><technical_language>this: sql select * (select distinct a, b foo) foo join bar foo.c = bar.c order b desc, a desc;</technical_language>

Target:
@Test void testHashJoinLeftOuterJoinPushDownSort() { final String sql = "select * from\n" + "(select contactno, email from customer.contact_peek) r left outer join\n" + "(select acctno, type from customer.account) s\n" + "on r.contactno=s.acctno and r.email=s.type\n" + "order by r.contactno desc, r.email desc"; Query.create(sql) .removeRule(EnumerableRules.ENUMERABLE_MERGE_JOIN_RULE) .removeRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE) .removeRule(EnumerableRules.ENUMERABLE_SORT_RULE) .check(); }
Source:
<code>public void convertAttributeToUnique(PerunSession session, int attrId) throws InternalErrorException, AttributeNotExistsException, AttributeAlreadyMarkedUniqueException { AttributeDefinition attrDef = getAttributeDefinitionById(session, attrId); if(attrDef.isUnique()) throw new AttributeAlreadyMarkedUniqueException("Cannot convert attribute because it is already marked as unique", attrDef); if(attrDef.getNamespace().startsWith(NS_ENTITYLESS_ATTR)) throw new InternalErrorException("entityless atributes cannot be converted to unique"); if(!Arrays.asList("def","opt").contains(attrDef.getNamespace().split(":")[4])) { throw new InternalErrorException("only 'def' and 'opt' attributes can be converted to unique"); } log.info("converting attribute to unique",attrDef.getName()); attrDef.setUnique(true); this.updateAttributeDefinition(session, attrDef); long startTime = System.currentTimeMillis(); attributesManagerImpl.convertAttributeValuesToUnique(session, attrDef); long endTime = System.currentTimeMillis(); <START> log.debug("attribute was converted to unique in ms",attrDef.getName(),(endTime-startTime)); <END> }</code><technical_language>Start big A, ends dot</technical_language>

Target:
public void convertAttributeToUnique(PerunSession session, int attrId) throws InternalErrorException, AttributeNotExistsException, AttributeAlreadyMarkedUniqueException { AttributeDefinition attrDef = getAttributeDefinitionById(session, attrId); if(attrDef.isUnique()) throw new AttributeAlreadyMarkedUniqueException("Cannot convert attribute because it is already marked as unique", attrDef); if(attrDef.getNamespace().startsWith(NS_ENTITYLESS_ATTR)) throw new InternalErrorException("entityless atributes cannot be converted to unique"); if(!Arrays.asList("def","opt").contains(attrDef.getNamespace().split(":")[4])) { throw new InternalErrorException("only 'def' and 'opt' attributes can be converted to unique"); } log.info("converting attribute to unique",attrDef.getName()); attrDef.setUnique(true); this.updateAttributeDefinition(session, attrDef); long startTime = System.currentTimeMillis(); attributesManagerImpl.convertAttributeValuesToUnique(session, attrDef); long endTime = System.currentTimeMillis(); log.debug("Attribute was converted to unique in ms",attrDef.getName(),(endTime-startTime)); }
Source:
<code>public void visitSwitchStatement(SwitchStatementTree tree) { <START> tree.cases().stream().forEach(this::checkCaseClause); <END> super.visitSwitchStatement(tree); }</code><technical_language>need call stream() here</technical_language>

Target:
public void visitSwitchStatement(SwitchStatementTree tree) { tree.cases().forEach(this::checkCaseClause); super.visitSwitchStatement(tree); }
Source:
<code>public void testCompanionAd() throws Exception { <START> Log.v(TAG, "Beginning testCompanionAd"); <END> super.playVideo(); assertTrue("Companion ad not found in preroll ad break.", toCompanionAdCheck(5000)); toEndOfAdCheck(); assertTrue("Companion ad not found in midroll ad break.", toCompanionAdCheck(35000)); toEndOfAdCheck(); assertTrue("Companion ad not found in postroll ad break.", toCompanionAdCheck(112000)); Log.v(TAG, "Finished testCompanionAd"); }</code><technical_language>"Beginning" "Finished" log statements redundant in a test report. is, test reports list test classes, passed not. (And if test assertion failed, is a stack trace pretty problem lies.)</technical_language>

Target:
public void testCompanionAd() throws Exception { Log.v(TAG, "Beginning testCompanionAd"); super.playVideo(); assertTrue("Companion ad not found in preroll ad break.", waitForCompanionAdCheck(msecToPreroll, ADTYPE_PREROLL)); waitForEndOfAdCheck(ADTYPE_PREROLL); assertTrue("Companion ad not found in midroll ad break.", waitForCompanionAdCheck(msecToMidroll, ADTYPE_MIDROLL)); waitForEndOfAdCheck(ADTYPE_MIDROLL); assertTrue("Companion ad not found in postroll ad break.", waitForCompanionAdCheck(msecToPostroll, ADTYPE_POSTROLL)); Log.v(TAG, "Finished testCompanionAd"); }
Source:
<code>public void accumulateTuple(Tuple.WindowedTuple<KeyValPair<KeyT, InputValT>> tuple) { KeyValPair<KeyT, InputValT> kvData = tuple.getValue(); KeyT key = kvData.getKey(); for (Window window : tuple.getWindows()) { AccumT accum = dataStorage.get(window, key); if (accum == null) { accum = accumulation.defaultAccumulatedValue(); } InputValT inputValue = kvData.getValue(); AccumT newValue = accumulation.accumulate(accum, inputValue); <START> if (earlyTriggerMillis > 0 || lateTriggerMillis > 0) { <END> updatedKeyStorage.put(window, key); } dataStorage.put(window, key, newValue); } }</code><technical_language>check fireOnlyUpdatedPanes is false</technical_language>

Target:
public void accumulateTuple(Tuple.WindowedTuple<KeyValPair<KeyT, InputValT>> tuple) { KeyValPair<KeyT, InputValT> kvData = tuple.getValue(); KeyT key = kvData.getKey(); for (Window window : tuple.getWindows()) { AccumT accum = dataStorage.get(window, key); if (accum == null) { accum = accumulation.defaultAccumulatedValue(); } InputValT inputValue = kvData.getValue(); AccumT newValue = accumulation.accumulate(accum, inputValue); if ((earlyTriggerMillis > 0 || lateTriggerMillis > 0 || earlyTriggerCount > 0 || lateTriggerCount > 0) && useUpdatedKeyStorage()) { updatedKeyStorage.put(window, key); } dataStorage.put(window, key, newValue); } }
Source:
<code>public static void removeDuplicate(NetworkTopology topology, Collection<Node> mutableExcludedNodes, List<String> mutableExcludedScopes, int ancestorGen) { <START> if (mutableExcludedNodes == null || mutableExcludedNodes.size() == 0 || <END> mutableExcludedScopes == null || mutableExcludedScopes.size() == 0 || topology == null) { return; } Iterator<Node> iterator = mutableExcludedNodes.iterator(); while (iterator.hasNext() && (!mutableExcludedScopes.isEmpty())) { Node node = iterator.next(); Node ancestor = topology.getAncestor(node, ancestorGen); if (ancestor == null) { LOG.warn("Fail to get ancestor generation " + ancestorGen + " of node :" + node); continue; } List<String> duplicateList = mutableExcludedScopes.stream() .filter(scope -> scope.startsWith(ancestor.getNetworkFullPath())) .collect(Collectors.toList()); mutableExcludedScopes.removeAll(duplicateList); mutableExcludedScopes.stream().forEach(scope -> { if (ancestor.getNetworkFullPath().startsWith(scope)) { iterator.remove(); } }); } }</code><technical_language>NIT: CollectionUtils.isEmpty() simplify code 79/80</technical_language>

Target:
public static void removeDuplicate(NetworkTopology topology, Collection<Node> mutableExcludedNodes, List<String> mutableExcludedScopes, int ancestorGen) { if (CollectionUtils.isEmpty(mutableExcludedNodes) || CollectionUtils.isEmpty(mutableExcludedScopes) || topology == null) { return; } Iterator<Node> iterator = mutableExcludedNodes.iterator(); while (iterator.hasNext() && (!mutableExcludedScopes.isEmpty())) { Node node = iterator.next(); Node ancestor = topology.getAncestor(node, ancestorGen); if (ancestor == null) { LOG.warn("Fail to get ancestor generation " + ancestorGen + " of node :" + node); continue; } List<String> duplicateList = mutableExcludedScopes.stream() .filter(scope -> scope.startsWith(ancestor.getNetworkFullPath())) .collect(Collectors.toList()); mutableExcludedScopes.removeAll(duplicateList); mutableExcludedScopes.stream().forEach(scope -> { if (ancestor.getNetworkFullPath().startsWith(scope)) { iterator.remove(); } }); } }
Source:
<code>private Map<Binary, Descriptors.EnumValueDescriptor> makeLookupStructure(Descriptors.EnumDescriptor enumType) { Map<Binary, Descriptors.EnumValueDescriptor> lookupStructure = new HashMap<Binary, Descriptors.EnumValueDescriptor>(); if (extraMetadata.containsKey(METADATA_ENUM_PREFIX + enumType.getFullName())) { String enumNameNumberPairs = extraMetadata.get(METADATA_ENUM_PREFIX + enumType.getFullName()); if (StringUtils.isBlank(enumNameNumberPairs)) { <START> LOG.info("No enum is written for " + enumType.getFullName()); <END> return lookupStructure; } for (String enumItem : enumNameNumberPairs.split(METADATA_ENUM_ITEM_SEPARATOR)) { String[] nameAndNumber = enumItem.split(METADATA_ENUM_KEY_VALUE_SEPARATOR); if (nameAndNumber.length != 2) { throw new BadConfigurationException("Invalid enum bookkeeper from the metadata: " + enumNameNumberPairs); } lookupStructure.put(Binary.fromString(nameAndNumber[0]), enumType.findValueByNumberCreatingIfUnknown(Integer.parseInt(nameAndNumber[1]))); } } else { List<Descriptors.EnumValueDescriptor> enumValues = enumType.getValues(); for (Descriptors.EnumValueDescriptor value : enumValues) { String name = value.getName(); lookupStructure.put(Binary.fromString(name), enumType.findValueByName(name)); } } return lookupStructure; }</code><technical_language>I understand this logged often. some logging much. I suggest this debug level instead</technical_language>

Target:
private Map<Binary, Descriptors.EnumValueDescriptor> makeLookupStructure(Descriptors.EnumDescriptor enumType) { Map<Binary, Descriptors.EnumValueDescriptor> lookupStructure = new HashMap<Binary, Descriptors.EnumValueDescriptor>(); if (extraMetadata.containsKey(METADATA_ENUM_PREFIX + enumType.getFullName())) { String enumNameNumberPairs = extraMetadata.get(METADATA_ENUM_PREFIX + enumType.getFullName()); if (enumNameNumberPairs == null || enumNameNumberPairs.trim().isEmpty()) { LOG.debug("No enum is written for " + enumType.getFullName()); return lookupStructure; } for (String enumItem : enumNameNumberPairs.split(METADATA_ENUM_ITEM_SEPARATOR)) { String[] nameAndNumber = enumItem.split(METADATA_ENUM_KEY_VALUE_SEPARATOR); if (nameAndNumber.length != 2) { throw new BadConfigurationException("Invalid enum bookkeeper from the metadata: " + enumNameNumberPairs); } lookupStructure.put(Binary.fromString(nameAndNumber[0]), enumType.findValueByNumberCreatingIfUnknown(Integer.parseInt(nameAndNumber[1]))); } } else { List<Descriptors.EnumValueDescriptor> enumValues = enumType.getValues(); for (Descriptors.EnumValueDescriptor value : enumValues) { String name = value.getName(); lookupStructure.put(Binary.fromString(name), enumType.findValueByName(name)); } } return lookupStructure; }
Source:
<code>public GatewayResponse authorise(AuthorisationGatewayRequest request) { logger.info("Calling Stripe for authorisation of charge [{}]", request.getChargeExternalId()); GatewayResponse.GatewayResponseBuilder<BaseResponse> responseBuilder = GatewayResponse .GatewayResponseBuilder .responseBuilder(); try { Response tokenResponse = createToken(request); Response sourceResponse = createSource( request, tokenResponse.readEntity(StripeTokenResponse.class).getId() ); Response authorisationResponse = createCharge( request, sourceResponse.readEntity(StripeSourcesResponse.class).getId() ); return responseBuilder.withResponse(StripeAuthorisationResponse.of(authorisationResponse)).build(); } catch(GatewayClientException e) { logger.error( "There was error calling Stripe. Reason: {}", e.getResponse().readEntity(StripeErrorResponse.class).getError().getMessage() ); <START> <END> return responseBuilder.withGatewayError( new GatewayError( "Stripe returned unexpected response", ErrorType.UNEXPECTED_HTTP_STATUS_CODE_FROM_GATEWAY) ).build(); } }</code><technical_language>stripe error response of form { "error": { "message": "Invalid API Key provided: sk_test_************S8wL", "type": "invalid_request_error" } } com.stripe.model.Charge JSON: { "failure_code": ..., "failure_message": ..., "status": "failure" i if read entity String.class... I guess this clearer meet Stripe next Monday</technical_language>

Target:
public GatewayResponse authorise(AuthorisationGatewayRequest request) { logger.info("Calling Stripe for authorisation of charge [{}]", request.getChargeExternalId()); GatewayResponse.GatewayResponseBuilder<BaseResponse> responseBuilder = GatewayResponse .GatewayResponseBuilder .responseBuilder(); try { Response tokenResponse = createToken(request); Response sourceResponse = createSource( request, tokenResponse.readEntity(StripeTokenResponse.class).getId() ); Response authorisationResponse = createCharge( request, sourceResponse.readEntity(StripeSourcesResponse.class).getId() ); return responseBuilder.withResponse(StripeAuthorisationResponse.of(authorisationResponse)).build(); } catch(GatewayClientException e) { logger.error( "There was error calling Stripe. Reason: {}", e.getResponse().readEntity(StripeErrorResponse.class).getError().getMessage() ); return responseBuilder.withGatewayError( new GatewayError( "There was an internal server error. ErrorId:" + UUID.randomUUID(), ErrorType.UNEXPECTED_HTTP_STATUS_CODE_FROM_GATEWAY) ).build(); } }
Source:
<code>public void shouldUseUpsertOnUpdate() throws IOException { String documentId = "1"; SampleEntity sampleEntity = SampleEntity.builder() .id(documentId) .message("test message") .version(System.currentTimeMillis()) .build(); Map<String, Object> doc = getResultsMapper().getEntityMapper().mapObject(sampleEntity); UpdateRequest updateRequest = new UpdateRequest() .doc(doc) .upsert(doc); UpdateQuery updateQuery = new UpdateQueryBuilder() .withClass(SampleEntity.class) .withId(documentId) .withUpdateRequest(updateRequest) .build(); <START> elasticsearchTemplate.update(updateQuery); <END> GetQuery getQuery = new GetQuery(); getQuery.setId(documentId); SampleEntity indexedEntity = elasticsearchTemplate.queryForObject(getQuery, SampleEntity.class); assertThat(indexedEntity).isNotNull(); assertThat(indexedEntity.getId()).isEqualTo(documentId); }</code><technical_language>I think, created updateQuery evaluated asserted instead of running update againast ES checking results. unit tests integration tests. Besides that, Spring provides ReflectionTestUtils class I this approach reflection parts of a tested class accessible visibility rules</technical_language>

Target:
public void shouldUseUpsertOnUpdate() throws IOException { Map<String, Object> doc = new HashMap<>(); doc.put("id", "1"); doc.put("message", "test"); UpdateRequest updateRequest = new UpdateRequest() .doc(doc) .upsert(doc); UpdateQuery updateQuery = new UpdateQueryBuilder() .withClass(SampleEntity.class) .withId("1") .withUpdateRequest(updateRequest).build(); UpdateRequest request = ((UpdateRequestBuilder) ReflectionTestUtils .invokeMethod(elasticsearchTemplate, "prepareUpdate", updateQuery)) .request(); assertThat(request).isNotNull(); assertThat(request.upsertRequest()).isNotNull(); }
Source:
<code>public RelOptCost computeSelfCost(final RelOptPlanner planner, final RelMetadataQuery mq) { double cost = 1.0; if (queryBuilder.getFilter() != null) { cost *= 0.1; } if (queryBuilder.getGrouping() != null) { <START> cost *= 0.5; <END> } if (queryBuilder.getLimitSpec() != null) { cost *= 0.5; } return planner.getCostFactory().makeCost(cost, 0, 0); }</code><technical_language>making constants static variables</technical_language>

Target:
public RelOptCost computeSelfCost(final RelOptPlanner planner, final RelMetadataQuery mq) { double cost = COST_BASE; if (queryBuilder.getFilter() != null) { cost *= COST_FILTER_MULTIPLIER; } if (queryBuilder.getGrouping() != null) { cost *= COST_GROUPING_MULTIPLIER; } if (queryBuilder.getLimitSpec() != null) { cost *= COST_LIMIT_MULTIPLIER; } return planner.getCostFactory().makeCost(cost, 0, 0); }
Source:
<code>public static TaskExecutorMemoryConfiguration create(Configuration config) { return new TaskExecutorMemoryConfiguration( getConfigurationValue(config, FRAMEWORK_HEAP_MEMORY), getConfigurationValue(config, TASK_HEAP_MEMORY), getConfigurationValue(config, FRAMEWORK_OFF_HEAP_MEMORY), getConfigurationValue(config, TASK_OFF_HEAP_MEMORY), getConfigurationValue(config, NETWORK_MEMORY_MIN), getConfigurationValue(config, NETWORK_MEMORY_MAX), config.getOptional(NETWORK_MEMORY_FRACTION).orElse(NETWORK_MEMORY_FRACTION.defaultValue()), getConfigurationValue(config, MANAGED_MEMORY_SIZE), <START> config.getOptional(MANAGED_MEMORY_FRACTION).orElse(MANAGED_MEMORY_FRACTION.defaultValue()), <END> getConfigurationValue(config, JVM_METASPACE), getConfigurationValue(config, JVM_OVERHEAD_MIN), getConfigurationValue(config, JVM_OVERHEAD_MAX), config.getOptional(JVM_OVERHEAD_FRACTION).orElse(JVM_OVERHEAD_FRACTION.defaultValue()), getConfigurationValue(config, TOTAL_PROCESS_MEMORY) ); }</code><technical_language>do need fraction here</technical_language>

Target:
public static TaskExecutorMemoryConfiguration create(Configuration config) { return new TaskExecutorMemoryConfiguration( getConfigurationValue(config, FRAMEWORK_HEAP_MEMORY), getConfigurationValue(config, TASK_HEAP_MEMORY), getConfigurationValue(config, FRAMEWORK_OFF_HEAP_MEMORY), getConfigurationValue(config, TASK_OFF_HEAP_MEMORY), getConfigurationValue(config, NETWORK_MEMORY_MAX), getConfigurationValue(config, MANAGED_MEMORY_SIZE), getConfigurationValue(config, JVM_METASPACE), getConfigurationValue(config, JVM_OVERHEAD_MAX), getConfigurationValue(config, TOTAL_FLINK_MEMORY), getConfigurationValue(config, TOTAL_PROCESS_MEMORY) ); }