auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testAuthorityInAliasedList() throws IOException { <START> AuthorityValidationMetadataCache.clearAuthorityValidationCache(); <END> final HttpURLConnection mockedConnection = Mockito.mock(HttpURLConnection.class); HttpUrlConnectionFactory.setMockedHttpUrlConnection(mockedConnection); Util.prepareMockedUrlConnection(mockedConnection); Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(getDiscoveryResponse())); Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); final String authorityUrl1 = "<LINK_0>"; try { final Discovery discovery = new Discovery(); discovery.validateAuthority(new URL(authorityUrl1)); } catch (AuthenticationException e) { fail(); } final String aliasedAuthorityUrl = "<LINK_1>"; try { final Discovery discovery = new Discovery(); discovery.validateAuthority(new URL(aliasedAuthorityUrl)); } catch (AuthenticationException e) { fail(); } final String aliasedAuthorityUrl2 = "<LINK_2>"; try { final Discovery discovery = new Discovery(); discovery.validateAuthority(new URL(aliasedAuthorityUrl2)); } catch (AuthenticationException e) { fail(); } Mockito.verify(mockedConnection, Mockito.times(1)).getInputStream(); }</code><technical_language>Nit: more place in a setUp() function</technical_language>

Target:
public void testAuthorityInAliasedList() throws IOException { final HttpURLConnection mockedConnection = Mockito.mock(HttpURLConnection.class); HttpUrlConnectionFactory.setMockedHttpUrlConnection(mockedConnection); Util.prepareMockedUrlConnection(mockedConnection); Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(getDiscoveryResponse())); Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); final String authorityUrl1 = "<LINK_0>"; try { final Discovery discovery = new Discovery(); discovery.validateAuthority(new URL(authorityUrl1)); } catch (AuthenticationException e) { fail(); } final String aliasedAuthorityUrl = "<LINK_1>"; try { final Discovery discovery = new Discovery(); discovery.validateAuthority(new URL(aliasedAuthorityUrl)); } catch (AuthenticationException e) { fail(); } final String aliasedAuthorityUrl2 = "<LINK_2>"; try { final Discovery discovery = new Discovery(); discovery.validateAuthority(new URL(aliasedAuthorityUrl2)); } catch (AuthenticationException e) { fail(); } Mockito.verify(mockedConnection, Mockito.times(1)).getInputStream(); }
Source:
<code>public IndexPreprocessor(final String prefix, final String theNamespace_url, final String draftParameter) { this.prefix = prefix; this.namespace_url = theNamespace_url; this.excludedDraftSection.clear(); this.excludedDraftSection.add(false); <START> includeDraft = draftParameter.equals(ARGS_DRAFT_YES) ? true : false; <END> indexDitaProcessor = new IndexDitaProcessor(); indexGroupProcessor = new IndexGroupProcessor(); }</code><technical_language>Simplify this java includeDraft = draftParameter.equals(ARGS_DRAFT_YES);</technical_language>

Target:
public IndexPreprocessor(final String prefix, final String theNamespace_url, final String draftParameter) { this.prefix = prefix; this.namespace_url = theNamespace_url; this.excludedDraftSection.clear(); this.excludedDraftSection.add(false); includeDraft = draftParameter.equals(ARGS_DRAFT_YES); indexDitaProcessor = new IndexDitaProcessor(); indexGroupProcessor = new IndexGroupProcessor(); }
Source:
<code>private PythonVariables getPyInputsFromWritables(List<Writable> writables){ PythonVariables ret = new PythonVariables(); for (String name: pyInputs.getVariables()){ int colIdx = inputSchema.getIndexOfColumn(name); Writable w = writables.get(colIdx); PythonVariables.Type pyType = pyInputs.getType(name); switch (pyType){ case INT: if (w instanceof LongWritable){ ret.addInt(name, ((LongWritable)w).get()); } else{ ret.addInt(name, ((IntWritable)w).get()); } break; <START> case FLOAT: <END> ret.addFloat(name, ((DoubleWritable)w).get()); break; case STR: ret.addStr(name, ((Text)w).toString()); break; case NDARRAY: ret.addNDArray(name,((NDArrayWritable)w).get()); break; } } return ret; }</code><technical_language>FloatWritable DoubleWritable. cover cases</technical_language>

Target:
private PythonVariables getPyInputsFromWritables(List<Writable> writables){ PythonVariables ret = new PythonVariables(); for (String name: pyInputs.getVariables()){ int colIdx = inputSchema.getIndexOfColumn(name); Writable w = writables.get(colIdx); PythonVariables.Type pyType = pyInputs.getType(name); switch (pyType){ case INT: if (w instanceof LongWritable){ ret.addInt(name, ((LongWritable)w).get()); } else{ ret.addInt(name, ((IntWritable)w).get()); } break; case FLOAT: if (w instanceof DoubleWritable){ ret.addFloat(name, ((DoubleWritable)w).get()); } else{ ret.addFloat(name, ((FloatWritable)w).get()); } break; case STR: ret.addStr(name, ((Text)w).toString()); break; case NDARRAY: ret.addNDArray(name,((NDArrayWritable)w).get()); break; } } return ret; }
Source:
<code>public void shouldGetCohortQueryReportWithGivenParameters() { String cohortQueryUuid = "QQQ"; Map<String, String> parameters = new HashMap<>(); parameters.put("param1", "value"); parameters.put("param2", "value"); ArgumentCaptor<String> uuidCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<Map> parametersCaptor = ArgumentCaptor.forClass(Map.class); doReturn(prepareCohortQueryReportWithMembers()).when(cohortService) .getCohortQueryReport(eq(CONFIG_NAME), eq(cohortQueryUuid), eq(parameters)); openMRSActionProxyService.getCohortQueryReport(CONFIG_NAME, cohortQueryUuid, parameters); verify(cohortService).getCohortQueryReport(eq(CONFIG_NAME), uuidCaptor.capture(), parametersCaptor.capture()); <START> verify(eventRelay, times(3)).sendEventMessage(Matchers.<MotechEvent>any()); <END> assertEquals(cohortQueryUuid, uuidCaptor.getValue()); assertEquals(parameters, parametersCaptor.getValue()); }</code><technical_language>verify if parameters in motech event</technical_language>

