auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Set<String> extractAttributes(String attributesParameter) { List<String> strings = Lists.newArrayList("schemas"); if (!Strings.isNullOrEmpty(attributesParameter)) { <START> strings.addAll(Arrays.asList(attributesParameter.split("[,|\\.]"))); <END> } strings.forEach(e -> strings.set(strings.indexOf(e), e.trim())); return new HashSet<>(strings); }</code><technical_language>is . a valid attribute separator</technical_language>

Target:
private Set<String> extractAttributes(String attributesParameter) { Set<String> result = new HashSet<>(); if (!Strings.isNullOrEmpty(attributesParameter)) { result = Sets.newHashSet( Splitter.on(CharMatcher.anyOf(".,")) .trimResults() .omitEmptyStrings() .split(attributesParameter) ); } result.add("schemas"); return result; }
Source:
<code>private void onPrivateMessage(PrivateMessageEvent event) { User user = event.getUser(); if (user == null) { logger.warn("Private message without user: {}", event); return; } logger.debug("Received private message: {}", event); Player sourcePlayer = playerService.getPlayerForUsername(user.getNick()); if (sourcePlayer != null && sourcePlayer.getSocialStatus() == SocialStatus.FOE && preferencesService.getPreferences().getChat().getHideFoeMessages()) { <START> log.info("Chat message was suppressed as sender was foe, sender was: {}", user.getNick()); <END> return; } eventBus.post(new ChatMessageEvent(new ChatMessage(user.getNick(), Instant.ofEpochMilli(event.getTimestamp()), user.getNick(), event.getMessage()))); }</code><technical_language>Please log debug while it, shorten streamline wording to: "Suppressing chat message foe '{}'"</technical_language>

Target:
private void onPrivateMessage(PrivateMessageEvent event) { User user = event.getUser(); if (user == null) { logger.warn("Private message without user: {}", event); return; } logger.debug("Received private message: {}", event); Player sourcePlayer = playerService.getPlayerForUsername(user.getNick()); if (sourcePlayer != null && sourcePlayer.getSocialStatus() == SocialStatus.FOE && preferencesService.getPreferences().getChat().getHideFoeMessages()) { log.debug("Suppressing chat message from foe '{}'", user.getNick()); return; } eventBus.post(new ChatMessageEvent(new ChatMessage(user.getNick(), Instant.ofEpochMilli(event.getTimestamp()), user.getNick(), event.getMessage()))); }
Source:
<code>public FileRawData execute( @DescribeParameter(name="layer", description="WFS layer to query") String layer, @DescribeParameter(name="subset", description="Subset, semi-colon separated") String subset, @DescribeParameter(name="callbackUrl", description="Callback URL", min=0) URL callbackUrl, @DescribeParameter(name="callbackParams", description="Parameters to append to the callback", min=0) String callbackParams, @DescribeParameter(name = "format", min = 0) final String format, ProgressListener progressListener ) throws ProcessException { try { if (goGoDuckConfig.getThreadCount() <= 0) { throw new ProcessException("threadCount set to 0 or below, job will not run"); } File outputFile = getResourceManager().getOutputResource( getResourceManager().getExecutionId(true), layer + ".nc").file(); String filePath = outputFile.toPath().toAbsolutePath().toString(); GoGoDuck ggd = new GoGoDuck(catalog, layer, subset, filePath, format, goGoDuckConfig); ggd.setTmpDir(getWorkingDir()); <START> ggd.setThreadCount(goGoDuckConfig.getThreadCount()); <END> ggd.setProgressListener(progressListener); Path outputPath = ggd.run(); notifySuccess(callbackUrl, callbackParams); return new FileRawData(outputPath.toFile(), ggd.getMimeType(), ggd.getExtension()); } catch (GoGoDuckException e) { logger.error(e.toString(), e); notifyFailure(callbackUrl, callbackParams); throw new ProcessException(e.getMessage()); } }</code><technical_language>passed gogoduckconfig gogoduck need set threadcount separately well.</technical_language>

Target:
public FileRawData execute( @DescribeParameter(name="layer", description="WFS layer to query") String layer, @DescribeParameter(name="subset", description="Subset, semi-colon separated") String subset, @DescribeParameter(name="callbackUrl", description="Callback URL", min=0) URL callbackUrl, @DescribeParameter(name="callbackParams", description="Parameters to append to the callback", min=0) String callbackParams, @DescribeParameter(name = "format", min = 0) final String format, ProgressListener progressListener ) throws ProcessException { try { if (goGoDuckConfig.getThreadCount() <= 0) { throw new ProcessException("threadCount set to 0 or below, job will not run"); } File outputFile = getResourceManager().getOutputResource( getResourceManager().getExecutionId(true), layer + ".nc").file(); String filePath = outputFile.toPath().toAbsolutePath().toString(); GoGoDuck ggd = new GoGoDuck(catalog, layer, subset, filePath, format, goGoDuckConfig); ggd.setTmpDir(getWorkingDir()); ggd.setProgressListener(progressListener); Path outputPath = ggd.run(); notifySuccess(callbackUrl, callbackParams); return new FileRawData(outputPath.toFile(), ggd.getMimeType(), ggd.getExtension()); } catch (GoGoDuckException e) { logger.error(e.toString(), e); notifyFailure(callbackUrl, callbackParams); throw new ProcessException(e.getMessage(), e); } }
Source:
<code>private void upsertAttributes(EntityType entityType, EntityType existingEntityType) { Map<String, Attribute> attrsMap = stream(entityType.getOwnAllAttributes()) .collect(toMap(Attribute::getIdentifier, Function.identity())); Map<String, Attribute> existingAttrsMap = stream(existingEntityType.getOwnAllAttributes()) .collect(toMap(Attribute::getIdentifier, Function.identity())); <START> Set<String> addedAttrNames = Sets.difference(attrsMap.keySet(), existingAttrsMap.keySet()); <END> Set<String> sharedAttrNames = Sets.intersection(attrsMap.keySet(), existingAttrsMap.keySet()); Set<String> deletedAttrNames = Sets.difference(existingAttrsMap.keySet(), attrsMap.keySet()); if (!addedAttrNames.isEmpty()) { dataService.add(ATTRIBUTE_META_DATA, addedAttrNames.stream().map(attrsMap::get)); } List<String> updatedAttrNames = sharedAttrNames.stream() .filter( attrName -> !EntityUtils.equals(attrsMap.get(attrName), existingAttrsMap.get(attrName))) .collect(toList()); if (!updatedAttrNames.isEmpty()) { dataService.update(ATTRIBUTE_META_DATA, updatedAttrNames.stream().map(attrsMap::get)); } if (!deletedAttrNames.isEmpty()) { dataService.delete(ATTRIBUTE_META_DATA, deletedAttrNames.stream().map(existingAttrsMap::get)); } }</code><technical_language>update names of variables maps store names anymore</technical_language>

