auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { AbstractTextEditor textEditor = getActiveTextEditor(); if (textEditor == null) { return null; } FontRegistry fontRegistry = textEditor.getSite().getWorkbenchWindow().getWorkbench().getThemeManager().getCurrentTheme().getFontRegistry(); FontData[] initialFontData = fontRegistry.getFontData(JFaceResources.TEXT_FONT); int destFontSize = initialFontData[0].getHeight() + this.fontDiff; if (destFontSize <= 0) { return null; } FontDescriptor newFontDescriptor = FontDescriptor.createFrom(initialFontData).setHeight(destFontSize); fontRegistry.put(JFaceResources.TEXT_FONT, newFontDescriptor.getFontData()); <START> PrefUtil.getInternalPreferenceStore().setValue(JFaceResources.TEXT_FONT, PreferenceConverter.getStoredRepresentation(newFontDescriptor.getFontData())); <END> PrefUtil.savePrefs(); IEventBroker eventBroker = (IEventBroker) textEditor.getSite().getWorkbenchWindow().getWorkbench().getService(IEventBroker.class); eventBroker.send(WorkbenchThemeManager.Events.THEME_REGISTRY_MODIFIED, null); return newFontDescriptor; }</code><technical_language>This adds a discouraged access warning. public API</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { AbstractTextEditor textEditor = getActiveTextEditor(); if (textEditor == null) { return null; } FontRegistry fontRegistry = textEditor.getSite().getWorkbenchWindow().getWorkbench().getThemeManager().getCurrentTheme().getFontRegistry(); FontData[] initialFontData = fontRegistry.getFontData(JFaceResources.TEXT_FONT); int destFontSize = initialFontData[0].getHeight() + this.fontDiff; if (destFontSize <= 0) { return null; } FontDescriptor newFontDescriptor = FontDescriptor.createFrom(initialFontData).setHeight(destFontSize); fontRegistry.put(JFaceResources.TEXT_FONT, newFontDescriptor.getFontData()); PlatformUI.getPreferenceStore().setValue(JFaceResources.TEXT_FONT, PreferenceConverter.getStoredRepresentation(newFontDescriptor.getFontData())); return newFontDescriptor; }
Source:
<code>public void testExecute() throws Exception { final ReportExecutionContext context = new ReportExecutionContext(CLOCK, _injector, _environment, _config); context.execute(EXAMPLE_REPORT, T1).toCompletableFuture().get(); Mockito.verify(_emailSender).send( ALICE, ImmutableMap.of(HTML, mockRendered(EXAMPLE_REPORT, HTML, TIME_RANGE)), <START> Duration.ofSeconds(10) <END> ); Mockito.verify(_emailSender).send( BOB, ImmutableMap.of(HTML, mockRendered(EXAMPLE_REPORT, HTML, TIME_RANGE), PDF, mockRendered(EXAMPLE_REPORT, PDF, TIME_RANGE)), Duration.ofSeconds(10) ); }</code><technical_language>Extract this timeout a constant shared verify calls initialization</technical_language>

Target:
public void testExecute() throws Exception { final ReportExecutionContext context = new ReportExecutionContext(CLOCK, _injector, _environment, _config); context.execute(EXAMPLE_REPORT, T1).toCompletableFuture().get(); Mockito.verify(_emailSender).send( ALICE, ImmutableMap.of(HTML, mockRendered(EXAMPLE_REPORT, HTML, TIME_RANGE)), SEND_TIMEOUT ); Mockito.verify(_emailSender).send( BOB, ImmutableMap.of(HTML, mockRendered(EXAMPLE_REPORT, HTML, TIME_RANGE), PDF, mockRendered(EXAMPLE_REPORT, PDF, TIME_RANGE)), SEND_TIMEOUT ); }
Source:
<code>private void updateSLinks(ITmfEvent event) { String sId = event.getContent().getFieldValue(String.class, ITraceEventConstants.ID); if (sId == null) { Object resolve = fIdAspect.resolve(event); if (resolve == null) { resolve = Integer.valueOf(0); } sId = String.valueOf(resolve); } HostThread src = fSrcHost.remove(sId); int tid = (int) getThreadId(event); ITmfStateSystemBuilder ssb = getStateSystemBuilder(); if (ssb == null) { return; } long ts = event.getTimestamp().toNanos(); long startTime = fScopeEndTimes.getOrDefault(sId, ts - 1); HostThread currHostThread = new HostThread(event.getTrace().getHostId(), tid); if (src != null) { int edgeQuark = getAvailableEdgeQuark(ssb, startTime); Object edgeStateValue = new EdgeStateValue(fIdCache.computeIfAbsent(sId, FUNCTION), src, currHostThread); <START> ssb.modifyAttribute(startTime, edgeStateValue, edgeQuark); ssb.modifyAttribute(ts + 1, (Object) null, edgeQuark); <END> } fSrcHost.put(sId, currHostThread); }</code><technical_language>set edge quark edge, line after, sort of close edge a null 1ns after? this work..</technical_language>

Target:
private void updateSLinks(ITmfEvent event) { String sId = event.getContent().getFieldValue(String.class, ITraceEventConstants.ID); if (sId == null) { Object resolve = fIdAspect.resolve(event); if (resolve == null) { resolve = Integer.valueOf(0); } sId = String.valueOf(resolve); } HostThread src = fSrcHost.remove(sId); int tid = (int) getThreadId(event); ITmfStateSystemBuilder ssb = getStateSystemBuilder(); if (ssb == null) { return; } long ts = event.getTimestamp().toNanos(); long startTime = fScopeEndTimes.getOrDefault(sId, ts); HostThread currHostThread = new HostThread(event.getTrace().getHostId(), tid); if (src != null) { int edgeQuark = getAvailableEdgeQuark(ssb, startTime); Object edgeStateValue = new EdgeStateValue(fIdCache.computeIfAbsent(sId, FUNCTION), src, currHostThread); ssb.modifyAttribute(startTime, edgeStateValue, edgeQuark); ssb.modifyAttribute(ts + 1, (Object) null, edgeQuark); } fScopeEndTimes.put(sId, ts + 1); fSrcHost.put(sId, currHostThread); }
Source:
<code>private void setLineSeriesColor() { Iterator<Color> colorsIt; colorsIt = Iterators.cycle(COLORS); for (ISeries series : getChart().getSeriesSet().getSeries()) { ((ILineSeries) series).setSymbolColor((colorsIt.next())); Color[] colors = new Color[series.getXSeries().length]; Color color = checkNotNull(((ILineSeries) series).getSymbolColor()); <START> Arrays.setAll(colors, i -> color); <END> ((ILineSeries) series).setSymbolColors(colors); } }</code><technical_language>Arrays.fill() if element is depend index. Also, is colour set first, retrieved getSymbolColor() ? I this loop simplified a bit, push update</technical_language>