Target:
public void shouldGetCohortQueryReportWithGivenParameters() { String cohortQueryUuid = "QQQ"; Map<String, String> parameters = new HashMap<>(); parameters.put("param1", "value"); parameters.put("param2", "value"); ArgumentCaptor<String> uuidCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<Map> parametersCaptor = ArgumentCaptor.forClass(Map.class); ArgumentCaptor<MotechEvent> eventCaptor = ArgumentCaptor.forClass(MotechEvent.class); doReturn(prepareCohortQueryReport(true)).when(cohortService) .getCohortQueryReport(eq(CONFIG_NAME), eq(cohortQueryUuid), eq(parameters)); openMRSActionProxyService.getCohortQueryReport(CONFIG_NAME, cohortQueryUuid, parameters); verify(cohortService).getCohortQueryReport(eq(CONFIG_NAME), uuidCaptor.capture(), parametersCaptor.capture()); verify(eventRelay, times(2)).sendEventMessage(eventCaptor.capture()); assertEquals(cohortQueryUuid, uuidCaptor.getValue()); assertEquals(parameters, parametersCaptor.getValue()); List<MotechEvent> capturedEvents = eventCaptor.getAllValues(); assertEquals(createEventForMember(cohortQueryUuid, prepareCohortQueryReportMember("1")), capturedEvents.get(0)); assertEquals(createEventForMember(cohortQueryUuid, prepareCohortQueryReportMember("2")), capturedEvents.get(1)); }
Source:
<code>public boolean isVisible(Widget widget) { <START> if (widget.isDisposed()) <END> return false; boolean ret = true; Object o = null; try { o = ObjectUtil.invokeMethod(widget, "isVisible"); } catch (RuntimeException e) { throw new CoreLayerException( "Runtime error during checking widget visibility", e); } if (o instanceof Boolean) { ret = ((Boolean) o).booleanValue(); } return ret; }</code><technical_language>Roll changes in handler. do check a widget is disposed in handler methods</technical_language>

Target:
public boolean isVisible(Widget widget) { boolean ret = true; Object o = null; try { o = ObjectUtil.invokeMethod(widget, "isVisible"); } catch (RuntimeException e) { throw new CoreLayerException( "Runtime error during checking widget visibility", e); } if (o == null) { return ret; } if (o instanceof Boolean) { ret = ((Boolean) o).booleanValue(); } return ret; }
Source:
<code>public void testInsertSingleInstance() { RowSnapshot<TaskLists> taskList = new VirtualRowSnapshot<>(new LocalTaskListsTable(mAuthority)); RowSnapshot<Instances> instance = new VirtualRowSnapshot<>(new InstanceTable(mAuthority)); assertThat(new Seq<>( new Put<>(taskList, new NameData("list1")), new Referring<>(taskList, Tasks.LIST_ID, new Put<>(instance, new CharSequenceRowData<>(Tasks.TITLE, "task1"))) ), resultsIn(mClient, new Assert<>(taskList, new NameData("list1")), new AssertRelated<>(new InstanceTable(mAuthority), Tasks.LIST_ID, taskList, new Composite<>( new InstanceData(Instances.INSTANCE_STATUS_NEXT), <START> new CharSequenceRowData<>(Tasks.TITLE, "task1")) <END> ))); }</code><technical_language>"TaskList" is copy'n'pasted method ;-) Oh, I ;) please correct then</technical_language>

Target:
public void testInsertSingleInstance() { RowSnapshot<TaskLists> taskList = new VirtualRowSnapshot<>(new LocalTaskListsTable(mAuthority)); RowSnapshot<Instances> instance = new VirtualRowSnapshot<>(new InstanceTable(mAuthority)); assertThat(new Seq<>( new Put<>(taskList, new NameData("list1")), new Referring<>(taskList, Tasks.LIST_ID, new Put<>(instance, new CharSequenceRowData<>(Tasks.TITLE, "task1"))) ), resultsIn(mClient, new Assert<>(taskList, new NameData("list1")), new AssertRelated<>(new InstanceTable(mAuthority), Tasks.LIST_ID, taskList, new Composite<>( new InstanceTestData(0), new CharSequenceRowData<>(Tasks.TITLE, "task1"), new CharSequenceRowData<>(Tasks.TZ, null)) ))); }
Source:
<code>public void updateTo(String sha, Boolean force) throws IOException { root.retrieve() <START> .method("POST") <END> .with("sha", sha) .with("force", force) .method("PATCH") .withUrlPath(url) .to(GHRef.class) .wrap(root); }</code><technical_language>Multiple method(*) methods</technical_language>

Target:
public void updateTo(String sha, Boolean force) throws IOException { root.createRequest() .method("PATCH") .with("sha", sha) .with("force", force) .withUrlPath(url) .fetch(GHRef.class) .wrap(root); }
Source:
<code>public static DSLContext databaseAgnostic(DataSource dataSource) throws SQLException { SQLDialect dialect; <START> try (Connection conn = dataSource.getConnection()) { <END> dialect = dialect(conn); } return DSL.using(dataSource, SQLDialect.H2, new Settings() .withRenderSchema(false) .withRenderNameStyle(RenderNameStyle.AS_IS)); }</code><technical_language>try block</technical_language>