Target:
private void upsertAttributes(EntityType entityType, EntityType existingEntityType) { Map<String, Attribute> attrsMap = stream(entityType.getOwnAllAttributes()) .collect(toMap(Attribute::getIdentifier, Function.identity())); Map<String, Attribute> existingAttrsMap = stream(existingEntityType.getOwnAllAttributes()) .collect(toMap(Attribute::getIdentifier, Function.identity())); Set<String> addedAttrIds = Sets.difference(attrsMap.keySet(), existingAttrsMap.keySet()); Set<String> sharedAttrIds = Sets.intersection(attrsMap.keySet(), existingAttrsMap.keySet()); Set<String> deletedAttrIds = Sets.difference(existingAttrsMap.keySet(), attrsMap.keySet()); if (!addedAttrIds.isEmpty()) { dataService.add(ATTRIBUTE_META_DATA, addedAttrIds.stream().map(attrsMap::get)); } List<String> updatedAttrIds = sharedAttrIds.stream() .filter( attrName -> !EntityUtils.equals(attrsMap.get(attrName), existingAttrsMap.get(attrName))) .collect(toList()); if (!updatedAttrIds.isEmpty()) { dataService.update(ATTRIBUTE_META_DATA, updatedAttrIds.stream().map(attrsMap::get)); } if (!deletedAttrIds.isEmpty()) { dataService.delete(ATTRIBUTE_META_DATA, deletedAttrIds.stream().map(existingAttrsMap::get)); } }
Source:
<code><START> public boolean equals(Object o) <END> { if (this == o) { return true; } if (!(o instanceof LookupConfig)) { return false; } LookupConfig that = (LookupConfig) o; return getSnapshotWorkingDir().equals(that.getSnapshotWorkingDir()); }</code><technical_language>updated</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof LookupConfig)) { return false; } LookupConfig that = (LookupConfig) o; return snapshotWorkingDir.equals(that.snapshotWorkingDir) && enableLookupSyncOnStartup == that.enableLookupSyncOnStartup && numLookupLoadingThreads == that.numLookupLoadingThreads; }
Source:
<code>public PlanNode visitExchange(ExchangeNode exchange, RewriteContext<FragmentProperties> context) { if (!exchange.getScope().isRemote()) { return context.defaultRewrite(exchange, context.get()); } <START> if (exchange.getScope() == REMOTE) { <END> return createRemoteExchange(exchange, context); } if (exchange.getScope() == REMOTE_MATERIALIZED) { return createRemoteMaterializedExchange(exchange, context); } throw new IllegalArgumentException("Unexpected exchange scope: " + exchange.getScope()); }</code><technical_language>nit: switch here? (Together LOCAL before)</technical_language>

Target:
public PlanNode visitExchange(ExchangeNode exchange, RewriteContext<FragmentProperties> context) { switch (exchange.getScope()) { case LOCAL: return context.defaultRewrite(exchange, context.get()); case REMOTE: return createRemoteExchange(exchange, context); case REMOTE_MATERIALIZED: return createRemoteMaterializedExchange(exchange, context); default: throw new IllegalArgumentException("Unexpected exchange scope: " + exchange.getScope()); } }
Source:
<code>void validateShowStatsWhereExpression(Expression expression, ShowStats node) { check(ALLOWED_SHOW_STATS_WHERE_EXPRESSION_TYPES.stream().anyMatch(clazz -> clazz.isInstance(expression)), node, "Only literals, column references, comparators, is (not) null and logical operators are allowed in WHERE of SHOW STATS SELECT clause"); if (expression instanceof NotExpression) { validateShowStatsWhereExpression(((NotExpression) expression).getValue(), node); } else if (expression instanceof LogicalBinaryExpression) { validateShowStatsWhereExpression(((LogicalBinaryExpression) expression).getLeft(), node); validateShowStatsWhereExpression(((LogicalBinaryExpression) expression).getRight(), node); } else if (expression instanceof ComparisonExpression) { validateShowStatsWhereExpression(((ComparisonExpression) expression).getLeft(), node); <START> validateShowStatsWhereExpression(((ComparisonExpression) expression).getRight(), node); <END> } else if (expression instanceof IsNullPredicate) { validateShowStatsWhereExpression(((IsNullPredicate) expression).getValue(), node); } else if (expression instanceof IsNotNullPredicate) { validateShowStatsWhereExpression(((IsNotNullPredicate) expression).getValue(), node); } }</code><technical_language>renames resultColumnNames -> statsColumnNames, columnNames -> tableColumnNames a separate commit (but i insist)</technical_language>