Target:
private void setLineSeriesColor() { Iterator<Color> colorsIt = Iterators.cycle(COLORS); for (ISeries series : getChart().getSeriesSet().getSeries()) { ILineSeries lineSeries = (ILineSeries) series; Color color = colorsIt.next(); lineSeries.setSymbolColor(color); Color[] colors = new Color[lineSeries.getXSeries().length]; Arrays.fill(colors, color); lineSeries.setSymbolColors(colors); } }
Source:
<code>public TemplateCommand() { Options o = CommandLineHelper.getCommonOptions(); o.addOption("i", "input", true, "load ontology to merge from a file"); o.addOption("I", "input-iri", true, "load ontology to merge from an IRI"); o.addOption("o", "output", true, "save ontology to a file"); o.addOption("O", "ontology-iri", true, "set the output ontology IRI"); o.addOption("V", "version-iri", true, "set the output version IRI"); o.addOption("t", "template", true, "read template from a file"); <START> o.addOption("A", "ancestors", false, "MIREOT ancestors into results"); <END> o.addOption("m", "merge-before", false, "merge into input ontology before any output"); o.addOption("M", "merge-after", false, "merge into input ontology after any output"); o.addOption( "c", "collapse-import-closure", true, "if true, collapse the import closure when merging"); o.addOption( "a", "include-annotations", true, "if true, include ontology annotations from merge input"); options = o; }</code><technical_language>change options published, break downstream</technical_language>

Target:
public TemplateCommand() { Options o = CommandLineHelper.getCommonOptions(); o.addOption("i", "input", true, "load ontology to merge from a file"); o.addOption("I", "input-iri", true, "load ontology to merge from an IRI"); o.addOption("o", "output", true, "save ontology to a file"); o.addOption("O", "ontology-iri", true, "set the output ontology IRI"); o.addOption("V", "version-iri", true, "set the output version IRI"); o.addOption("t", "template", true, "read template from a file"); o.addOption("a", "ancestors", false, "MIREOT ancestors into results"); o.addOption("m", "merge-before", false, "merge into input ontology before any output"); o.addOption("M", "merge-after", false, "merge into input ontology after any output"); o.addOption( "c", "collapse-import-closure", true, "if true, collapse the import closure when merging"); o.addOption( "A", "include-annotations", true, "if true, include ontology annotations from merge input"); options = o; }
Source:
<code><START> private static String getElixirSdkPath(){ <END> if(SystemInfo.isMac) return ELIXIR_SDK_PATH + "/" + ELIXIR_SDK_VERSION; throw new RuntimeException("Only Mac supported"); }</code><technical_language>If familiar travis-ci.org, happy work out build issues for you</technical_language>

Target:
private static String getElixirSdkPath(){ if(SystemInfo.isMac) return MAC_ELIXIR_SDK_PATH + "/" + ELIXIR_SDK_VERSION; if(SystemInfo.isLinux) return LINUX_ELIXIR_SDK_PATH + "/elixir-" + TRAVIS_CI_ELIXIR_SDK_VERSION + "/lib/elixir"; throw new RuntimeException("Only Mac supported"); }
Source:
<code>private static ColumnDescription convertPBColumnDescription(RiakKvPB.TsColumnDescription pbColumn) { final String name = pbColumn.getName().toStringUtf8(); final ColumnDescription.ColumnType type = ColumnDescription.ColumnType.valueOf(pbColumn.getType().getNumber()); <START> final List<ColumnDescription.ColumnType> complexType = <END> new ArrayList<ColumnDescription.ColumnType>(pbColumn.getComplexTypeCount()); for (RiakKvPB.TsColumnType pbComplexType : pbColumn.getComplexTypeList()) { complexType.add(ColumnDescription.ColumnType.valueOf(pbComplexType.getNumber())); } return new ColumnDescription(name, type, complexType); }</code><technical_language>removing Map support, remove complexTypes</technical_language>

Target:
private static ColumnDescription convertPBColumnDescription(RiakKvPB.TsColumnDescription pbColumn) { final String name = pbColumn.getName().toStringUtf8(); final ColumnDescription.ColumnType type = ColumnDescription.ColumnType.valueOf(pbColumn.getType().getNumber()); return new ColumnDescription(name, type); }
Source:
<code>public Long getUuid() { <START> return new Long(artifact.getArtId()); <END> }</code><technical_language>Long.valueOf() instead of new Long() - for performance reasons</technical_language>

Target:
public Long getUuid() { return Long.valueOf(artifact.getArtId()); }
Source:
<code>public List<ReportDesign> constructReportDesigns(ReportDefinition reportDefinition) { List<ReportDesign> l = new ArrayList<ReportDesign>(); <START> l.add(ReportManagerUtil.createExcelDesign("c1e93868-633a-11e7-907b-a6006ad3dba0", reportDefinition)); <END> return l; }</code><technical_language>please create random uuids e.g. <LINK_0> differ a chars ListOfDiagnosis ListOfProviders..</technical_language>