Target:
public static DSLContext databaseAgnostic(DataSource dataSource) throws SQLException { SQLDialect dialect; try (Connection conn = dataSource.getConnection()) { dialect = dialect(conn); } return DSL.using(dataSource, dialect, new Settings() .withRenderSchema(false) .withRenderNameStyle(RenderNameStyle.AS_IS)); }
Source:
<code>int getBlock(final AbfsInputStream stream, final long position, final int length, final byte[] buffer) <START> throws java.io.IOException { <END> if (LOGGER.isTraceEnabled()) { LOGGER.trace("getBlock for file position thread {}", stream.getPath(), position, Thread.currentThread().getName()); } waitForProcess(stream, position); int bytesRead = 0; synchronized (this) { bytesRead = getBlockFromCompletedQueue(stream, position, length, buffer); } if (bytesRead > 0) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Done read from Cache for position length {}", stream.getPath(), position, bytesRead); } return bytesRead; } return 0; }</code><technical_language>java.io.IOException IOException</technical_language>

Target:
int getBlock(final AbfsInputStream stream, final long position, final int length, final byte[] buffer) throws IOException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("getBlock for file position thread {}", stream.getPath(), position, Thread.currentThread().getName()); } waitForProcess(stream, position); int bytesRead = 0; synchronized (this) { bytesRead = getBlockFromCompletedQueue(stream, position, length, buffer); } if (bytesRead > 0) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Done read from Cache for position length {}", stream.getPath(), position, bytesRead); } return bytesRead; } return 0; }
Source:
<code>protected Map.Entry<String, Map> buildProcedureQueryWithParams(String storedProcedureName, ProcedureQueryParameters queryParameters) { StringBuilder queryBuilder = new StringBuilder(); queryBuilder.append( "CALL " ).append( storedProcedureName ).append( "(" ); Map namedParams = new HashMap<>(); List parameters = queryParameters.getPositionalParameters(); for ( int i = 0; i < parameters.size(); i++ ) { <START> queryBuilder.append( "{a" + i + "}," ); <END> namedParams.put( "a" + i, parameters.get( i ) ); } queryBuilder.replace( queryBuilder.lastIndexOf( "," ), queryBuilder.length(), ")" ); return new AbstractMap.SimpleEntry<>( queryBuilder.toString(), namedParams ); }</code><technical_language>I fine, a curiosity: add 'a' in front of parameter name</technical_language>

Target:
protected Map.Entry<String, Map<String, Object>> buildProcedureQueryWithParams(String storedProcedureName, ProcedureQueryParameters queryParameters) { StringBuilder queryBuilder = new StringBuilder(); queryBuilder.append( "CALL " ).append( storedProcedureName ).append( "(" ); Map<String, Object> namedParams; if ( queryParameters.getPositionalParameters() != null && queryParameters.getPositionalParameters() .size() > 0 ) { namedParams = new HashMap<>(); List parameters = queryParameters.getPositionalParameters(); for ( int i = 0; i < parameters.size(); i++ ) { queryBuilder.append( "{" ).append( i ).append( "}," ); namedParams.put( String.valueOf( i ), parameters.get( i ) ); } } else { namedParams = queryParameters.getNamedParameters(); for ( String namedParameter : namedParams.keySet() ) { queryBuilder.append( "{" ).append( namedParameter ).append( "}," ); } } queryBuilder.replace( queryBuilder.lastIndexOf( "," ), queryBuilder.length(), ")" ); return new AbstractMap.SimpleEntry<>( queryBuilder.toString(), namedParams ); }
Source:
<code>public List<Ref> call() throws GitAPIException { checkCallable(); List<Ref> resultRefs; try { Collection<Ref> refs = new ArrayList<>(); Ref head = repo.exactRef(HEAD); if (head != null && <START> head.getLeaf().getName().equals(HEAD)) <END> refs.add(head); if (listMode == null) { refs.addAll(repo.getRefDatabase().getRefsByPrefix(R_HEADS)); } else if (listMode == ListMode.REMOTE) { refs.addAll(repo.getRefDatabase().getRefsByPrefix(R_REMOTES)); } else { refs.addAll(repo.getRefDatabase().getRefsByPrefix(R_HEADS, R_REMOTES)); } resultRefs = new ArrayList<>(filterRefs(refs)); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } Collections.sort(resultRefs, new Comparator<Ref>() { @Override public int compare(Ref o1, Ref o2) { return o1.getName().compareTo(o2.getName()); } }); setCallable(false); return resultRefs; }</code><technical_language>nit: Add braces touching code</technical_language>

Target:
public List<Ref> call() throws GitAPIException { checkCallable(); List<Ref> resultRefs; try { Collection<Ref> refs = new ArrayList<>(); Ref head = repo.exactRef(HEAD); if (head != null && head.getLeaf().getName().equals(HEAD)) { refs.add(head); } if (listMode == null) { refs.addAll(repo.getRefDatabase().getRefsByPrefix(R_HEADS)); } else if (listMode == ListMode.REMOTE) { refs.addAll(repo.getRefDatabase().getRefsByPrefix(R_REMOTES)); } else { refs.addAll(repo.getRefDatabase().getRefsByPrefix(R_HEADS, R_REMOTES)); } resultRefs = new ArrayList<>(filterRefs(refs)); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } Collections.sort(resultRefs, new Comparator<Ref>() { @Override public int compare(Ref o1, Ref o2) { return o1.getName().compareTo(o2.getName()); } }); setCallable(false); return resultRefs; }
Source:
<code>public void testWithNoPrefixSet() { <START> final PrefixedSpringCredentialBuilder builder = new PrefixedSpringCredentialBuilder(); <END> assertThrows(IllegalArgumentException.class, builder::build); }</code><technical_language>Need set environment here</technical_language>

Target:
public void testWithNoPrefixSet() { final PrefixedSpringCredentialBuilder builder = new PrefixedSpringCredentialBuilder(); builder.environment(buildEnvironment(new Properties())); assertThrows(IllegalArgumentException.class, builder::build); }
Source:
<code><START> public Config buildConfig(Config defaultConfig, @Nullable String workspaceId) <END> throws InfrastructureException { return defaultConfig; }</code><technical_language>show this method is supposed consumers of this class making method protected</technical_language>

Target:
protected Config buildConfig(Config defaultConfig, @Nullable String workspaceId) throws InfrastructureException { return defaultConfig; }
Source:
<code><START> public static ObservableBehaviorAdapter create() { <END> return INSTANCE; }</code><technical_language>Is this pattern? Weird for create create</technical_language>

Target:
public static ObservableBehaviorAdapter create() { return new ObservableBehaviorAdapter(); }
Source:
<code>public void setSolShip(SolShip hero, SolGame solGame) { <START> isInvincible = false; <END> isDead = false; if (hero != shipHero && !isTranscendent) { mercs = new ItemContainer(); } this.shipHero = hero; isTranscendent = false; if (shipHero.getTradeContainer() != null) { throw new SolException("Hero is not supposed to have TradeContainer."); } GameOptions options = solGame.getSolApplication().getOptions(); if (hero.getHull() != null) solGame.getSolApplication().getMusicManager().registerModuleMusic(hero.getHull().getHullConfig().getInternalName().split(":")[0], options); solGame.getSolApplication().getMusicManager().playMusic(OggMusicManager.GAME_MUSIC_SET, options); }</code><technical_language>do reset invincibility exiting stargates</technical_language>