Target:
private void validateShowStatsWhereExpression(Expression expression, ShowStats node) { check(ALLOWED_SHOW_STATS_WHERE_EXPRESSION_TYPES.stream().anyMatch(clazz -> clazz.isInstance(expression)), node, "Only literals, column references, comparators, is (not) null and logical operators are allowed in WHERE of SHOW STATS SELECT clause"); if (expression instanceof NotExpression) { validateShowStatsWhereExpression(((NotExpression) expression).getValue(), node); } else if (expression instanceof LogicalBinaryExpression) { validateShowStatsWhereExpression(((LogicalBinaryExpression) expression).getLeft(), node); validateShowStatsWhereExpression(((LogicalBinaryExpression) expression).getRight(), node); } else if (expression instanceof ComparisonExpression) { validateShowStatsWhereExpression(((ComparisonExpression) expression).getLeft(), node); validateShowStatsWhereExpression(((ComparisonExpression) expression).getRight(), node); } else if (expression instanceof IsNullPredicate) { validateShowStatsWhereExpression(((IsNullPredicate) expression).getValue(), node); } else if (expression instanceof IsNotNullPredicate) { validateShowStatsWhereExpression(((IsNotNullPredicate) expression).getValue(), node); } }
Source:
<code>public T route(String command) throws CommandRouterException, RouteNotFoundException { T message = null; for (Route pa : routes) { Matcher matcher = pa.regex.matcher(command); boolean matches = matcher.matches(); if (matches) { List<String> parameters = new ArrayList<String>(); <START> <END> for (int index = 0; index <= matcher.groupCount(); index++) { parameters.add(matcher.group(index)); } String[] parametersArray = null; if (parameters.size() > 1) { parameters.remove(0); parametersArray = new String[parameters.size()]; parametersArray = parameters.toArray(parametersArray); } try { message = (T)pa.routerCommand.execute(parametersArray); } catch (Exception ex) { throw new CommandRouterException(ex.getMessage()); } break; } } if (message == null) throw new RouteNotFoundException("No route found for given command", command); return message; }</code><technical_language>logic is a confusing me. I happening, feels a over-complicated/misleading. group(0) returns string matched, matched group. If groups matched need string, need matches 1 up, 0 removing one. If find this acceptable, I is confusing, is more concise. java String[] parametersArray = null; if (matcher.groupCount() == 0) { parametersArray = new String[] { command }; } else { parametersArray = new String[matcher.groupCount()]; for (int i = 1; i <= matcher.groupCount(); i++) { parametersArray[i-1] = matcher.group(i); } } // try..catch etc. pa.routerCommand.execute(parametersArray);</technical_language>

Target:
public T route(String command) throws CommandRouterException, RouteNotFoundException { T message = null; for (Route<T> pa : routes) { Matcher matcher = pa.regex.matcher(command); boolean matches = matcher.matches(); if (matches) { String[] parametersArray = null; if (matcher.groupCount() == 0) { parametersArray = new String[] { command }; } else { parametersArray = new String[matcher.groupCount()]; for (int i = 1; i <= matcher.groupCount(); i++) { parametersArray[i-1] = matcher.group(i); } } try { message = pa.routerCommand.execute(parametersArray); } catch (Exception ex) { throw new CommandRouterException(ex.getMessage()); } if (message == null) throw new RouteNotFoundException("No route found for given command", command); return message; } } return message; }
Source:
<code>public Genomics fromClientSecretsFile(File clientSecretsJson) throws IOException { try (Reader in = new FileReader(clientSecretsJson)) { GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow .Builder( httpTransport, jsonFactory, GoogleClientSecrets.load(jsonFactory, in), scopes) .setDataStoreFactory(dataStoreFactory) .build(); return create( <START> new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize(userName), <END> null); } }</code><technical_language>great preserve boolean flag toggled new GooglePromptReceiver() new LocalServerReceiver() - java-client needs</technical_language>

Target:
public Genomics fromClientSecretsFile(File clientSecretsJson) throws IOException { Reader in = null; boolean returnNormally = true; try { GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow .Builder( httpTransport, jsonFactory, GoogleClientSecrets.load(jsonFactory, in = new FileReader(clientSecretsJson)), scopes) .setDataStoreFactory(dataStoreFactory) .build(); return create( refreshToken( new AuthorizationCodeInstalledApp(flow, verificationCodeReceiver.get()) .authorize(userName)), null); } catch (IOException e) { returnNormally = false; throw e; } finally { if (null != in) { try { in.close(); } catch (IOException e) { if (returnNormally) { throw e; } } } } }
Source:
<code>public void close() { <START> producer.close(Duration.ofSeconds(0)); <END> }</code><technical_language>flush producer here</technical_language>

Target:
public void close() { producer.close(); }
Source:
<code>public VfsFileChooserHelper( Shell shell, VfsFileChooserDialog fileChooserDialog, VariableSpace variableSpace, FileSystemOptions fileSystemOptions ) { this.fileChooserDialog = fileChooserDialog; this.shell = shell; this.variableSpace = variableSpace; this.fileSystemOptions = fileSystemOptions; <START> this.schemeRestrictions = new String[1]; <END> }</code><technical_language>@e-cuellar is reason this is set 1 of line number 133? If so, prefer this String[0], add some safety getSchemeRestriction() check array length (because 0, set setSchemeRestrictions). setSchemeRestriction needs a smarter too. suggest if API call setSchemeRestriction wipe schemeRestriction stuff incoming schemeRestriction</technical_language>

Target:
public VfsFileChooserHelper( Shell shell, VfsFileChooserDialog fileChooserDialog, VariableSpace variableSpace, FileSystemOptions fileSystemOptions ) { this.fileChooserDialog = fileChooserDialog; this.shell = shell; this.variableSpace = variableSpace; this.fileSystemOptions = fileSystemOptions; this.schemeRestrictions = new String[0]; }
Source:
<code>public void run() { <START> fLogger.info(() -> "[build thread start] trace=" + fBuildTrace.getName()); END> buildEntryList(fBuildTrace, fParentTrace, fMonitor); synchronized (fBuildThreadMap) { fBuildThreadMap.remove(fBuildTrace); } fLogger.info(() -> "[build thread end]"); }</code><technical_language>more thing, if consider part event name (that eventual UST-JUL-TC parser eventually interpret event name (and fields, separated '=' assigned a fieldname+value)) a consistent naming pattern. UST events names_with_underscores, C-ish. in Java, CapitalziedCamelCase for event names</technical_language>