Target:
public List<ReportDesign> constructReportDesigns(ReportDefinition reportDefinition) { List<ReportDesign> l = new ArrayList<ReportDesign>(); l.add(ReportManagerUtil.createExcelDesign("c410998d-b71e-428b-8e5c-f88536c83761", reportDefinition)); return l; }
Source:
<code>public BaseAuthoriseResponse.AuthoriseStatus queryPaymentStatus(ChargeEntity charge) { Either<GatewayError, GatewayClient.Response> response = authoriseClient.postRequestFor( <START> ROUTE_FOR_QUERY_ORDER, <END> charge.getGatewayAccount(), buildQueryOrderRequestFor(charge) ); GatewayResponse<BaseAuthoriseResponse> gatewayResponse = GatewayResponseGenerator.getEpdqGatewayResponse(authoriseClient, response, EpdqAuthorisationResponse.class); return gatewayResponse.getBaseResponse().map(epdqStatus -> ((EpdqAuthorisationResponse) epdqStatus).authoriseStatus()).orElse(BaseAuthoriseResponse.AuthoriseStatus.ERROR); }</code><technical_language>this tied authorisation (BaseAuthoriseResponse, authoriseClient etc.). In theory this for querying a payment in status</technical_language>

Target:
public ChargeQueryResponse queryPaymentStatus(ChargeEntity charge) { Either<GatewayError, GatewayClient.Response> response = authoriseClient.postRequestFor( ROUTE_FOR_QUERY_ORDER, charge.getGatewayAccount(), buildQueryOrderRequestFor(charge) ); GatewayResponse<EpdqQueryResponse> epdqGatewayResponse = GatewayResponseGenerator.getEpdqGatewayResponse(authoriseClient, response, EpdqQueryResponse.class); return epdqGatewayResponse.getBaseResponse().map(EpdqQueryResponse::toChargeQueryResponse).orElseGet(() -> { throw new WebApplicationException("Things went wrong"); }); }
Source:
<code>public void clean() { System.clearProperty("org.jbpm.task.assignment.enabled"); <START> AssignmentServiceProvider.clear(); <END> if (emf != null) { emf.close(); } if (pds != null) { pds.close(); } }</code><technical_language>clear other system property is set in setup method</technical_language>

Target:
public void clean() { System.clearProperty("org.jbpm.task.assignment.enabled"); System.clearProperty("org.jbpm.task.assignment.strategy"); AssignmentServiceProvider.clear(); if (emf != null) { emf.close(); } if (pds != null) { pds.close(); } }
Source:
<code>private void evalArguments( List<Object> posargs, Map<String, Object> kwargs, Environment env) throws EvalException, InterruptedException { ImmutableList.Builder<String> duplicatesBuilder = null; for (int i = 0; i < arguments.size(); i++) { Argument.Passed arg = arguments.get(i); Object value = arg.getValue().eval(env); if (arg.isPositional()) { posargs.add(value); } else if (arg.isStar()) { Collection<?> items; try { items = EvalUtils.toCollection(value, getLocation(), env); } catch (EvalException e) { throw new EvalException( getLocation(), "argument after * must be an iterable, not " + EvalUtils.getDataTypeName(value)); } <START> for (Object starArgUnit : items) { <END> posargs.add(starArgUnit); } } else if (arg.isStarStar()) { ImmutableList<String> duplicates = addKeywordArgsAndReturnDuplicates(kwargs, value, getLocation()); if (duplicates != null) { if (duplicatesBuilder == null) { duplicatesBuilder = ImmutableList.builder(); } duplicatesBuilder.addAll(duplicates); } } else { if (addKeywordArgAndCheckIfDuplicate(kwargs, arg.getName(), value)) { if (duplicatesBuilder == null) { duplicatesBuilder = ImmutableList.builder(); } duplicatesBuilder.add(arg.getName()); } } } if (duplicatesBuilder != null) { ImmutableList<String> dups = duplicatesBuilder.build(); throw new EvalException( getLocation(), "duplicate keyword" + (dups.size() > 1 ? "s" : "") + " '" + Joiner.on("', '").join(dups) + "' in call to " + function); } }</code><technical_language>posargs.addAll(items)</technical_language>

Target:
private void evalArguments( List<Object> posargs, Map<String, Object> kwargs, Environment env) throws EvalException, InterruptedException { ImmutableList.Builder<String> duplicatesBuilder = null; for (int i = 0; i < arguments.size(); i++) { Argument.Passed arg = arguments.get(i); Object value = arg.getValue().eval(env); if (arg.isPositional()) { posargs.add(value); } else if (arg.isStar()) { Iterable<?> items; try { items = EvalUtils.toIterable(value, getLocation(), env); } catch (EvalException e) { throw new EvalException( getLocation(), "argument after * must be an iterable, not " + EvalUtils.getDataTypeName(value)); } for (Object starArgUnit : items) { posargs.add(starArgUnit); } } else if (arg.isStarStar()) { ImmutableList<String> duplicates = addKeywordArgsAndReturnDuplicates(kwargs, value, getLocation()); if (duplicates != null) { if (duplicatesBuilder == null) { duplicatesBuilder = ImmutableList.builder(); } duplicatesBuilder.addAll(duplicates); } } else { if (addKeywordArgAndCheckIfDuplicate(kwargs, arg.getName(), value)) { if (duplicatesBuilder == null) { duplicatesBuilder = ImmutableList.builder(); } duplicatesBuilder.add(arg.getName()); } } } if (duplicatesBuilder != null) { ImmutableList<String> dups = duplicatesBuilder.build(); throw new EvalException( getLocation(), "duplicate keyword" + (dups.size() > 1 ? "s" : "") + " '" + Joiner.on("', '").join(dups) + "' in call to " + function); } }
Source:
<code>public void testReadValidFile() { Map<Integer, File> filters = new HashMap<>(); filters.put(1101, TILE_1101_FILTER); LocsFileReader locsFileReader = new LocsFileReader(new File("testdata/picard/illumina/readerTests/s_1_6.locs")); List<AbstractIlluminaPositionFileReader.PositionInfo> locs = locsFileReader.toList(); final CbclReader reader = new CbclReader(Arrays.asList(PASSING_CBCL_C99_1, PASSING_CBCL_C100_1), filters, new int[]{2}, 1101, locs); int i = 0; while (reader.hasNext()) { <START> final BclData bv = reader.next(); <END> for (int cluster = 0; cluster < bv.bases.length; cluster++) { for (int cycle = 0; cycle < bv.bases[cluster].length; cycle++) { String actual = new String(new byte[]{bv.bases[cluster][cycle]}); String expected = new String(new char[]{expectedBases[i]}); Assert.assertEquals(actual, expected, "For cluster " + cluster + " cycle " + cycle + ","); Assert.assertEquals(bv.qualities[cluster][cycle], expectedQuals[i], "For cluster " + cluster + " cycle " + cycle + ","); i++; } } } Assert.assertEquals(i, expectedBases.length); reader.close(); }</code><technical_language>this final CbclData ...</technical_language>