Target:
public void setSolShip(SolShip hero, SolGame solGame) { isDead = false; if (hero != shipHero && !isTranscendent) { mercs = new ItemContainer(); } this.shipHero = hero; isTranscendent = false; if (shipHero.getTradeContainer() != null) { throw new SolException("Hero is not supposed to have TradeContainer."); } GameOptions options = solGame.getSolApplication().getOptions(); if (hero.getHull() != null) solGame.getSolApplication().getMusicManager().registerModuleMusic(hero.getHull().getHullConfig().getInternalName().split(":")[0], options); solGame.getSolApplication().getMusicManager().playMusic(OggMusicManager.GAME_MUSIC_SET, options); }
Source:
<code>protected void onInitUI() { super.onInitUI(); prev = new Hyperlink(Util.C.pagedChangeListPrev(), true, ""); prev.setVisible(false); next = new Hyperlink(Util.C.pagedChangeListNext(), true, ""); next.setVisible(false); table = new ChangeTable2() { { keysNavigation.add(new DoLinkCommand(0, 'p', Util.C .changeTablePagePrev(), prev)); keysNavigation.add(new DoLinkCommand(0, 'n', Util.C .changeTablePageNext(), next)); } }; section = new ChangeTable2.Section(); table.addSection(section); table.setSavePointerId(anchorPrefix); HorizontalPanel copySearchResultPanel = new HorizontalPanel(); <START> copySearchResultPanel.add(new Label(Util.C.pagedCopySearchResults())); <END> copySearchResultPanel.add(copySearchResult = new CopyableLabel("", false)); setTitleFarEast(copySearchResultPanel); add(table); final HorizontalPanel buttons = new HorizontalPanel(); buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks()); buttons.add(prev); buttons.add(next); add(buttons); }</code><technical_language>is this 'button' in commit message? do need this Label</technical_language>

Target:
protected void onInitUI() { super.onInitUI(); prev = new Hyperlink(Util.C.pagedChangeListPrev(), true, ""); prev.setVisible(false); next = new Hyperlink(Util.C.pagedChangeListNext(), true, ""); next.setVisible(false); table = new ChangeTable2() { { keysNavigation.add(new DoLinkCommand(0, 'p', Util.C .changeTablePagePrev(), prev)); keysNavigation.add(new DoLinkCommand(0, 'n', Util.C .changeTablePageNext(), next)); keysNavigation.add(new DoLinkCommand(0, '[', Util.C .changeTablePagePrev(), prev)); keysNavigation.add(new DoLinkCommand(0, ']', Util.C .changeTablePageNext(), next)); keysNavigation.add(new KeyCommand(0, 'R', Util.C.keyReloadSearch()) { @Override public void onKeyPress(final KeyPressEvent event) { Gerrit.display(getToken()); } }); } }; section = new ChangeTable2.Section(); table.addSection(section); table.setSavePointerId(anchorPrefix); HorizontalPanel copySearchResultPanel = new HorizontalPanel(); copySearchResultPanel.add(new Label(Util.C.pagedCopySearchResults())); copySearchResultPanel.add(copySearchResult = new CopyableLabel("", false)); setTitleFarEast(copySearchResultPanel); add(table); final HorizontalPanel buttons = new HorizontalPanel(); buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks()); buttons.add(prev); buttons.add(next); add(buttons); }
Source:
<code>public void transactionWithNestedExpressionFilterEvaluatesFalseStopsFlowAndReturnsNull() throws Exception { <START> MuleClient client = muleContext.getClient(); <END> client.dispatch("vm://transaction-filter-all", TEST_MESSAGE, null); MuleMessage reply = client.request("vm://transaction-filter-all-reply", RECEIVE_TIMEOUT); assertThat(reply, nullValue()); }</code><technical_language>Refactor dispatch logic in a method in order duplicate code</technical_language>

Target:
public void transactionWithNestedExpressionFilterEvaluatesFalseStopsFlowAndReturnsNull() throws Exception { MuleMessage reply = sendTestMessageVmQueueEndpoint("transaction-filter-all", "transaction-filter-all-reply"); assertThat(reply, nullValue()); }
Source:
<code>public void iteratesContent() throws Exception { final Repos repos = github().repos(); final Repo repo = this.rule.repo(repos); try { final String afile = RandomStringUtils.randomAlphanumeric(Tv.TEN); final String dir = RandomStringUtils.randomAlphanumeric(Tv.TEN); <START> final String bfile = new StringBuilder(dir) <END> .append("/") .append(RandomStringUtils.randomAlphanumeric(Tv.TEN)) .toString(); final String message = String.format("testMessage"); final String acont = new String( Base64.encodeBase64( String.format("content a:%d", System.currentTimeMillis()) .getBytes() ) ); final String bcont = new String( Base64.encodeBase64( String.format("content b:%d", System.currentTimeMillis()) .getBytes() ) ); final Contents contents = repos.get(repo.coordinates()).contents(); contents.create(this.jsonObject(afile, acont, message)); contents.create(this.jsonObject(bfile, bcont, message)); final Content acontent = contents.get(afile); final Content bcontent = contents.get(dir); final Iterable<Content> iterated = contents.iterate("", "master"); MatcherAssert.assertThat( iterated, Matchers.allOf( Matchers.hasItems(acontent, bcontent), Matchers.<Content>iterableWithSize(3) ) ); } finally { repos.remove(repo.coordinates()); } }</code><technical_language>one-time variable also, String.format() instead of StringBuilder</technical_language>