Target:
public void run() { fLogger.info(() -> "[BuildThreadStart] trace=" + fBuildTrace.getName()); buildEntryList(fBuildTrace, fParentTrace, fMonitor); synchronized (fBuildThreadMap) { fBuildThreadMap.remove(fBuildTrace); } fLogger.info(() -> "[BuildThreadEnd]"); }
Source:
<code>protected CreateVDSCommandParameters buildCreateVmParameters() { CreateVDSCommandParameters parameters = new CreateVDSCommandParameters(getVdsId(), getVm()); parameters.setRunInUnknownStatus(getParameters().isRunInUnknownStatus()); parameters.setVmPayload(vmPayload); if (shouldRestoreMemory()) { <START> if (FeatureSupported.isMemoryDisksOnDifferentDomainsSupported(getVm().getCompatibilityVersion())) { <END> parameters.setMemoryDumpImage((DiskImage) diskDao.get(getActiveSnapshot().getMemoryDiskId())); parameters.setMemoryConfImage((DiskImage) diskDao.get(getActiveSnapshot().getMetadataDiskId())); } else { parameters.setHibernationVolHandle(getActiveSnapshot().getMemoryVolume()); } parameters.setDownSince(getVm().getStatus() == VMStatus.Suspended ? getVm().getLastStopTime() : getActiveSnapshot().getCreationDate()); } parameters.setPassthroughVnicToVfMap(flushPassthroughVnicToVfMap()); if (initializationType == InitializationType.Sysprep && osRepository.isWindows(getVm().getVmOsId()) && (getVm().getFloppyPath() == null || "".equals(getVm().getFloppyPath()))) { parameters.setInitializationType(InitializationType.Sysprep); } if (initializationType == InitializationType.CloudInit && !osRepository.isWindows(getVm().getVmOsId())) { parameters.setInitializationType(InitializationType.CloudInit); } return parameters; }</code><technical_language>part concerned - question is safer replace with: if (FeatureSupported.isMemoryDisksOnDifferentDomainsSupported.. && getActiveSnapshot().getMemoryDiskId() != null)</technical_language>

Target:
protected CreateVDSCommandParameters buildCreateVmParameters() { CreateVDSCommandParameters parameters = new CreateVDSCommandParameters(getVdsId(), getVm()); parameters.setRunInUnknownStatus(getParameters().isRunInUnknownStatus()); parameters.setVmPayload(vmPayload); if (shouldRestoreMemory()) { if (FeatureSupported.isMemoryDisksOnDifferentDomainsSupported(getVm().getCompatibilityVersion()) && getActiveSnapshot().getMemoryDiskId() != null) { parameters.setMemoryDumpImage((DiskImage) diskDao.get(getActiveSnapshot().getMemoryDiskId())); parameters.setMemoryConfImage((DiskImage) diskDao.get(getActiveSnapshot().getMetadataDiskId())); } else { parameters.setHibernationVolHandle(getActiveSnapshot().getMemoryVolume()); } parameters.setDownSince(getVm().getStatus() == VMStatus.Suspended ? getVm().getLastStopTime() : getActiveSnapshot().getCreationDate()); } parameters.setPassthroughVnicToVfMap(flushPassthroughVnicToVfMap()); if (initializationType == InitializationType.Sysprep && osRepository.isWindows(getVm().getVmOsId()) && (getVm().getFloppyPath() == null || "".equals(getVm().getFloppyPath()))) { parameters.setInitializationType(InitializationType.Sysprep); } if (initializationType == InitializationType.CloudInit && !osRepository.isWindows(getVm().getVmOsId())) { parameters.setInitializationType(InitializationType.CloudInit); } return parameters; }
Source:
<code>public void run() throws Exception { while (true) { <START> if (m_sessionProvider.isClosing()) { <END> return; } Message message = m_consumer.receive(); if (message == null) { return; } LOG.debug("Receiving JMS message [message={}]", message); try { onJmsMessage(message); } catch (Exception e) { BEANS.get(MomExceptionHandler.class).handle(e); } } }</code><technical_language>Do check this well? if (IFuture.CURRENT.get().isCancelled()) { return; }</technical_language>

Target:
public void run() throws Exception { while (true) { if (m_sessionProvider.isClosing() || IFuture.CURRENT.get().isCancelled()) { LOG.debug("JMS MessageConsumer for was closed", m_destination); break; } Message message = m_consumer.receive(); if (message == null) { break; } LOG.debug("Receiving JMS message [message={}]", message); try { onJmsMessage(message); } catch (Exception e) { BEANS.get(MomExceptionHandler.class).handle(e); } } LOG.debug("JMS MessageConsumer for was closed", m_destination); }
Source:
<code>public FEELFnResult<Boolean> invoke(@ParameterName( "number" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "number", "cannot be null" ) ); } if ( number.remainder( BigDecimal.ONE ).signum() != 0 ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "number", "cannot have non-zero fractional part" ) ); } <START> return FEELFnResult.ofResult( !BigInteger.ZERO.equals( number.toBigInteger().remainder(TWO) ) ); <END> }</code><technical_language>I 100% conversion BigInteger is needed here</technical_language>

Target:
public FEELFnResult<Boolean> invoke(@ParameterName( "number" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "number", "cannot be null" ) ); } if ( number.remainder( BigDecimal.ONE ).signum() != 0 ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "number", "cannot have non-zero fractional part" ) ); } return FEELFnResult.ofResult( BigDecimal.ZERO.compareTo( number.remainder(TWO) ) != 0); }
Source:
<code>public boolean isInstanceOfScoped(EObject object, EClass clazz) { if (!isInstanceOfUnscoped(object, clazz)) { return false; } <START> Object typeKey = toKey(clazz); <END> final Set<EObject> instances = instanceStore.getInstanceSet(typeKey); return instances != null && instances.contains(object); }</code><technical_language>This is incorrect. type key toKey(object.eClass()) i.e. actual direct class of instance object, indexed instances stored in index single direct type, index of supertypes</technical_language>

Target:
public boolean isInstanceOfScoped(EObject object, EClass clazz) { Object typeKey = toKey(object.eClass()); if (!doCalculateInstanceOf(typeKey, clazz)) { return false; } final Set<EObject> instances = instanceStore.getInstanceSet(typeKey); return instances != null && instances.contains(object); }
Source:
<code>public static String formatMessages(final List<DMNMessage> messages) { <START> return messages.stream().map(Object::toString).collect( Collectors.joining( "\n" ) ); <END> }</code><technical_language>If user-facing messages, this turned platform-specific newlines</technical_language>