Target:
public void testReadValidFile() { Map<Integer, File> filters = new HashMap<>(); filters.put(1101, TILE_1101_FILTER); LocsFileReader locsFileReader = new LocsFileReader(new File("testdata/picard/illumina/readerTests/s_1_6.locs")); List<AbstractIlluminaPositionFileReader.PositionInfo> locs = locsFileReader.toList(); final CbclReader reader = new CbclReader(Arrays.asList(PASSING_CBCL_C99_1, PASSING_CBCL_C100_1), filters, new int[]{2}, 1101, locs, false); int i = 0; while (reader.hasNext()) { final BclData bv = reader.next(); for (int cluster = 0; cluster < bv.bases.length; cluster++) { for (int cycle = 0; cycle < bv.bases[cluster].length; cycle++) { String actual = new String(new byte[]{bv.bases[cluster][cycle]}); String expected = new String(new char[]{expectedBases[i]}); Assert.assertEquals(actual, expected, "For cluster " + cluster + " cycle " + cycle + ","); Assert.assertEquals(bv.qualities[cluster][cycle], expectedQuals[i], "For cluster " + cluster + " cycle " + cycle + ","); i++; } } } Assert.assertEquals(i, expectedBases.length); reader.close(); }
Source:
<code>public void pingWhileSubscribed() { <START> Jedis client = new Jedis("localhost", server.getPort(), 1000000000); <END> MockSubscriber mockSubscriber = new MockSubscriber(); executor.submit(() -> client.subscribe(mockSubscriber, "same")); mockSubscriber.awaitSubscribe("same"); mockSubscriber.ping(); GeodeAwaitility.await() .untilAsserted(() -> assertThat(mockSubscriber.getReceivedPings().size()).isEqualTo(1)); assertThat(mockSubscriber.getReceivedPings().get(0)).isEqualTo(""); mockSubscriber.unsubscribe(); client.close(); }</code><technical_language>a long timeout this pingWithArgumentWhileSubscribed</technical_language>

Target:
public void pingWhileSubscribed() { Jedis client = new Jedis("localhost", server.getPort()); MockSubscriber mockSubscriber = new MockSubscriber(); executor.submit(() -> client.subscribe(mockSubscriber, "same")); mockSubscriber.awaitSubscribe("same"); mockSubscriber.ping(); GeodeAwaitility.await() .untilAsserted(() -> assertThat(mockSubscriber.getReceivedPings().size()).isEqualTo(1)); assertThat(mockSubscriber.getReceivedPings().get(0)).isEqualTo(""); mockSubscriber.unsubscribe(); client.close(); }
Source:
<code>public void getVolumesForForceSessionCreate() { GlusterVolumeGeoRepCreateModel.this.startProgress(constants.fetchingDataMessage()); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { VdcQueryReturnValue vdcReturnValue = (VdcQueryReturnValue) ReturnValue; GlusterVolumeGeoRepCreateModel.this.stopProgress(); if(!vdcReturnValue.getSucceeded()) { setQueryFailureMessage(vdcReturnValue.getExceptionString()); } else { setVolumeList((Collection) vdcReturnValue.getReturnValue()); Set<String> clusterForVolumes = getClusterForVolumes(getVolumeList()); getSlaveClusters().setItems(clusterForVolumes, clusterForVolumes.iterator().next()); } } }; SearchParameters <START> vdcQueryParametersBase = <END> new SearchParameters("Volumes:", SearchType.GlusterVolume, false); vdcQueryParametersBase.setRefresh(true); Frontend.getInstance().runQuery(VdcQueryType.Search, vdcQueryParametersBase, _asyncQuery); }</code><technical_language>Please give a name</technical_language>

Target:
public void getVolumesForForceSessionCreate() { GlusterVolumeGeoRepCreateModel.this.startProgress(constants.fetchingDataMessage()); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { VdcQueryReturnValue vdcReturnValue = (VdcQueryReturnValue) ReturnValue; GlusterVolumeGeoRepCreateModel.this.stopProgress(); if(!vdcReturnValue.getSucceeded()) { setQueryFailureMessage(vdcReturnValue.getExceptionString()); } else { setVolumeList((Collection) vdcReturnValue.getReturnValue()); Set<String> clusterForVolumes = getClusterForVolumes(getVolumeList()); getSlaveClusters().setItems(clusterForVolumes, clusterForVolumes.iterator().next()); } } }; SearchParameters volumesSearchParameters = new SearchParameters("Volumes:", SearchType.GlusterVolume, false); volumesSearchParameters.setRefresh(true); Frontend.getInstance().runQuery(VdcQueryType.Search, volumesSearchParameters, _asyncQuery); }
Source:
<code>public boolean isObjectFactory() { <START> return getTargetTypeParameter() != null || getParameters().isEmpty(); <END> }</code><technical_language>return false here</technical_language>

Target:
public boolean isObjectFactory() { return false; }
Source:
<code>public Long getAccountIdForZendesk(@Scope({OAuthScope.ZENDESK_EXTENSION}) final AccessToken accessToken, @PathParam("email") final String email){ <START> LOGGER.debug("Looking account up by email {}", email); <END> final Optional<Account> accountByEmailOptional = accountDAO.getByEmail(email.toLowerCase()); if (!accountByEmailOptional.isPresent()) { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).entity("Account not found").build()); } return accountByEmailOptional.get().id.get(); }</code><technical_language>header check</technical_language>