Target:
public void iteratesContent() throws Exception { final Repos repos = github().repos(); final Repo repo = this.rule.repo(repos); try { final String afile = RandomStringUtils.randomAlphanumeric(Tv.TEN); final String dir = RandomStringUtils.randomAlphanumeric(Tv.TEN); final String bfile = String.format( "%s/%s", dir, RandomStringUtils.randomAlphanumeric(Tv.TEN) ); final String message = String.format("testMessage"); final Contents contents = repos.get(repo.coordinates()).contents(); contents.create( this.jsonObject( afile, new String( Base64.encodeBase64( String.format( "content a:%d", System.currentTimeMillis() ).getBytes() ) ), message ) ); contents.create( this.jsonObject( bfile, new String( Base64.encodeBase64( String.format( "content b:%d", System.currentTimeMillis() ).getBytes() ) ), message ) ); final Iterable<Content> iterated = contents.iterate("", "master"); MatcherAssert.assertThat( iterated, Matchers.allOf( Matchers.hasItems(contents.get(afile), contents.get(dir)), Matchers.<Content>iterableWithSize(Tv.THREE) ) ); } finally { repos.remove(repo.coordinates()); } }
Source:
<code>public long getForceValue(boolean noInfantry) { long value = 0; for (UUID uuid : forces.getAllUnits()) { Unit u = getUnit(uuid); if (null == u) { continue; } if (noInfantry && u.getEntity() instanceof Infantry && !(u.getEntity() instanceof BattleArmor)) { continue; } <START> if (u.getEntity() instanceof Dropship) { <END> if (getCampaignOptions().getDropshipContractPercent() == 0) { continue; } if (getCampaignOptions().useEquipmentContractSaleValue()) { value += (getCampaignOptions().getDropshipContractPercent() / 100) * u.getSellValue(); } else { value += (getCampaignOptions().getDropshipContractPercent() / 100) * u.getBuyCost(); } } else if (u.getEntity() instanceof Warship) { if (getCampaignOptions().getWarshipContractPercent() == 0) { continue; } if (getCampaignOptions().useEquipmentContractSaleValue()) { value += (getCampaignOptions().getWarshipContractPercent() / 100) * u.getSellValue(); } else { value += (getCampaignOptions().getWarshipContractPercent() / 100) * u.getBuyCost(); } } else if (u.getEntity() instanceof Jumpship) { if (getCampaignOptions().getJumpshipContractPercent() == 0) { continue; } if (getCampaignOptions().useEquipmentContractSaleValue()) { value += (getCampaignOptions().getJumpshipContractPercent() / 100) * u.getSellValue(); } else { value += (getCampaignOptions().getJumpshipContractPercent() / 100) * u.getBuyCost(); } } else { if (getCampaignOptions().useEquipmentContractSaleValue()) { value += (getCampaignOptions().getEquipmentContractPercent() / 100.0) * u.getSellValue(); } else { value += (getCampaignOptions().getEquipmentContractPercent() / 100.0) * u.getBuyCost(); } } } return value; }</code><technical_language>logic sound, suggest creating a function encapsulates interior of individual if blocks identical logic copy pasted repeatedly. Additionally, I move checking ETYPE_whatever flags instanceof checks</technical_language>

Target:
public long getForceValue(boolean noInfantry) { long value = 0; for (UUID uuid : forces.getAllUnits()) { Unit u = getUnit(uuid); if (null == u) { continue; } if (noInfantry && ((u.getEntity().getEntityType() & Entity.ETYPE_INFANTRY) == Entity.ETYPE_INFANTRY) && !((u.getEntity().getEntityType() & Entity.ETYPE_BATTLEARMOR) == Entity.ETYPE_BATTLEARMOR)) { continue; } if (u.getEntity().hasETypeFlag(Entity.ETYPE_DROPSHIP)) { if (getCampaignOptions().getDropshipContractPercent() == 0) { continue; } value += getEquipmentContractValue(u, getCampaignOptions().useEquipmentContractSaleValue()); } else if (u.getEntity().hasETypeFlag(Entity.ETYPE_WARSHIP)) { if (getCampaignOptions().getWarshipContractPercent() == 0) { continue; } value += getEquipmentContractValue(u, getCampaignOptions().useEquipmentContractSaleValue()); } else if (u.getEntity().hasETypeFlag(Entity.ETYPE_JUMPSHIP) || u.getEntity().hasETypeFlag(Entity.ETYPE_SPACE_STATION)) { if (getCampaignOptions().getJumpshipContractPercent() == 0) { continue; } value += getEquipmentContractValue(u, getCampaignOptions().useEquipmentContractSaleValue()); } else { value += getEquipmentContractValue(u, getCampaignOptions().useEquipmentContractSaleValue()); } } return value; }
Source:
<code>private void findAndThrowStartupErrors(Collection<Module> modules) { List<Exception> errors = new ArrayList<Exception>(); for (Module module : modules) { if (moduleFactoryWrapper.isModuleStopped(module)) { if (module.getStartupErrorMessage() != null) { errors.add(new ModuleException(module.getStartupErrorMessage())); } } } if (!errors.isEmpty()) { StringBuilder stringBuilder = new StringBuilder(); for (Exception error : errors) { stringBuilder.append(error.getMessage()).append("; "); } <START> throw new RuntimeException(stringBuilder.toString()); <END> } }</code><technical_language>throw a runtime exception instead of module exception</technical_language>

Target:
private void findAndThrowStartupErrors(Collection<Module> modules) { List<Exception> errors = new ArrayList<Exception>(); for (Module module : modules) { if (moduleFactoryWrapper.isModuleStopped(module)) { if (module.getStartupErrorMessage() != null) { errors.add(new ModuleException(module.getStartupErrorMessage())); } } } if (!errors.isEmpty()) { StringBuilder stringBuilder = new StringBuilder(); for (Exception error : errors) { stringBuilder.append(error.getMessage()).append("; "); } throw new ModuleException(stringBuilder.toString()); } }
Source:
<code>public void subqueryWithCorrelationOnGroupByColumnThrows() throws Exception { <START> try(ResultSet resultSet = methodWatcher.executeQuery(String.format("SELECT oc1, (SELECT c2 FROM %s WHERE ic2 = %s.oc1) FROM %s GROUP BY oc1 order by oc1 asc", <END> itWatcher.toString(), otWatcher.toString(), otWatcher.toString()))) { Assert.fail("expected exception containing message: Column 'C2' is either not in any table in the FROM list or appears within a join specification and " + "is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or " + "ALTER TABLE statement then 'C2' is not a column in the target table."); } catch(Exception se) { Assert.assertTrue(se instanceof SQLException); Assert.assertEquals("42X04", ((SQLException) se).getSQLState()); Assert.assertTrue(se.getMessage().contains("Column 'C2' is either not in any table in the FROM list or appears within a join specification and is outside " + "the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this " + "is a CREATE or ALTER TABLE statement then 'C2' is not a column in the target table.")); } }</code><technical_language>I c2 ic2, this way, expect error message ERROR 21000: Scalar subquery is allowed return a single row. runtime instead of c2 found. Thanks</technical_language>