Target:
public static String formatMessages(final List<DMNMessage> messages) { return messages.stream().map(Object::toString).collect( Collectors.joining( System.lineSeparator() ) ); }
Source:
<code>public String getDisplayName() { <START> return "Upstream Committer"; <END> }</code><technical_language>this "Upstream Committers"? Also, good move this a Messages.properties file translated</technical_language>

Target:
public String getDisplayName() { return Messages.UpstreamComitterRecipientProvider_DisplayName(); }
Source:
<code>public CompilationUnit parse(InputFile file) { try { if (file.getUnitName().endsWith(".java")) { String source = options.fileUtil().readFile(file); return parse(null, file.getUnitName(), source); } else { assert options.translateClassfiles(); JavacEnvironment parserEnv = <START> createEnvironment(Collections.emptyList(), Collections.emptyList(), false, null); <END> return ClassFileConverter.convertClassFile(options, parserEnv, file); } } catch (IOException e) { ErrorUtil.error(e.getMessage()); return null; } }</code><technical_language>need, below</technical_language>

Target:
public CompilationUnit parse(InputFile file) { try { if (file.getUnitName().endsWith(".java")) { String source = options.fileUtil().readFile(file); return parse(null, file.getUnitName(), source); } else { assert options.translateClassfiles(); JavacEnvironment parserEnv = createEnvironment(Collections.emptyList(), Collections.emptyList(), false); return ClassFileConverter.convertClassFile(options, parserEnv, file); } } catch (IOException e) { ErrorUtil.error(e.getMessage()); return null; } }
Source:
<code>public void executeQueryCommandWithWatchdog() { final Guid vmId = new Guid("ee655a4d-effc-4aab-be2b-2f80ff40cd1c"); VmDeviceDAO vmDeviceDaoMock = Mockito.mock(VmDeviceDAO.class); HashMap<String, Object> watchdogSpecParams = new HashMap<String, Object>(); watchdogSpecParams.put("model", "i3600esb"); watchdogSpecParams.put("action", "reset"); VmDevice vmDevice = new VmDevice(new VmDeviceId(new Guid("6f86b8a4-e721-4149-b2df-056eb621b16a"), vmId), VmDeviceType.WATCHDOG.getName(), "watchdog", "", 1, watchdogSpecParams, true, true, true, ""); Mockito.when(vmDeviceDaoMock.getVmDeviceByVmIdAndType(vmId, VmDeviceType.WATCHDOG.getName())) .thenReturn(Arrays.asList(vmDevice)); GetWatchdogQuery<IdQueryParameters> query = new GetWatchdogQuery<IdQueryParameters>(new IdQueryParameters(vmId)); query = Mockito.spy(query); Mockito.when(query.getVmDeviceDAO()).thenReturn(vmDeviceDaoMock); IdQueryParameters params = new IdQueryParameters(vmId); Mockito.when(query.getParameters()) .thenReturn(params); Mockito.doCallRealMethod().when(query).executeQueryCommand(); Mockito.doCallRealMethod().when(query).getReturnValue(); Mockito.doCallRealMethod().when(query).setReturnValue(Mockito.any(Object.class)); query.executeQueryCommand(); Assert.assertNotNull(query.getReturnValue()); Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getAction()).name().toLowerCase(), "reset"); <START> Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getModel()).name().toLowerCase(), "i6300esb"); <END> }</code><technical_language>fixed in line 45, for ping-pong..</technical_language>

Target:
public void executeQueryCommandWithWatchdog() { final Guid vmId = new Guid("ee655a4d-effc-4aab-be2b-2f80ff40cd1c"); VmDeviceDAO vmDeviceDaoMock = Mockito.mock(VmDeviceDAO.class); HashMap<String, Object> watchdogSpecParams = new HashMap<String, Object>(); watchdogSpecParams.put("model", "i6300esb"); watchdogSpecParams.put("action", "reset"); VmDevice vmDevice = new VmDevice(new VmDeviceId(new Guid("6f86b8a4-e721-4149-b2df-056eb621b16a"), vmId), VmDeviceType.WATCHDOG.getName(), "watchdog", "", 1, watchdogSpecParams, true, true, true, ""); Mockito.when(vmDeviceDaoMock.getVmDeviceByVmIdAndType(vmId, VmDeviceType.WATCHDOG.getName())) .thenReturn(Arrays.asList(vmDevice)); GetWatchdogQuery<IdQueryParameters> query = new GetWatchdogQuery<IdQueryParameters>(new IdQueryParameters(vmId)); query = Mockito.spy(query); Mockito.when(query.getVmDeviceDAO()).thenReturn(vmDeviceDaoMock); IdQueryParameters params = new IdQueryParameters(vmId); Mockito.when(query.getParameters()) .thenReturn(params); Mockito.doCallRealMethod().when(query).executeQueryCommand(); Mockito.doCallRealMethod().when(query).getReturnValue(); Mockito.doCallRealMethod().when(query).setReturnValue(Mockito.any(Object.class)); query.executeQueryCommand(); Assert.assertNotNull(query.getReturnValue()); Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getAction()).name().toLowerCase(), "reset"); Assert.assertEquals((((VmWatchdog)query.getReturnValue()).getModel()).name().toLowerCase(), "i6300esb"); }
Source:
<code>public void testInitializeTwiceFails() throws AlreadyInitializedException, TableExistsException { FluoAdmin fluoAdmin = new FluoAdminImpl(config); InitOpts opts = new InitOpts(); opts.setClearZookeeper(true); opts.setClearTable(true); fluoAdmin.initialize(opts); fluoAdmin.initialize(opts); opts.setClearZookeeper(false); opts.setClearTable(false); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (AlreadyInitializedException e) { } opts.setClearZookeeper(true); <START> opts.setClearTable(false); <END> try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (TableExistsException e) { } assertTrue(conn.tableOperations().exists(config.getAccumuloTable())); }</code><technical_language>case clearTable = true clearZK = false</technical_language>