Target:
public Long getAccountIdForZendesk(@Scope({OAuthScope.ZENDESK_EXTENSION}) final AccessToken accessToken, @PathParam("email") final String email){ LOGGER.debug("Looking account up by email {}", email); final String zendeskHeader = this.request.getHeader(HelloHttpHeader.ZENDESK); if (zendeskHeader == null || !zendeskHeader.equals("mixpanel")) { throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build()); } final Optional<Account> accountByEmailOptional = accountDAO.getByEmail(email.toLowerCase()); if (!accountByEmailOptional.isPresent()) { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).entity("Account not found").build()); } return accountByEmailOptional.get().id.get(); }
Source:
<code>public void testBooleanRetrievalFromProperty() { boolean value = true; boolean defaultValue = false; x509Util = new ClientX509Util(); System.setProperty(x509Util.getSslProtocolProperty(), Boolean.toString(value)); ZKConfig conf = new ZKConfig(); boolean result = conf.getBoolean(x509Util.getSslProtocolProperty(), defaultValue); assertEquals(value, result); <START> System.clearProperty(x509Util.getSslProtocolProperty()); <END> }</code><technical_language>Clear properties in tearDown method @After public void tearDown() throws Exception { }</technical_language>

Target:
public void testBooleanRetrievalFromProperty() { boolean value = true; boolean defaultValue = false; System.setProperty(x509Util.getSslProtocolProperty(), Boolean.toString(value)); ZKConfig conf = new ZKConfig(); boolean result = conf.getBoolean(x509Util.getSslProtocolProperty(), defaultValue); assertEquals(value, result); }
Source:
<code>public void removeMessageGroup(Object groupId) { Lock lock = this.lockRegistry.obtain(groupId); try { lock.lockInterruptibly(); try { if (!groupIdToMessageGroup.containsKey(groupId)) { return; } <START> this.groupToUpperBound.remove(groupId).release(this.groupCapacity); <END> this.groupIdToMessageGroup.remove(groupId); } finally { lock.unlock(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MessagingException("Interrupted while obtaining lock", e); } }</code><technical_language>this NPE if groupId exist</technical_language>

Target:
public void removeMessageGroup(Object groupId) { Lock lock = this.lockRegistry.obtain(groupId); try { lock.lockInterruptibly(); try { MessageGroup messageGroup = this.groupIdToMessageGroup.remove(groupId); if (messageGroup != null) { UpperBound upperBound = this.groupToUpperBound.remove(groupId); Assert.state(upperBound != null, "'upperBound' must not be null."); upperBound.release(this.groupCapacity); } } finally { lock.unlock(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MessagingException("Interrupted while obtaining lock", e); } }
Source:
<code>public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String digestAlgorithm = values[0].execute(); String stringToEncode = values[1].execute(); String salt = values.length > 2 ? values[2].execute() : null; String encodedString = null; try { MessageDigest md = MessageDigest.getInstance(digestAlgorithm); <START> md.update(stringToEncode.getBytes(StandardCharsets.UTF_8.name())); <END> if (StringUtils.isNotEmpty(salt)) { md.update(salt.getBytes(StandardCharsets.UTF_8.name())); } byte[] bytes = md.digest(); encodedString = uppercase(Hex.encodeHexString(bytes), values, 3); addVariableValue(encodedString, values, 4); } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { log.error("Error calling function with value {}, digest algorithm {}, salt {}, ", KEY, stringToEncode, digestAlgorithm, salt, e); } return encodedString; }</code><technical_language>stringToEncode.getBytes(StandardCharsets.UTF_8) here? is point of .name()</technical_language>

Target:
public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String digestAlgorithm = values[0].execute(); String stringToEncode = values[1].execute(); String salt = values.length > 2 ? values[2].execute() : null; String encodedString = null; try { MessageDigest md = MessageDigest.getInstance(digestAlgorithm); md.update(stringToEncode.getBytes(StandardCharsets.UTF_8)); if (StringUtils.isNotEmpty(salt)) { md.update(salt.getBytes(StandardCharsets.UTF_8)); } byte[] bytes = md.digest(); encodedString = uppercase(Hex.encodeHexString(bytes), values, 3); addVariableValue(encodedString, values, 4); } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { log.error("Error calling function with value {}, digest algorithm {}, salt {}, ", KEY, stringToEncode, digestAlgorithm, salt, e); } return encodedString; }
Source:
<code>protected void executeStreamDestroy(String... streamNames) { for (String streamName : streamNames) { CommandResult cr = executeCommand("stream destroy --name " + streamName); <START> assertTrue("Failure to destroy job " + streamName + ". CommandResult = " + cr.toString(), cr.isSuccess()); <END> } }</code><technical_language>read 'stream'</technical_language>

Target:
protected void executeStreamDestroy(String... streamNames) { for (String streamName : streamNames) { CommandResult cr = executeCommand("stream destroy --name " + streamName); assertTrue("Failure to destroy stream " + streamName + ". CommandResult = " + cr.toString(), cr.isSuccess()); } }
Source:
<code><START> static int getExifTranslation(int orientation) { <END> switch (orientation) { case ORIENTATION_FLIP_HORIZONTAL: case ORIENTATION_FLIP_VERTICAL: case ORIENTATION_TRANSPOSE: case ORIENTATION_TRANSVERSE: return -1; default: return 1; } }</code><technical_language>nit: 2 spaces needed here</technical_language>

Target:
static int getExifTranslation(int orientation) { int translation; switch (orientation) { case ORIENTATION_FLIP_HORIZONTAL: case ORIENTATION_FLIP_VERTICAL: case ORIENTATION_TRANSPOSE: case ORIENTATION_TRANSVERSE: translation = -1; break; default: translation = 1; } return translation; }
Source:
<code>public void testJobSubmission() throws Exception { dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch)); jobMasterLeaderElectionService.isLeader(UUID.randomUUID()); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); <START> CommonTestUtils.waitUntilCondition(() -> dispatcherGateway.requestJobStatus(jobGraph.getJobID(), TIMEOUT).get() == JobStatus.RUNNING, Deadline.fromNow(Duration.of(10, ChronoUnit.SECONDS)), 20L); <END> assertTrue( "jobManagerRunner was not started", jobMasterLeaderElectionService.getStartFuture().isDone()); }</code><technical_language>wait jobMasterLeaderElectionService.getStartFuture instead of busy polling</technical_language>