Target:
public void subqueryWithCorrelationOnGroupByColumnThrows() throws Exception { try(ResultSet resultSet = methodWatcher.executeQuery(String.format("SELECT oc1, (SELECT ic2 FROM %s WHERE ic2 = %s.oc1) FROM %s GROUP BY oc1 order by oc1 asc", itWatcher.toString(), otWatcher.toString(), otWatcher.toString()))) { Assert.fail("expected exception containing message: Scalar subquery is only allowed to return a single row."); } catch(Exception se) { Assert.assertTrue(se instanceof SQLException); Assert.assertEquals("21000", ((SQLException) se).getSQLState()); Assert.assertTrue(se.getMessage().contains("Scalar subquery is only allowed to return a single row.")); } }
Source:
<code>String getHostname() { try { return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>Hm, thrown InternalProcessingException</technical_language>

Target:
String getHostname() { try { return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { throw new CouldNotResolveHostNameException(e); } }
Source:
<code><START> @Override public float getPressure () { <END> return 0; }</code><technical_language>format overrides</technical_language>

Target:
public float getPressure () { return 0; }
Source:
<code>Item(FragmentResponseMessage msg, long txnId) { m_initiateMsg = null; m_fragmentMsg = msg; <START> m_txnId = txnId; <END> }</code><technical_language>Worth putting explanation of spHandle of fragment</technical_language>

Target:
Item(FragmentResponseMessage msg, long txnId) { m_initiateMsg = null; m_fragmentMsg = msg; m_safeSpHandle = txnId; }
Source:
<code>public void appendAll(final Iterable<Event> events) { <START> final Optional<Event> tenantDiningEvent = tryFind(events, Predicates.<Event>notNull()); <END> if (!tenantDiningEvent.isPresent()) { return; } final Event event = tenantDiningEvent.get(); final TenantAwareOperation op = new EventOperation(event) { @Override public void run() { store(events); } }; op.execute(); logStored(events); }</code><technical_language>I precise naming, tenantDiningEvent brings FrozenMadHatterParty class memories :)</technical_language>

Target:
public void appendAll(final Iterable<Event> events) { checkNotNull(events); final Optional<Event> tenantDefiningEvent = tryFind(events, Predicates.<Event>notNull()); if (!tenantDefiningEvent.isPresent()) { return; } final Event event = tenantDefiningEvent.get(); final TenantAwareOperation op = new EventOperation(event) { @Override public void run() { if (isTenantSet()) { ensureSameTenant(events); } store(events); } }; op.execute(); logStored(events); }
Source:
<code>public static PermanentFlagsResponse parse(ImapResponse response) { <START> ImapList responseTextList = response.getList(1); <END> if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Responses.PERMANENTFLAGS) || !responseTextList.isList(1)) { return null; } ImapList permanentFlagsList = responseTextList.getList(1); int size = permanentFlagsList.size(); Set<Flag> flags = new HashSet<>(size); boolean canCreateKeywords = false; for (int i = 0; i < size; i++) { if (!permanentFlagsList.isString(i)) { return null; } String flag = permanentFlagsList.getString(i); String compareFlag = flag.toLowerCase(Locale.US); switch (compareFlag) { case "\\deleted": { flags.add(Flag.DELETED); break; } case "\\answered": { flags.add(Flag.ANSWERED); break; } case "\\seen": { flags.add(Flag.SEEN); break; } case "\\flagged": { flags.add(Flag.FLAGGED); break; } case "$forwarded": { flags.add(Flag.FORWARDED); break; } case "\\*": { canCreateKeywords = true; break; } } } return new PermanentFlagsResponse(flags, canCreateKeywords); }</code><technical_language>this happen? if can't, a throw new IllegalArgumentException appropriate</technical_language>

Target:
public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Responses.PERMANENTFLAGS) || !responseTextList.isList(1)) { return null; } ImapList permanentFlagsList = responseTextList.getList(1); int size = permanentFlagsList.size(); Set<Flag> flags = new HashSet<>(size); boolean canCreateKeywords = false; for (int i = 0; i < size; i++) { if (!permanentFlagsList.isString(i)) { return null; } String flag = permanentFlagsList.getString(i); String compareFlag = flag.toLowerCase(Locale.US); switch (compareFlag) { case "\\deleted": { flags.add(Flag.DELETED); break; } case "\\answered": { flags.add(Flag.ANSWERED); break; } case "\\seen": { flags.add(Flag.SEEN); break; } case "\\flagged": { flags.add(Flag.FLAGGED); break; } case "$forwarded": { flags.add(Flag.FORWARDED); break; } case "\\*": { canCreateKeywords = true; break; } } } return new PermanentFlagsResponse(flags, canCreateKeywords); }
Source:
<code>private void initHandlers() { btnNestedPresenter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { } }); btnPresenterWidget.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { } }); btnPopupPresenter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { } }); tabbedPanel.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { int index = tabbedPanel.getSelectedIndex(); setPresenterType(index); if (index == 0) { <START> btnNestedPresenter.setSelected(true); <END> btnPresenterWidget.setSelected(false); btnPopupPresenter.setSelected(false); } else if (index == 1) { btnNestedPresenter.setSelected(false); btnPresenterWidget.setSelected(true); btnPopupPresenter.setSelected(false); } else if (index == 2) { btnNestedPresenter.setSelected(false); btnPresenterWidget.setSelected(false); btnPopupPresenter.setSelected(true); } } }); }</code><technical_language>store 3 widgets in array, do for(SomeCommonAncestorClass component : theComponentArray) { component.setSelected(false); } theComponentArray[index].setSelected(true);</technical_language>