Target:
public void testInitializeTwiceFails() throws AlreadyInitializedException, TableExistsException { FluoAdmin fluoAdmin = new FluoAdminImpl(config); InitOpts opts = new InitOpts().setClearZookeeper(true).setClearTable(true); fluoAdmin.initialize(opts); fluoAdmin.initialize(opts); opts.setClearZookeeper(false).setClearTable(false); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (AlreadyInitializedException e) { } opts.setClearZookeeper(false).setClearTable(true); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (AlreadyInitializedException e) { } opts.setClearZookeeper(true).setClearTable(false); try { fluoAdmin.initialize(opts); fail("This should have failed"); } catch (TableExistsException e) { } assertTrue(conn.tableOperations().exists(config.getAccumuloTable())); }
Source:
<code>private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; } else { updateJobs = fUpdateJobsPartial; } <START> setPieChartsVisible(true); <END> for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { aTrace = checkNotNull(aTrace); if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(aTrace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new StatisticsUpdateJob("Statistics update", aTrace, isGlobal, timeRange, statsMod, this); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }</code><technical_language>remove setting true here. refreshPieCharts() care of showing it. for traces 1 event type piechart is shown quickly hidden</technical_language>

Target:
private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; } else { updateJobs = fUpdateJobsPartial; } for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { aTrace = checkNotNull(aTrace); if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(aTrace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new StatisticsUpdateJob("Statistics update", aTrace, isGlobal, timeRange, statsMod, this); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }
Source:
<code>public void commit(final Xid xid, final boolean onePhase) throws XAException { <START> if (commitToEnlistment()) lookup(xid).commit(onePhase); <END> if (onePhase && resourceRegistry != null) resourceRegistry.removeResource(this); }</code><technical_language>determine safe remove entries prepare? TM log resource this point</technical_language>

Target:
public void commit(final Xid xid, final boolean onePhase) throws XAException { try { if (commitToEnlistment()) lookup(xid).commit(onePhase); } catch (XAException | RuntimeException exception) { if (onePhase && resourceRegistry != null) resourceRegistry.resourceInDoubt(this); throw exception; } if (onePhase && resourceRegistry != null) resourceRegistry.removeResource(this); }
Source:
<code><START> public int refreshIndex(String indexName) throws IOException { <END> String url = String.format("%s/%s/_refresh", baseUrl, indexName); HttpGet httpGet = new HttpGet(url); CloseableHttpResponse response = null; try { response = closeableHttpClient.execute(httpGet); } catch (IOException e) { logger.error("Refresh for index failed with status code: and exception message: {}", indexName, response.getStatusLine().getStatusCode(), e.getMessage()); } finally { response.close(); } return response.getStatusLine().getStatusCode(); }</code><technical_language>Yay, this worked for I assume</technical_language>

Target:
public int refreshIndex(String indexName) throws IOException { String url = String.format("http://%s/%s/_refresh", baseUrlArray[0], indexName); HttpGet httpGet = new HttpGet(url); CloseableHttpResponse response = null; try { response = closeableHttpClient.execute(httpGet); } catch (IOException e) { logger.error("Refresh for index failed with status code: and exception message: {}", indexName, response.getStatusLine().getStatusCode(), e.getMessage()); } finally { response.close(); } return response.getStatusLine().getStatusCode(); }
Source:
<code>public float getProgress() throws IOException, InterruptedException { if (recordReadersCount < 1) { return 1.0f; } long cur = currentRecordReader == null ? 0L : (long)(currentRecordReader.getProgress() * splitLengths[currentRecordReaderIndex]); <START> return 1.0f * (cur + cumulativeSplitLengths[currentRecordReaderIndex]) / totalSplitLengths; <END> }</code><technical_language>totalSplitLengths 0</technical_language>

Target:
public float getProgress() throws IOException, InterruptedException { if (recordReadersCount < 1) { return 1f; } if (totalSplitLengths == 0) { return 0f; } long cur = currentRecordReader == null ? 0L : (long)(currentRecordReader.getProgress() * splitLengths[currentRecordReaderIndex]); return 1.0f * (cur + cumulativeSplitLengths[currentRecordReaderIndex]) / totalSplitLengths; }
Source:
<code>public ResourceGroupInfo getSummaryInfo() { synchronized (root) { return new ResourceGroupInfo( id, getState(), schedulingPolicy, schedulingWeight, DataSize.succinctBytes(softMemoryLimitBytes), softConcurrencyLimit, hardConcurrencyLimit, maxQueuedQueries, runningTimeLimit, queuedTimeLimit, DataSize.succinctBytes(cachedMemoryUsageBytes), getQueuedQueries(), getRunningQueries(), eligibleSubGroups.size(), subGroups.values().stream() <START> .filter(group -> group.getRunningQueries() + group.getQueuedQueries() > 0) <END> .map(InternalResourceGroup::getChildInfo) .collect(toImmutableList()), null); } }</code><technical_language>I missing of filter exploded data, calling getSummaryInfo for child groups. next line actual fix</technical_language>

Target:
private ResourceGroupInfo getSummaryInfo() { synchronized (root) { return new ResourceGroupInfo( id, getState(), schedulingPolicy, schedulingWeight, DataSize.succinctBytes(softMemoryLimitBytes), softConcurrencyLimit, hardConcurrencyLimit, maxQueuedQueries, runningTimeLimit, queuedTimeLimit, DataSize.succinctBytes(cachedMemoryUsageBytes), getQueuedQueries(), getRunningQueries(), eligibleSubGroups.size(), null, null); } }
Source:
<code>public void readFields(DataInput in) throws IOException { Class<? extends org.apache.hadoop.mapreduce.InputSplit> clazz = null; String name = null; try { name = Text.readString(in); clazz = (Class<? extends org.apache.hadoop.mapreduce.InputSplit>) conf.getClassByName(name); } catch (ClassNotFoundException e) { throw new IOException("Could not find class for deserialized class name: " + name, e); } org.apache.hadoop.mapreduce.InputSplit split = ReflectionUtils.newInstance(clazz, conf); SerializationFactory factory = new SerializationFactory(conf); Deserializer deserializer = factory.getDeserializer(clazz); deserializer.open((DataInputStream) in); realSplit = (org.apache.hadoop.mapreduce.InputSplit) deserializer.deserialize(split); <START> deserializer.close(); <END> }</code><technical_language>this in a finally clause ? important is close()</technical_language>

Target:
public void readFields(DataInput in) throws IOException { realSplit = SplitUtil.deserializeInputSplit(conf, (DataInputStream) in); }
Source:
<code>private SimulatedTripStats computeSimulatedTripStats() { Mean meanInVehicleBeelineSpeed = new Mean(); Mean meanWaitTime = new Mean(); for (var sequence : drtRequestAnalyzer.getPerformedRequestSequences().values()) { if (!sequence.isCompleted()) { continue; } DrtRequestSubmittedEvent submittedEvent = sequence.getSubmitted(); Link depLink = network.getLinks().get(submittedEvent.getFromLinkId()); Link arrLink = network.getLinks().get(submittedEvent.getToLinkId()); double beelineDistance = DistanceUtils.calculateDistance(depLink, arrLink); double pickupTime = sequence.getPickedUp().get().getTime(); double waitTime = pickupTime - sequence.getSubmitted().getTime(); double rideTime = sequence.getDroppedOff().get().getTime() - pickupTime; <START> <END> Preconditions.checkState(rideTime > 0); Preconditions.checkState(beelineDistance > 0); meanInVehicleBeelineSpeed.increment(beelineDistance / rideTime); meanWaitTime.increment(waitTime); } int count = (int)meanWaitTime.getN(); return new SimulatedTripStats(count, count == 0 ? drtSpeedUpParams.getInitialInVehicleBeelineSpeed() : meanInVehicleBeelineSpeed.getResult(), count == 0 ? drtSpeedUpParams.getInitialWaitingTime() : meanWaitTime.getResult()); }</code><technical_language>IMHO need checks _here_. I rideTime==0 sense. beelineDstance==0 happen in rare cases method link.getCoord() some time middle fromNode toNode. middle point for links probabaly a useful drt ride anyway, necessarily wrong either</technical_language>

Target:
private SimulatedTripStats computeSimulatedTripStats() { Mean meanInVehicleBeelineSpeed = new Mean(); Mean meanWaitTime = new Mean(); for (var sequence : drtRequestAnalyzer.getPerformedRequestSequences().values()) { if (!sequence.isCompleted()) { continue; } DrtRequestSubmittedEvent submittedEvent = sequence.getSubmitted(); Link depLink = network.getLinks().get(submittedEvent.getFromLinkId()); Link arrLink = network.getLinks().get(submittedEvent.getToLinkId()); double beelineDistance = DistanceUtils.calculateDistance(depLink, arrLink); double pickupTime = sequence.getPickedUp().get().getTime(); double waitTime = pickupTime - sequence.getSubmitted().getTime(); double rideTime = sequence.getDroppedOff().get().getTime() - pickupTime; meanInVehicleBeelineSpeed.increment(beelineDistance / rideTime); meanWaitTime.increment(waitTime); } int count = (int)meanWaitTime.getN(); return new SimulatedTripStats(count, count == 0 ? drtSpeedUpParams.getInitialInVehicleBeelineSpeed() : meanInVehicleBeelineSpeed.getResult(), count == 0 ? drtSpeedUpParams.getInitialWaitingTime() : meanWaitTime.getResult()); }
Source:
<code>public Iterator<Replica> iterator() { return new Iterator<Replica>() { final int end = begin + size; int i = begin; <START> @Override <END> public boolean hasNext() { return i < end; } @Override public Replica next() { return contents[i++]; } }; }</code><technical_language>Iterators#fromArray</technical_language>

Target:
public Iterator<Replica> iterator() { return new Iterator<Replica>() { final int end = begin + size; int i = begin; @Override public boolean hasNext() { return i < end; } @Override public Replica next() { if (!hasNext()) throw new IllegalStateException(); return contents[i++]; } }; }
Source:
<code>private void closeDrawer(Side side) { <START> if (side==Side.RIGHT||side==Side.BOTH) { <END> rightDrawer.closeDrawers(); } if (leftDrawer!=null&&(side==Side.LEFT||side==Side.BOTH)) { leftDrawer.closeDrawers(); } openDrawer = Side.NONE; }</code><technical_language>left drawer closer a null check right below, right side need that</technical_language>

Target:
private void closeDrawer(Side side) { if (side==Side.RIGHT||side==Side.BOTH) { rightDrawer.closeDrawers(); } if (leftDrawer!=null&&(side==Side.LEFT||side==Side.BOTH)) { leftDrawer.closeDrawers(); } }
Source:
<code><START> public void testShouldRemoveNoCache() throws Exception { <END> lists1.add(LIST_ID1); lists2.add(LIST_ID3); lists3.add(LIST_ID3); final Set<Geocache> toBeRemoved = RemoveNotUniqueHelper.removeNonUniqueCaches(geoCaches); assertThat(toBeRemoved.size()).isEqualTo(0); assertThat(toBeRemoved.contains(gc1)).isFalse(); assertThat(toBeRemoved.contains(gc2)).isFalse(); assertThat(toBeRemoved.contains(gc3)).isFalse(); }</code><technical_language>Please add empty line methods</technical_language>

Target:
public void testShouldRemoveNoCache() { lists1.add(LIST_ID1); lists2.add(LIST_ID3); lists3.add(LIST_ID3); final Set<Geocache> toBeRemoved = RemoveNotUniqueHelper.removeNonUniqueCaches(geoCaches); assertThat(toBeRemoved.size()).isEqualTo(0); assertThat(toBeRemoved.contains(gc1)).isFalse(); assertThat(toBeRemoved.contains(gc2)).isFalse(); assertThat(toBeRemoved.contains(gc3)).isFalse(); }
Source:
<code>public LogReplicationMetadata.ReplicationStatusVal queryReplicationStatus() { return corfuReplicationDiscoveryService.queryReplicationStatus( <START> topologyConfig.getClusters(0).getId()); <END> }</code><technical_language>guaranteed place local cluster in 0th index position right? I mistaken</technical_language>

Target:
public Map<String, LogReplicationMetadata.ReplicationStatusVal> queryReplicationStatus() { return corfuReplicationDiscoveryService.queryReplicationStatus(); }
Source:
<code>protected void configure() { <START> addExposedPorts(DEFAULT_AMQP_PORT, DEFAULT_AMQPS_PORT, DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT); <END> if (adminPassword != null) { addEnv("RABBITMQ_DEFAULT_PASS", adminPassword); } }</code><technical_language>please move constructor? configure is for dynamic admin password, else configured in constructor, overridden externally extending class</technical_language>

Target:
protected void configure() { if (adminPassword != null) { addEnv("RABBITMQ_DEFAULT_PASS", adminPassword); } }
Source:
<code>private <T> QueryRunner<T> makeRunner() { return new QueryRunner<T>() { @Override public Sequence<T> run(Query<T> query) { try { Server instance = brokerSelector.pick(); if (instance == null) { return Sequences.empty(); } final String url = String.format( "http://%s/druid/v2/", brokerSelector.pick().getHost() ); StatusResponseHolder response = httpClient.post(new URL(url)) .setContent( "application/json", jsonMapper.writeValueAsBytes(query) ) .go(responseHandler) .get(); List<T> results = jsonMapper.readValue( response.getContent(), new TypeReference<List<T>>() { } ); return Sequences.simple(results); } <START> catch (Exception e) { <END> return Sequences.empty(); } } }; }</code><technical_language>log this exception</technical_language>

Target:
private <T> QueryRunner<T> makeRunner() { return new QueryRunner<T>() { @Override public Sequence<T> run(Query<T> query) { try { Server instance = brokerSelector.pick(); if (instance == null) { return Sequences.empty(); } final String url = String.format( "http://%s/druid/v2/", brokerSelector.pick().getHost() ); StatusResponseHolder response = httpClient.post(new URL(url)) .setContent( "application/json", jsonMapper.writeValueAsBytes(query) ) .go(responseHandler) .get(); List<T> results = jsonMapper.readValue( response.getContent(), new TypeReference<List<T>>() { } ); return Sequences.simple(results); } catch (Exception e) { log.error(e, "Exception with bridge query"); return Sequences.empty(); } } }; }
Source:
<code>static List<String> getUniqueMetrics(List<TimelineObjectHolder<String, DataSegment>> timelineSegments) { final BiMap<String, Integer> uniqueMetrics = HashBiMap.create(); int index = 0; for (TimelineObjectHolder<String, DataSegment> timelineHolder : Lists.reverse(timelineSegments)) { for (PartitionChunk<DataSegment> chunk : timelineHolder.getObject()) { for (String metric : chunk.getObject().getMetrics()) { <START> uniqueMetrics.putIfAbsent(metric, index++); <END> } } } final BiMap<Integer, String> orderedMetrics = uniqueMetrics.inverse(); return IntStream.range(0, orderedMetrics.size()) .mapToObj(orderedMetrics::get) .collect(Collectors.toList()); }</code><technical_language>This putIfAbsent, side effects</technical_language>

Target:
static List<String> getUniqueMetrics(List<TimelineObjectHolder<String, DataSegment>> timelineSegments) { final BiMap<String, Integer> uniqueMetrics = HashBiMap.create(); int[] index = {0}; for (TimelineObjectHolder<String, DataSegment> timelineHolder : Lists.reverse(timelineSegments)) { for (PartitionChunk<DataSegment> chunk : timelineHolder.getObject()) { for (String metric : chunk.getObject().getMetrics()) { uniqueMetrics.computeIfAbsent(metric, k -> { return index[0]++; } ); } } } final BiMap<Integer, String> orderedMetrics = uniqueMetrics.inverse(); return IntStream.range(0, orderedMetrics.size()) .mapToObj(orderedMetrics::get) .collect(Collectors.toList()); }
Source:
<code>protected boolean inProject(@NonNull String className) { Stacktrace stacktrace = new Stacktrace(new StackTraceElement[]{}, projectPackages); <START> return stacktrace.inProject(className); <END> }</code><technical_language>This unnecessary of a class. fudge empty stacktrace for constructor in order instance method, method operate stacktrace all. this change Stacktrace.java? (forgive bad java, fingers crossed call a static instance method name) java class Stacktrace { public static boolean inProject (String className, String[] projectPackages) { for (String packageName : projectPackages) { if (packageName != null && className.startsWith(packageName)) { return true; } } return false; } boolean inProject(String className) { return Stacktrace.inProject(className, projectPackages); } } enable implementation of configuration.inProject() be: java protected boolean inProject(@NonNull String className) { return Stacktrace.inProject(className, projectPackages; }</technical_language>

Target:
protected boolean inProject(@NonNull String className) { return Stacktrace.inProject(className, projectPackages); }
Source:
<code>public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mAdapter = new LeadAnouncementAdapter(getActivity()); setListAdapter(mAdapter); mAdapter.add(LeadMessage.newMessage(getString(R.string.leads_welcome_title), getString(R.string.leads_welcome))); mAdapter.add(LeadMessage.newResource(getString(R.string.leads_resources_title), getString(R.string.leads_resources), <START> "<LINK_0>")); <END> mAdapter.add(LeadMessage.newResource(getString(R.string.leads_wisdom_title), getString(R.string.leads_wisdom), "<LINK_1>")); }</code><technical_language>This URL is defined in Const.java file. I this defined in Const.java</technical_language>

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mAdapter = new LeadAnnouncementsAdapter(getActivity()); setListAdapter(mAdapter); mAdapter.add(LeadMessage.newMessage(getString(R.string.leads_welcome_title), getString(R.string.leads_welcome))); mAdapter.add(LeadMessage.newResource(getString(R.string.leads_resources_title), getString(R.string.leads_resources), Const.URL_GDG_RESOURCE_FOLDER)); mAdapter.add(LeadMessage.newResource(getString(R.string.leads_wisdom_title), getString(R.string.leads_wisdom), Const.URL_GDG_WISDOM_BOOK)); }