Target:
public void testJobSubmission() throws Exception { dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch)); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); jobMasterLeaderElectionService.getStartFuture().get(); assertTrue( "jobManagerRunner was not started", jobMasterLeaderElectionService.getStartFuture().isDone()); }
Source:
<code><START> public PropertyParameter[] getParameters() { <END> return m_parameters.values().toArray(new PropertyParameter[m_parameters.values().size()]); }</code><technical_language>change List<PropertyParameter> is this API fixed</technical_language>

Target:
public Collection<PropertyParameter> getParameters() { return m_parameters.values(); }
Source:
<code>private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); TableScanNode tableScan = new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column"))); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of(), Optional.empty(), GATHER); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)), StageExecutionStrategy.ungroupedExecution(), <START> emptyMap(), <END> emptyMap()); return new StageExecutionPlan( testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource)), ImmutableList.of()); }</code><technical_language>ImmutableMap.of()</technical_language>

Target:
private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); TableScanNode tableScan = new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column"))); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of(), Optional.empty(), GATHER); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)), StageExecutionStrategy.ungroupedExecution(), StatsAndCosts.empty()); return new StageExecutionPlan( testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource)), ImmutableList.of()); }
Source:
<code>protected boolean validate() { if (isImagesAlreadyOnTarget()) { if (!validateExternalVnicProfileMapping()) { return false; } ImportValidator importValidator = getImportValidator(); if (!validate(importValidator.validateUnregisteredEntity(vmFromConfiguration, ovfEntityData))) { return false; } if (!validateMacs(vmFromConfiguration)) { return false; } if (!validate(importValidator.validateStorageExistForUnregisteredEntity(getImages(), getParameters().isAllowPartialImport(), imageToDestinationDomainMap, failedDisksToImportForAuditLog))) { return false; } if <START> (!validate(importValidator.validateStorageExistForMemoryDisks(getVm().getSnapshots(), <END> getParameters().isAllowPartialImport(), failedDisksToImportForAuditLog))) { return false; } setImagesWithStoragePoolId(getParameters().getStoragePoolId(), getVm().getImages()); } return super.validate(); }</code><technical_language>Exists</technical_language>

Target:
protected boolean validate() { if (isImagesAlreadyOnTarget()) { if (!validateExternalVnicProfileMapping()) { return false; } ImportValidator importValidator = getImportValidator(); if (!validate(importValidator.validateUnregisteredEntity(vmFromConfiguration, ovfEntityData))) { return false; } if (!validateMacs(vmFromConfiguration)) { return false; } if (!validate(importValidator.validateStorageExistForUnregisteredEntity(getImages(), getParameters().isAllowPartialImport(), imageToDestinationDomainMap, failedDisksToImportForAuditLog))) { return false; } if (!validate(importValidator.validateStorageExistsForMemoryDisks(getVm().getSnapshots(), getParameters().isAllowPartialImport(), failedDisksToImportForAuditLog))) { return false; } setImagesWithStoragePoolId(getParameters().getStoragePoolId(), getVm().getImages()); } return super.validate(); }
Source:
<code>protected boolean checkIfElementOnPage(By cssSelectorBy) { changeImplicitWait(500, TimeUnit.MILLISECONDS); boolean isElementOnPage = true; try { if (driver.findElements(cssSelectorBy).size() < 1) { isElementOnPage = false; } <START> } catch (Exception ex) { <END> isElementOnPage = false; } finally { restoreDeaultImplicitWait(); } return isElementOnPage; }</code><technical_language>catch exception</technical_language>

Target:
protected boolean checkIfElementOnPage(By cssSelectorBy) { changeImplicitWait(500, TimeUnit.MILLISECONDS); try { return driver.findElements(cssSelectorBy).size() > 0; } finally { restoreDeaultImplicitWait(); } }
Source:
<code>public void unregisterFor(GitHubRepositoryName name, List<GitHubRepositoryName> aliveRepos) { try { GHRepository repo = from(name.resolve(allowedToManageHooks())).firstMatch(withAdminAccess()).orNull(); if (!(name.resolve(allowedToManageHooks()).iterator().hasNext())) { if (repo == null) { LOGGER.debug("Skipped removing GitHub webhook for because not configured to Manage Hooks, " + "also there are no credentials with admin access to manage such hooks", name); } else { LOGGER.debug("Skipped removing GitHub webhook for because not configured to Manage Hooks", name); } GitHubHookRegisterProblemMonitor.get().registerProblem(name, new Exception( <START> "Skipped removing GitHub webhook because not configured to Manage Hooks")); <END> return; } repo = checkNotNull(repo, "There are no credentials with admin access to manage hooks on %s", name ); LOGGER.debug("Check for redundant hooks...", repo); Predicate<GHHook> predicate = aliveRepos.contains(name) ? serviceWebhookFor(endpoint) : or(serviceWebhookFor(endpoint), webhookFor(endpoint)); from(fetchHooks().apply(repo)) .filter(predicate) .filter(deleteWebhook()) .filter(log("Deleted hook")).toList(); } catch (Throwable t) { LOGGER.warn("Failed to remove hook from {}", name, t); GitHubHookRegisterProblemMonitor.get().registerProblem(name, t); } }</code><technical_language>a problem if configured manage, message is need</technical_language>