Target:
private void initHandlers() { initRadioHandlers(); initTabFoldersHandlers(); initContentEventHandlers(); initPlaceHandlers(); initButtonHandlers(); }
Source:
<code>private String blockingSSLConnect(int socketBufSize) throws IOException { String connectionId = selector.connect(new InetSocketAddress("localhost", server.port), socketBufSize, socketBufSize, PortType.SSL); while (!selector.connected().contains(connectionId)) { <START> System.out.println("here"); <END> selector.poll(10000L); } return connectionId; }</code><technical_language>remove</technical_language>

Target:
private String blockingSSLConnect(int socketBufSize) throws IOException { String connectionId = selector.connect(new InetSocketAddress("localhost", server.port), socketBufSize, socketBufSize, PortType.SSL); while (!selector.connected().contains(connectionId)) { selector.poll(10000L); } return connectionId; }
Source:
<code>public static LinkedHashSet<String> findJars(LogicalPlan dag, Class<?>[] defaultClasses) { List<Class<?>> jarClasses = new ArrayList<>(); for (String className : dag.getClassNames()) { try { Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(className); jarClasses.add(clazz); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Failed to load class " + className, e); } } for (Class<?> clazz : Lists.newArrayList(jarClasses)) { for (Class<?> c = clazz; c != Object.class && c != null; c = c.getSuperclass()) { jarClasses.add(c); jarClasses.addAll(Arrays.asList(c.getInterfaces())); } } jarClasses.addAll(Arrays.asList(defaultClasses)); if (dag.isDebug()) { LOG.debug("Deploy dependencies: {}", jarClasses); } LinkedHashSet<String> localJarFiles = new LinkedHashSet<>(); HashMap<String, String> sourceToJar = new HashMap<>(); for (Class<?> jarClass : jarClasses) { <START> String jar = JarHelper.getJar(jarClass); <END> if (jar != null) { localJarFiles.add(jar); } } String libJarsPath = dag.getValue(Context.DAGContext.LIBRARY_JARS); if (!StringUtils.isEmpty(libJarsPath)) { String[] libJars = StringUtils.splitByWholeSeparator(libJarsPath, LIB_JARS_SEP); localJarFiles.addAll(Arrays.asList(libJars)); } LOG.info("Local jar file dependencies: " + localJarFiles); return localJarFiles; }</code><technical_language>other standard utilities libraries get this information</technical_language>

Target:
public static LinkedHashSet<String> findJars(LogicalPlan dag, Class<?>[] defaultClasses) { List<Class<?>> jarClasses = new ArrayList<>(); for (String className : dag.getClassNames()) { try { Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(className); jarClasses.add(clazz); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Failed to load class " + className, e); } } for (Class<?> clazz : Lists.newArrayList(jarClasses)) { for (Class<?> c = clazz; c != Object.class && c != null; c = c.getSuperclass()) { jarClasses.add(c); jarClasses.addAll(Arrays.asList(c.getInterfaces())); } } jarClasses.addAll(Arrays.asList(defaultClasses)); if (dag.isDebug()) { LOG.debug("Deploy dependencies: {}", jarClasses); } LinkedHashSet<String> localJarFiles = new LinkedHashSet<>(); JarHelper jarHelper = new JarHelper(); for (Class<?> jarClass : jarClasses) { String jar = jarHelper.getJar(jarClass); if (jar != null) { localJarFiles.add(jar); } } String libJarsPath = dag.getValue(Context.DAGContext.LIBRARY_JARS); if (!StringUtils.isEmpty(libJarsPath)) { String[] libJars = StringUtils.splitByWholeSeparator(libJarsPath, LIB_JARS_SEP); localJarFiles.addAll(Arrays.asList(libJars)); } LOG.info("Local jar file dependencies: " + localJarFiles); return localJarFiles; }
Source:
<code>public final int parse (InputStream stream, RepInfo info, int parseIndex) throws IOException { initParse (); info.setModule (this); info.setFormat (_format[0]); info.setMimeType (_mimeType[0]); setupDataStream(stream, info); boolean eof = false; _nByte = 0; byte[] byteBuf = new byte[4096]; while (!eof) { try { int n = readByteBuf (_dstream, byteBuf, this); if (n <= 0) { break; } } catch (EOFException e) { eof = true; } } info.setSize (_nByte); if (_nByte == 0) { info.setMessage (new InfoMessage (CoreMessageConstants.INF_FILE_EMPTY)); } <START> if (_ckSummer != null) { <END> info.setChecksum (new Checksum (_ckSummer.getCRC32 (), ChecksumType.CRC32)); String value = _ckSummer.getMD5 (); if (value != null) { info.setChecksum (new Checksum (value, ChecksumType.MD5)); } if ((value = _ckSummer.getSHA1 ()) != null) { info.setChecksum (new Checksum (value, ChecksumType.SHA1)); } } return 0; }</code><technical_language>I suggest moving this checksum-related code ModuleBase well, apparently a setChecksums method replace this with. want eye out in other modules well</technical_language>

Target:
public final int parse (InputStream stream, RepInfo info, int parseIndex) throws IOException { initParse (); info.setModule (this); info.setFormat (this._format[0]); info.setMimeType (this._mimeType[0]); setupDataStream(stream, info); boolean eof = false; this._nByte = 0; byte[] byteBuf = new byte[4096]; while (!eof) { try { int n = readByteBuf (this._dstream, byteBuf, this); if (n <= 0) { break; } } catch (EOFException e) { _logger.log(Level.FINEST, "End of file exception when parsing.", e); eof = true; } } info.setSize (this._nByte); if (this._nByte == 0) { info.setMessage (new InfoMessage (CoreMessageConstants.INF_FILE_EMPTY)); } setChecksums(this._ckSummer, info); return 0; }
Source:
<code>public void load(Reader theReader, boolean allowArray) throws DataFormatException { PushbackReader pbr = new PushbackReader(theReader); int nextInt; try { while(true) { nextInt = pbr.read(); if (nextInt == -1) { throw new DataFormatException("Did not find any content to parse"); } if (nextInt == '{') { pbr.unread(nextInt); break; } if (Character.isWhitespace(nextInt)) { continue; } if (allowArray) { if (nextInt == '[') { pbr.unread(nextInt); break; } throw new DataFormatException("Content does not appear to be FHIR JSON, first non-whitespace character was: '" + (char)nextInt + "' (must be '{' or '[')"); } throw new DataFormatException("Content does not appear to be FHIR JSON, first non-whitespace character was: '" + (char)nextInt + "' (must be '{')"); } <START> Gson gson = new GsonBuilder().disableHtmlEscaping().create(); <END> if (nextInt == '{') { JsonObject root = gson.fromJson(pbr, JsonObject.class); setNativeObject(root); } else { JsonArray root = gson.fromJson(pbr, JsonArray.class); setNativeArray(root); } } catch (Exception e) { if (e.getMessage().startsWith("Unexpected char 39")) { throw new DataFormatException("Failed to parse JSON encoded FHIR content: " + e.getMessage() + " - " + "This may indicate that single quotes are being used as JSON escapes where double quotes are required", e); } throw new DataFormatException("Failed to parse JSON encoded FHIR content: " + e.getMessage(), e); } }</code><technical_language>I get this is doing.. do need Gson if Jackson</technical_language>

Target:
public void load(Reader theReader, boolean allowArray) throws DataFormatException { PushbackReader pbr = new PushbackReader(theReader); int nextInt; try { while(true) { nextInt = pbr.read(); if (nextInt == -1) { throw new DataFormatException("Did not find any content to parse"); } if (nextInt == '{') { pbr.unread(nextInt); break; } if (Character.isWhitespace(nextInt)) { continue; } if (allowArray) { if (nextInt == '[') { pbr.unread(nextInt); break; } throw new DataFormatException("Content does not appear to be FHIR JSON, first non-whitespace character was: '" + (char)nextInt + "' (must be '{' or '[')"); } throw new DataFormatException("Content does not appear to be FHIR JSON, first non-whitespace character was: '" + (char)nextInt + "' (must be '{')"); } if (nextInt == '{') { setNativeObject((ObjectNode) OBJECT_MAPPER.readTree(pbr)); } else { setNativeArray((ArrayNode) OBJECT_MAPPER.readTree(pbr)); } } catch (Exception e) { if (e.getMessage().startsWith("Unexpected char 39")) { throw new DataFormatException("Failed to parse JSON encoded FHIR content: " + e.getMessage() + " - " + "This may indicate that single quotes are being used as JSON escapes where double quotes are required", e); } throw new DataFormatException("Failed to parse JSON encoded FHIR content: " + e.getMessage(), e); } }
Source:
<code>public void onMapReady(GoogleMap map) { mMap = map; mMap.getUiSettings().setCompassEnabled(false); mMap.getUiSettings().setMyLocationButtonEnabled(false); mMap.moveCamera(CameraUpdateFactory.zoomTo(MapUtils.ZOOM)); LatLng latLng; if (mSchool == null) { latLng = new LatLng(MapUtils.DEFAULT_LAT, MapUtils.DEFAULT_LONG); } else { latLng = new LatLng(mSchool.getLat(), mSchool.getLng()); } moveMapToLatLng(latLng); mBounds = latLng; mRadius.setMax(MAX_RADIUS); final int initialRadius; if (mSchool != null) { initialRadius = mSchool.getRadius(); mRadius.setProgress(initialRadius); } else { initialRadius = 0; } <START> mRadiusInt.setText(Integer.toString(initialRadius) + " m"); <END> mMapView.setRadius(initialRadius); mMap.setOnCameraChangeListener(new GoogleMap.OnCameraChangeListener() { @Override public void onCameraChange(CameraPosition position) { mBounds = mMap.getCameraPosition().target; } }); mRadius.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { int radius = progress; mMapView.setRadius(radius); mRadiusInt.setText(Integer.toString(radius) + " m"); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); }</code><technical_language>String.valueOf is of it, need int + string = string i believe</technical_language>

Target:
public void onMapReady(GoogleMap map) { mMap = map; mMap.getUiSettings().setCompassEnabled(false); mMap.getUiSettings().setMyLocationButtonEnabled(false); mMap.moveCamera(CameraUpdateFactory.zoomTo(MapUtils.ZOOM)); LatLng latLng; if (mSchool == null) { latLng = new LatLng(MapUtils.DEFAULT_LAT, MapUtils.DEFAULT_LONG); } else { latLng = new LatLng(mSchool.getLat(), mSchool.getLng()); } moveMapToLatLng(latLng); mBounds = latLng; mRadius.setMax(MAX_RADIUS); final int initialRadius; if (mSchool != null) { initialRadius = mSchool.getRadius(); mRadius.setProgress(initialRadius); } else { initialRadius = 0; } mRadiusInt.setText(initialRadius + " m"); mMapView.setRadius(initialRadius); mMap.setOnCameraChangeListener(new GoogleMap.OnCameraChangeListener() { @Override public void onCameraChange(CameraPosition position) { mBounds = mMap.getCameraPosition().target; } }); mRadius.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { int radius = progress; mMapView.setRadius(radius); mRadiusInt.setText(radius + " m"); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); }
Source:
<code><START> public InitialLdapContextProvider(String server, String bindDn, String bindDNPwd, Boolean useSSL, String trustStore, String trustStorePassword) { <END> LOGGER.debug("init()"); env.put(Context.SECURITY_AUTHENTICATION, "simple"); if (bindDn != null) { env.put(Context.SECURITY_PRINCIPAL, bindDn); } if (bindDNPwd != null) { env.put(Context.SECURITY_CREDENTIALS, bindDNPwd); } env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, server); if(useSSL) { System.setProperty("javax.net.ssl.trustStore", trustStore); System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword); } }</code><technical_language>in keeping constructors</technical_language>

Target:
public InitialLdapContextProvider(String server, String bindDn, String bindDNPwd, Boolean useSSL, String trustStore, String trustStorePassword) { this(server, bindDn, bindDNPwd); if(useSSL) { System.setProperty("javax.net.ssl.trustStore", trustStore); System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword); } }