Target:
public void unregisterFor(GitHubRepositoryName name, List<GitHubRepositoryName> aliveRepos) { try { Iterable<GHRepository> manageableIterable = name.resolve(allowedToManageHooks()); GHRepository repo = from(manageableIterable).firstMatch(withAdminAccess()).orNull(); if (!(manageableIterable.iterator().hasNext())) { if (repo == null) { LOGGER.debug("Skipped removing GitHub webhook for because not configured to Manage Hooks, " + "also there are no credentials with admin access to manage such hooks", name); } else { LOGGER.debug("Skipped removing GitHub webhook for because not configured to Manage Hooks", name); } GitHubHookRegisterProblemMonitor.get().registerProblem(name, new Exception( "Skipped removing GitHub webhook because not configured to Manage Hooks")); return; } repo = checkNotNull(repo, "There are no credentials with admin access to manage hooks on %s", name ); LOGGER.debug("Check for redundant hooks...", repo); Predicate<GHHook> predicate = aliveRepos.contains(name) ? serviceWebhookFor(endpoint) : or(serviceWebhookFor(endpoint), webhookFor(endpoint)); from(fetchHooks().apply(repo)) .filter(predicate) .filter(deleteWebhook()) .filter(log("Deleted hook")).toList(); } catch (Throwable t) { LOGGER.warn("Failed to remove hook from {}", name, t); GitHubHookRegisterProblemMonitor.get().registerProblem(name, t); } }
Source:
<code>public synchronized Collection<PendingConfirm> expire(Listener listener, long cutoffTime) { SortedMap<Long, PendingConfirm> pendingConfirmsForListener = this.pendingConfirms.get(listener); if (pendingConfirmsForListener == null) { return Collections.<PendingConfirm>emptyList(); } else { <START> synchronized (pendingConfirmsForListener) { <END> List<PendingConfirm> expired = new ArrayList<PendingConfirm>(); Iterator<Entry<Long, PendingConfirm>> iterator = pendingConfirmsForListener.entrySet().iterator(); while (iterator.hasNext()) { PendingConfirm pendingConfirm = iterator.next().getValue(); if (pendingConfirm.getTimestamp() < cutoffTime) { expired.add(pendingConfirm); iterator.remove(); } else { break; } } return expired; } } }</code><technical_language>explain this? strange for synchronize local variable. is more suspicious method is synchronized. other methods deal this.pendingConfirms.get(listener)</technical_language>

Target:
public synchronized Collection<PendingConfirm> expire(Listener listener, long cutoffTime) { SortedMap<Long, PendingConfirm> pendingConfirmsForListener = this.pendingConfirms.get(listener); if (pendingConfirmsForListener == null) { return Collections.<PendingConfirm>emptyList(); } else { List<PendingConfirm> expired = new ArrayList<PendingConfirm>(); Iterator<Entry<Long, PendingConfirm>> iterator = pendingConfirmsForListener.entrySet().iterator(); while (iterator.hasNext()) { PendingConfirm pendingConfirm = iterator.next().getValue(); if (pendingConfirm.getTimestamp() < cutoffTime) { expired.add(pendingConfirm); iterator.remove(); } else { break; } } return expired; } }
Source:
<code>public void createServiceBusProcessorClient() { Consumer<ServiceBusReceivedMessageContext> processMessage = messageContext -> { try { System.out.println(messageContext.getMessage().getMessageId()); messageContext.complete(); } catch (Exception ex) { messageContext.abandon(); } }; Consumer<ServiceBusErrorContext> processError = errorContext -> { System.err.println("Error occurred while receiving message: " + errorContext.getException()); }; ServiceBusProcessorClient processorClient = new ServiceBusClientBuilder() .connectionString("<< CONNECTION STRING FOR THE SERVICE BUS NAMESPACE >>") .processor() .queueName("<< QUEUE NAME >>") <START> .processMessage(processMessage) <END> .processError(processError) .buildProcessorClient(); processorClient.start(); }</code><technical_language>Add .disableAutoComplete() default autoComplete is enabled, this means this SDK internally complete message for user do need call messageContext.complete() . want show user disable this feature calling disableAutoComplete complete manually (like do in processMessage Consumer). this bug in readme left over, touching this specific part, fix this also. Thank</technical_language>

Target:
public void createServiceBusProcessorClient() { Consumer<ServiceBusReceivedMessageContext> processMessage = messageContext -> { try { System.out.println(messageContext.getMessage().getMessageId()); messageContext.complete(); } catch (Exception ex) { messageContext.abandon(); } }; Consumer<ServiceBusErrorContext> processError = errorContext -> { System.err.println("Error occurred while receiving message: " + errorContext.getException()); }; ServiceBusProcessorClient processorClient = new ServiceBusClientBuilder() .connectionString("<< CONNECTION STRING FOR THE SERVICE BUS NAMESPACE >>") .processor() .queueName("<< QUEUE NAME >>") .processMessage(processMessage) .processError(processError) .disableAutoComplete() .buildProcessorClient(); processorClient.start(); }
Source:
<code><START> public boolean equals(final Object obj) { <END> if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (this.getClass() != obj.getClass()) { return false; } final SmartMeter other = (SmartMeter) obj; if (this.channel == null) { if (other.channel != null) { return false; } } else if (!this.channel.equals(other.channel)) { return false; } if (this.supplier == null) { if (other.supplier != null) { return false; } } else if (!this.supplier.equals(other.supplier)) { return false; } return true; }</code><technical_language>java.util.Objects</technical_language>

Target:
public boolean equals(final Object obj) { return super.equals(obj) && Objects.equals(this.supplier, ((SmartMeter) obj).supplier) && Objects.equals(this.channel, ((SmartMeter) obj).channel); }
Source:
<code>public void into(ImageView target, Callback callback) { long started = System.nanoTime(); checkMain(); if (target == null) { throw new IllegalArgumentException("Target must not be null."); } if (!data.hasImage()) { picasso.cancelRequest(target); if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } return; } if (deferred) { if (data.hasSize()) { throw new IllegalStateException("Fit cannot be used with resize."); } int width = target.getWidth(); int height = target.getHeight(); if (width == 0 || height == 0) { if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } picasso.defer(target, new DeferredRequestCreator(this, target, callback)); return; } data.resize(width, height); } Request request = createRequest(started); String requestKey = createKey(request); <START> if ((memoryPolicy & MemoryPolicy.NO_CACHE.index) == 0) { <END> Bitmap bitmap = picasso.quickMemoryCacheCheck(requestKey); if (bitmap != null) { picasso.cancelRequest(target); setBitmap(target, picasso.context, bitmap, MEMORY, noFade, picasso.indicatorsEnabled); if (picasso.loggingEnabled) { log(OWNER_MAIN, VERB_COMPLETED, request.plainId(), "from " + MEMORY); } if (callback != null) { callback.onSuccess(); } return; } } if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } Action action = new ImageViewAction(picasso, target, request, memoryPolicy, noFade, errorResId, errorDrawable, requestKey, tag, callback); picasso.enqueueAndSubmit(action); }</code><technical_language>This is hard read over. add static methods MemoryPolicy nice semantic names? I want MemoryPolicy.shouldReadFromCache MemoryPolicy.shouldWriteToCache (or names fit)</technical_language>

Target:
public void into(ImageView target, Callback callback) { long started = System.nanoTime(); checkMain(); if (target == null) { throw new IllegalArgumentException("Target must not be null."); } if (!data.hasImage()) { picasso.cancelRequest(target); if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } return; } if (deferred) { if (data.hasSize()) { throw new IllegalStateException("Fit cannot be used with resize."); } int width = target.getWidth(); int height = target.getHeight(); if (width == 0 || height == 0) { if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } picasso.defer(target, new DeferredRequestCreator(this, target, callback)); return; } data.resize(width, height); } Request request = createRequest(started); String requestKey = createKey(request); if (shouldReadFromMemoryCache(memoryPolicy)) { Bitmap bitmap = picasso.quickMemoryCacheCheck(requestKey); if (bitmap != null) { picasso.cancelRequest(target); setBitmap(target, picasso.context, bitmap, MEMORY, noFade, picasso.indicatorsEnabled); if (picasso.loggingEnabled) { log(OWNER_MAIN, VERB_COMPLETED, request.plainId(), "from " + MEMORY); } if (callback != null) { callback.onSuccess(); } return; } } if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } Action action = new ImageViewAction(picasso, target, request, memoryPolicy, noFade, errorResId, errorDrawable, requestKey, tag, callback); picasso.enqueueAndSubmit(action); }
Source:
<code>static GoogleCloudStorageFileSystemOptions.Builder getGcsFsOptionsBuilder(Configuration config) <START> throws IOException { <END> return GoogleCloudStorageFileSystemOptions.builder() .setBucketDeleteEnabled(GCE_BUCKET_DELETE_ENABLE.get(config, config::getBoolean)) .setMarkerFilePattern(GCS_MARKER_FILE_PATTERN.get(config, config::get)) .setPerformanceCacheEnabled(GCS_PERFORMANCE_CACHE_ENABLE.get(config, config::getBoolean)) .setCooperativeLockingEnabled( GCS_COOPERATIVE_LOCKING_ENABLE.get(config, config::getBoolean)) .setPerformanceCacheOptions(getPerformanceCachingOptions(config)) .setStatusParallelEnabled(GCS_STATUS_PARALLEL_ENABLE.get(config, config::getBoolean)) .setCloudStorageOptions(getGcsOptionsBuilder(config).build()); }</code><technical_language>Do need (here below) throws changes</technical_language>

Target:
static GoogleCloudStorageFileSystemOptions.Builder getGcsFsOptionsBuilder(Configuration config) { return GoogleCloudStorageFileSystemOptions.builder() .setBucketDeleteEnabled(GCE_BUCKET_DELETE_ENABLE.get(config, config::getBoolean)) .setMarkerFilePattern(GCS_MARKER_FILE_PATTERN.get(config, config::get)) .setPerformanceCacheEnabled(GCS_PERFORMANCE_CACHE_ENABLE.get(config, config::getBoolean)) .setCooperativeLockingEnabled( GCS_COOPERATIVE_LOCKING_ENABLE.get(config, config::getBoolean)) .setPerformanceCacheOptions(getPerformanceCachingOptions(config)) .setStatusParallelEnabled(GCS_STATUS_PARALLEL_ENABLE.get(config, config::getBoolean)) .setCloudStorageOptions(getGcsOptionsBuilder(config).build()); }
Source:
<code>public void onUpdate(String interpreterGroupId, AngularObject object) { if (getNotebook() == null || object.getNoteId() == null) { return; } <START> Note note = getNotebook().getNote(object.getNoteId()); <END> if (null != note) { List<InterpreterSetting> intpSettings = getNotebook().getInterpreterSettingManager().getInterpreterSettings(note.getId()); if (intpSettings.isEmpty()) { return; } connectionManager.broadcast(note.getId(), new Message(OP.ANGULAR_OBJECT_UPDATE) .put("angularObject", object) .put("interpreterGroupId", interpreterGroupId).put("noteId", note.getId()) .put("paragraphId", object.getParagraphId())); } }</code><technical_language>getNotebook().getNote(note id) @jongyoul @zjffdu</technical_language>

Target:
public void onUpdate(String interpreterGroupId, AngularObject object) { if (getNotebook() == null) { return; } List<Note> notes = getNotebook().getAllNotes(); for (Note note : notes) { if (object.getNoteId() != null && !note.getId().equals(object.getNoteId())) { continue; } List<InterpreterSetting> intpSettings = getNotebook().getInterpreterSettingManager().getInterpreterSettings(note.getId()); if (intpSettings.isEmpty()) { continue; } connectionManager.broadcast(note.getId(), new Message(OP.ANGULAR_OBJECT_UPDATE) .put("angularObject", object) .put("interpreterGroupId", interpreterGroupId).put("noteId", note.getId()) .put("paragraphId", object.getParagraphId())); } }