auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void setActive(boolean isActive) { CallbackToFutureAdapter.Completer<Void> completerToSetException = null; boolean <START> toResetDefault = <END> false; synchronized (mActiveLock) { mIsActive = isActive; if (!mIsActive) { synchronized (mCompleterLock) { if (mPendingZoomRatioCompleter != null) { completerToSetException = mPendingZoomRatioCompleter; mPendingZoomRatioCompleter = null; } } toResetDefault = true; } } if (toResetDefault) { setLiveDataValue(mZoomRatioLiveData, DEFAULT_ZOOM_RATIO); setLiveDataValue(mMaxZoomRatioLiveData, getMaxDigitalZoom()); setLiveDataValue(mMinZoomRatioLiveData, MIN_ZOOM); setLiveDataValue(mZoomPercentageLiveData, 0f); } if (completerToSetException != null) { completerToSetException .setException(new OperationCanceledException("Camera is not active.")); } }</code><technical_language>naming rule, name start "is"</technical_language>

Target:
void setActive(boolean isActive) { CallbackToFutureAdapter.Completer<Void> completerToSetException = null; boolean shouldResetDefault = false; synchronized (mActiveLock) { mIsActive = isActive; if (!mIsActive) { synchronized (mCompleterLock) { if (mPendingZoomRatioCompleter != null) { completerToSetException = mPendingZoomRatioCompleter; mPendingZoomRatioCompleter = null; } } shouldResetDefault = true; } } if (shouldResetDefault) { setLiveDataValue(mZoomRatioLiveData, DEFAULT_ZOOM_RATIO); setLiveDataValue(mMaxZoomRatioLiveData, getMaxDigitalZoom()); setLiveDataValue(mMinZoomRatioLiveData, MIN_ZOOM); setLiveDataValue(mZoomPercentageLiveData, 0f); } if (completerToSetException != null) { completerToSetException .setException(new OperationCanceledException("Camera is not active.")); } }
Source:
<code>public void channelActive(ChannelHandlerContext ctx) throws Exception { if (handshakeTimeout > 0) { timeoutFuture = scheduledThreadPool.schedule(new Runnable() { <START> @Override <END> public void run() { ActiveMQClientLogger.LOGGER.readTimeout(); ctx.channel().close(); } }, handshakeTimeout, TimeUnit.SECONDS); } }</code><technical_language>This a bit more readable a lambda. a thought</technical_language>

Target:
public void channelActive(ChannelHandlerContext ctx) throws Exception { if (handshakeTimeout > 0) { timeoutFuture = scheduledThreadPool.schedule( () -> { ActiveMQServerLogger.LOGGER.handshakeTimeout(handshakeTimeout); ctx.channel().close(); }, handshakeTimeout, TimeUnit.SECONDS); } }
Source:
<code>private RoutingType getRoutingType(Symbol[] symbols, SimpleString address) { if (symbols != null) { for (Symbol symbol : symbols) { if (AmqpSupport.TEMP_TOPIC_CAPABILITY.equals(symbol) || AmqpSupport.TOPIC_CAPABILITY.equals(symbol)) { return RoutingType.MULTICAST; } else if (AmqpSupport.TEMP_QUEUE_CAPABILITY.equals(symbol) || AmqpSupport.QUEUE_CAPABILITY.equals(symbol)) { return RoutingType.ANYCAST; } } } final AddressInfo addressInfo = sessionSPI.getAddress(address); if (addressInfo != null && !addressInfo.getRoutingTypes().isEmpty()) { if (addressInfo.getRoutingTypes().size() == 1) { return addressInfo.getRoutingType(); } final RoutingType defaultRoutingType = sessionSPI.getDefaultRoutingType(address); if (defaultRoutingType != null && addressInfo.getRoutingTypes().contains(defaultRoutingType)) { return defaultRoutingType; } <START> return addressInfo.getRoutingType(); <END> } return sessionSPI.getDefaultRoutingType(address); }</code><technical_language>This work auto-create enabled. Also, default routing type null. is a default for configuration setting. ActiveMQDefaultConfiguration.getDefaultRoutingType() = MULTICAST. remove this line return default</technical_language>

Target:
private RoutingType getRoutingType(Symbol[] symbols, SimpleString address) { if (symbols != null) { for (Symbol symbol : symbols) { if (AmqpSupport.TEMP_TOPIC_CAPABILITY.equals(symbol) || AmqpSupport.TOPIC_CAPABILITY.equals(symbol)) { return RoutingType.MULTICAST; } else if (AmqpSupport.TEMP_QUEUE_CAPABILITY.equals(symbol) || AmqpSupport.QUEUE_CAPABILITY.equals(symbol)) { return RoutingType.ANYCAST; } } } final AddressInfo addressInfo = sessionSPI.getAddress(address); if (addressInfo != null && !addressInfo.getRoutingTypes().isEmpty()) { if (addressInfo.getRoutingTypes().size() == 1) { return addressInfo.getRoutingType(); } } RoutingType defaultRoutingType = sessionSPI.getDefaultRoutingType(address); defaultRoutingType = defaultRoutingType == null ? ActiveMQDefaultConfiguration.getDefaultRoutingType() : defaultRoutingType; return defaultRoutingType; }
Source:
<code>private List<String> getReconnectServerList() { if (options.isNoRandomize()) { return getServersList(); } List<String> servers = new ArrayList<>(); addDiscoveredServers(servers); <START> shuffleWithoutCurrent(servers); <END> List<String> configured = new ArrayList<>(); addConfiguredServers(configured); shuffleWithoutCurrent(configured); servers.addAll(configured); if (currentServer != null) { servers.add(currentServer); } return servers; }</code><technical_language>shuffle called adding discovered configured</technical_language>

Target:
private List<String> getReconnectServerList() { return options.isNoRandomize() ? getServersList() : shuffle(getServersList()); }
Source:
<code><START> public void popUpForEdit(SessionDataDto currentSession, SessionComparisonPanel.TreeItem item, List<TagDto> allTags) { <END> getApplyButton().removeFromParent(); this.currentSession=currentSession; setText("Session " +currentSession.getSessionId()); setGrids(allTags, currentSession.getTags()); currentTreeItem = item; show(); }</code><technical_language>defineCurrentSession in fail case return currentSession = null propose check in popUp functions currentSession is null report error is null</technical_language>

Target:
public void popUpForEdit(SessionDataDto currentSession, SessionComparisonPanel.TreeItem item, List<TagDto> allTags) { if (currentSession == null) { new ExceptionPanel("The session data has a value null. The session's id is wrong."); } getApplyButton().removeFromParent(); this.currentSession = currentSession; setText("Session " + currentSession.getSessionId()); setGrids(allTags, currentSession.getTags()); currentTreeItem = item; show(); }
Source:
<code>protected void ExecuteVdsBrokerCommand() { <START> GlusterVolumeAdvancedDetails volumeAdvancedDetails = new GlusterVolumeAdvancedDetails(); <END> executeVolumeStatusInfo(""); volumeAdvancedDetails = result.getVolumeAdvancedDetails(); if (getParameters().detailsRequired()) { if (getSucceeded()) { executeVolumeStatusInfo(GlusterVolumeStatusOption.DETAIL.name().toLowerCase()); if (getSucceeded()) { volumeAdvancedDetails.copyDetailsFrom(result.getVolumeAdvancedDetails()); executeVolumeStatusInfo(GlusterVolumeStatusOption.CLIENTS.name().toLowerCase()); if (getSucceeded()) { volumeAdvancedDetails.copyClientsFrom(result.getVolumeAdvancedDetails()); executeVolumeStatusInfo(GlusterVolumeStatusOption.MEM.name().toLowerCase()); if (getSucceeded()) { volumeAdvancedDetails.copyMemoryFrom(result.getVolumeAdvancedDetails()); } } } } } setReturnValue(volumeAdvancedDetails); }</code><technical_language>is need initialize volumeAdvancedDetails parameter if is overridden line</technical_language>

Target:
protected void ExecuteVdsBrokerCommand() { executeVolumeStatusInfo(""); GlusterVolumeAdvancedDetails volumeAdvancedDetails = result.getVolumeAdvancedDetails(); if (getParameters().detailsRequired()) { if (getSucceeded()) { executeVolumeStatusInfo(GlusterVolumeStatusOption.DETAIL.name().toLowerCase()); if (getSucceeded()) { volumeAdvancedDetails.copyDetailsFrom(result.getVolumeAdvancedDetails()); executeVolumeStatusInfo(GlusterVolumeStatusOption.CLIENTS.name().toLowerCase()); if (getSucceeded()) { volumeAdvancedDetails.copyClientsFrom(result.getVolumeAdvancedDetails()); executeVolumeStatusInfo(GlusterVolumeStatusOption.MEM.name().toLowerCase()); if (getSucceeded()) { volumeAdvancedDetails.copyMemoryFrom(result.getVolumeAdvancedDetails()); } } } } } setReturnValue(volumeAdvancedDetails); }
Source:
<code>private Consumer<String> fsEventConsumer(String endpointId, String wsPath) { return it -> { try { String normalizedPath = wsPath.startsWith("/") ? wsPath.substring(1) : wsPath; String itemPath = normalizedPath.substring(normalizedPath.indexOf("/") + 1); String projectName = normalizedPath.split("/")[0]; if (!projectManager.isRegistered(absolutize(projectName))) { throw new NotFoundException("Project '" + projectName + "' is not found"); } String projectFsPath = pathTransformer.transform(projectName).toString(); GitConnection gitConnection = gitConnectionFactory.getConnection(projectFsPath); Status status = gitConnection.status(singletonList(itemPath)); FileChangedEventDto.Status fileStatus; if (status.getAdded().contains(itemPath)) { fileStatus = ADDED; } else if (status.getUntracked().contains(itemPath)) { fileStatus = UNTRACKED; } else if (status.getModified().contains(itemPath) || status.getChanged().contains(itemPath)) { fileStatus = MODIFIED; } else { fileStatus = NOT_MODIFIED; } transmitter .newRequest() .endpointId(endpointId) .methodName(EVENT_GIT_FILE_CHANGED) .paramsAsDto( newDto(FileChangedEventDto.class) .withPath(wsPath) .withStatus(fileStatus) .withEditedRegions(gitConnection.getEditedRegions(itemPath))) .sendAndSkipResult(); } catch (NotFoundException | ServerException e) { <START> if (!(e instanceof NotAGitRepositoryException) <END> && !(e instanceof GitCommitInProgressException)) { LOG.error(e.getMessage()); } } }; }</code><technical_language>} catch (GitCommitInProgressException | NotAGitRepositoryException e) { LOG.debug() } catch (NotFoundException | ServerException e) {</technical_language>

Target:
private Consumer<String> fsEventConsumer(String endpointId, String wsPath) { return it -> { try { String normalizedPath = wsPath.startsWith("/") ? wsPath.substring(1) : wsPath; String itemPath = normalizedPath.substring(normalizedPath.indexOf("/") + 1); String projectName = normalizedPath.split("/")[0]; if (!projectManager.isRegistered(absolutize(projectName))) { throw new NotFoundException("Project '" + projectName + "' is not found"); } String projectFsPath = pathTransformer.transform(projectName).toString(); GitConnection gitConnection = gitConnectionFactory.getConnection(projectFsPath); Status status = gitConnection.status(singletonList(itemPath)); FileChangedEventDto.Status fileStatus; if (status.getAdded().contains(itemPath)) { fileStatus = ADDED; } else if (status.getUntracked().contains(itemPath)) { fileStatus = UNTRACKED; } else if (status.getModified().contains(itemPath) || status.getChanged().contains(itemPath)) { fileStatus = MODIFIED; } else { fileStatus = NOT_MODIFIED; } transmitter .newRequest() .endpointId(endpointId) .methodName(EVENT_GIT_FILE_CHANGED) .paramsAsDto( newDto(FileChangedEventDto.class) .withPath(wsPath) .withStatus(fileStatus) .withEditedRegions(gitConnection.getEditedRegions(itemPath))) .sendAndSkipResult(); } catch (GitCommitInProgressException | GitInvalidRepositoryException e) { } catch (ServerException | NotFoundException e) { LOG.error(e.getMessage()); } }; }
Source:
<code>protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException, SQLException { Statement stmt = ((JdbcSchema) db).getConnection().createStatement(); try { <START> ResultSet result = stmt.executeQuery("SELECT account_id, default_context FROM accounts"); <END> while (result.next()) { int accountId = result.getInt(1); short defaultContext = result.getShort(2); AccountDiffPreference diffPref = AccountDiffPreference.createDefault(new Account.Id(accountId)); diffPref.setContext(defaultContext); db.accountDiffPreferences().insert(Collections.singleton(diffPref)); } } finally { stmt.close(); } }</code><technical_language>This turns out slow upgrade for 4100+ accounts. Turns out users default of 10, adding a <> 10 clause of this create preference objects for users a non-default value</technical_language>

Target:
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException { Statement stmt = ((JdbcSchema) db).getConnection().createStatement(); try { stmt.execute("DROP INDEX account_project_watches_ntNew"); stmt.execute("DROP INDEX account_project_watches_ntCmt"); stmt.execute("DROP INDEX account_project_watches_ntSub"); stmt.execute("CREATE INDEX account_project_watches_byProject" + " ON account_project_watches (project_name)"); } finally { stmt.close(); } }
Source:
<code>public String getLocation() { String location = OpenShiftCorePreferences.INSTANCE.getOCBinaryLocation(); if (StringUtils.isBlank(location)) { location = findLocation(); } <START> return location; <END> }</code><technical_language>OpenShiftPreferencePage OpenShiftCorePreferenceInitializer method, need 'pure' search for default in $PATH</technical_language>

Target:
public String getLocation() { String location = OpenShiftCorePreferences.INSTANCE.getOCBinaryLocation(); if (StringUtils.isBlank(location)) { location = getSystemPathLocation(); } return location; }
Source:
<code>protected void releaseInstance(T instance) throws IOException { AtomicInteger currentCount = providedVsCount.get(instance); if(currentCount != null) { if(currentCount.decrementAndGet() < 0) { currentCount.incrementAndGet(); throw new IllegalArgumentException("Given instance of " + instance.getClass().getName() + " is not managed by this provider"); } } else { throw new IllegalArgumentException("Given instance of " + instance.getClass().getName() + " is not managed by this provider"); } <START> if(instantiated.contains(instance) && instance instanceof Closeable) { <END> ((Closeable)instance).close(); } instantiated.remove(instance); }</code><technical_language>This simplified if (instantiated.remove(instance)) && instance instance Closeable) dropping remove block</technical_language>

Target:
protected void releaseInstance(T instance) throws IOException { AtomicInteger currentCount = providedVsCount.get(instance); if(currentCount != null) { if(currentCount.decrementAndGet() < 0) { currentCount.incrementAndGet(); throw new IllegalArgumentException("Given instance of " + instance.getClass().getName() + " is not managed by this provider"); } } else { throw new IllegalArgumentException("Given instance of " + instance.getClass().getName() + " is not managed by this provider"); } if(instantiated.remove(instance) && instance instanceof Closeable) { ((Closeable)instance).close(); } }
Source:
<code>public TestingConnectorSession(List<PropertyMetadata<?>> properties) { <START> this("user", Optional.of("test"), UTC_KEY, ENGLISH, System.currentTimeMillis(), properties, ImmutableMap.of(), true); <END> }</code><technical_language>default (true) F.C.: new FeatureConfig().isLegacyTimestamp()</technical_language>

Target:
public TestingConnectorSession(List<PropertyMetadata<?>> properties) { this("user", Optional.of("test"), UTC_KEY, ENGLISH, System.currentTimeMillis(), properties, ImmutableMap.of(), false); }
Source:
<code>protected void damageTool(GlowPlayer player, ItemStack holding, int damage) { <START> if (player.getGameMode() == GameMode.CREATIVE || damage == 0) { <END> return; } holding.setDurability((short) (holding.getDurability() + damage)); if (holding.getDurability() == maxDurability + damage) { EventFactory.callEvent(new PlayerItemBreakEvent(player, holding)); player.getInventory().remove(holding); } }</code><technical_language>damage == 0</technical_language>

Target:
protected void damageTool(GlowPlayer player, ItemStack holding, int damage) { if (holding == null || player.getGameMode() == GameMode.CREATIVE || damage == 0) { return; } holding.setDurability((short) (holding.getDurability() + damage)); if (holding.getDurability() > maxDurability) { EventFactory.callEvent(new PlayerItemBreakEvent(player, holding)); player.getInventory().remove(holding); } }
Source:
<code>private Map<String, String> addBuildArgs(BuildContext buildContext) { Map<String, String> buildArgsFromProject = addBuildArgsFromProperties(buildContext.getMojoParameters().getProject().getProperties()); Map<String, String> buildArgsFromSystem = addBuildArgsFromProperties(System.getProperties()); Map<String, String> buildArgsFromDockerConfig = addBuildArgsFromDockerConfig(); return ImmutableMap.<String, String>builder() .putAll(buildContext.getBuildArgs() != null ? buildContext.getBuildArgs() : Collections.<String, String>emptyMap()) .putAll(buildArgsFromProject) .putAll(buildArgsFromSystem) <START> .putAll(buildArgsFromDockerConfig) <END> .build(); }</code><technical_language>put position of chain defaults overwritable project args system properties</technical_language>

Target:
private Map<String, String> addBuildArgs(BuildContext buildContext) { Map<String, String> buildArgsFromProject = addBuildArgsFromProperties(buildContext.getMojoParameters().getProject().getProperties()); Map<String, String> buildArgsFromSystem = addBuildArgsFromProperties(System.getProperties()); Map<String, String> buildArgsFromDockerConfig = addBuildArgsFromDockerConfig(); return ImmutableMap.<String, String>builder() .putAll(buildArgsFromDockerConfig) .putAll(buildContext.getBuildArgs() != null ? buildContext.getBuildArgs() : Collections.<String, String>emptyMap()) .putAll(buildArgsFromProject) .putAll(buildArgsFromSystem) .build(); }
Source:
<code>private int getReportTotalRows( final String key ) { final Map<String, Serializable> metaData = getCachedMetaData( key ); if ( metaData != null ) { final Object reportTotalRows = metaData.get( REPORT_ROWS ); if ( reportTotalRows != null ) { return (int) reportTotalRows; } } <START> return 0; <END> }</code><technical_language>If is valid result, I feel nice pretend one. Zero rows is a valid result if table-model returned rows (SELECT \* x FALSE). returning "-1" API's response clean. If return "0" here, set row-limit in UI zero (see RowLimitControl, line 110). If return -1, a of detecting this kind of bad state leave UI unchanged; next full generation get a valid result. (You get this point if cache cleared out call get report-content call get metadata. happen in implementation, interfaces public for OEMs, create backends evict content random points in time. avoid race condition combine reading of content metadata single operation items is. lets start a rewrite, lets handle error in a predictable instead.)</technical_language>

Target:
private int getReportTotalRows( final String key ) { final Map<String, Serializable> metaData = getCachedMetaData( key ); if ( metaData != null ) { final Object reportTotalRows = metaData.get( REPORT_ROWS ); if ( reportTotalRows != null ) { return (int) reportTotalRows; } } return -1; }
Source:
<code>public void testUpdateMetadataAllowedImmediatelyAfterBootstrap() { MockTime time = new MockTime(); Metadata metadata = new Metadata(refreshBackoffMs, metadataExpireMs, new LogContext(), new ClusterResourceListeners()); metadata.bootstrap(Collections.singletonList(new InetSocketAddress("localhost", 9002))); <START> metadata.requestUpdate(); <END> assertEquals(0, metadata.timeToAllowUpdate(time.milliseconds())); assertEquals(0, metadata.timeToNextUpdate(time.milliseconds())); }</code><technical_language>bootstrap() mandate update, right? Do need call requestUpdate</technical_language>

Target:
public void testUpdateMetadataAllowedImmediatelyAfterBootstrap() { MockTime time = new MockTime(); Metadata metadata = new Metadata(refreshBackoffMs, metadataExpireMs, new LogContext(), new ClusterResourceListeners()); metadata.bootstrap(Collections.singletonList(new InetSocketAddress("localhost", 9002))); assertEquals(0, metadata.timeToAllowUpdate(time.milliseconds())); assertEquals(0, metadata.timeToNextUpdate(time.milliseconds())); }
Source:
<code>public List<Predicate<ItemStackSnapshot>> getIngredientPredicates() { <START> return ingredients; <END> }</code><technical_language>this</technical_language>

Target:
public List<Predicate<ItemStackSnapshot>> getIngredientPredicates() { return this.ingredients; }
Source:
<code>public void hasAnnotatedAllParameters(ExecutableElement element, ElementValidation validation) { if (!validation.isValid()) { return; } Set<String> urlVariableNames = restAnnotationHelper.extractUrlVariableNames(element); if (urlVariableNames.size() != numberOfPathAnnotatedParameter(element) + numberOfRequiresCookieInUrl(element)) { <START> validation.addError(element, "%s parameters must add annotations"); <END> } for (VariableElement variableElement : element.getParameters()) { if (!restAnnotationHelper.hasRequestParameterAnnotation(variableElement)) { validation.addError(element, "%s method parameters '" + variableElement + "' must be annotated"); } } }</code><technical_language>more specific here? (The user add @Path here, not?)</technical_language>

Target:
public void hasAnnotatedAllParameters(ExecutableElement element, ElementValidation validation) { if (!validation.isValid()) { return; } Set<String> urlVariableNames = restAnnotationHelper.extractUrlVariableNames(element); if (urlVariableNames.size() != numberOfPathAnnotatedParameter(element) + numberOfRequiresCookieInUrl(element)) { validation.addError(element, "%s must have url variables corresponding to the @Path or @RequiresCookieInUrl annotation"); } for (VariableElement variableElement : element.getParameters()) { if (!restAnnotationHelper.hasRestApiMethodParameterAnnotation(variableElement)) { validation.addError(element, "%s method parameters '" + variableElement + "' must be annotated"); } } }
Source:
<code>public void readTraces() { if (fTraceEnum.getNbEvents() != -1) { try (CTFTrace trace = new CTFTrace(fTraceEnum.getPath()); CTFTraceReader reader = new CTFTraceReader(trace)) { EventDefinition currentEventDef = reader.getCurrentEventDef(); double start = currentEventDef.getTimestamp(); long count = 0; double end = start; while (reader.hasMoreEvents()) { reader.advance(); count++; currentEventDef = reader.getCurrentEventDef(); if (currentEventDef != null) { end = currentEventDef.getTimestamp(); if (currentEventDef.getDeclaration().getName().equals(CTFStrings.LOST_EVENT_NAME)) { count += ((IntegerDefinition) currentEventDef.getFields().getDefinition(CTFStrings.LOST_EVENTS_FIELD)).getValue() - 1; } } } assertEquals("Event count", fTraceEnum.getNbEvents(), count); assertEquals("Trace duration", fTraceEnum.getDuration(), (end - start) / 1000000000.0, 1.0); } catch (CTFReaderException e) { fail(fTraceEnum.getPath() + " " + e.getMessage()); } } <START> else{ <END> assumeTrue("Trace did not specify events count",false); } }</code><technical_language>a formatting issues</technical_language>

Target:
public void readTraces() { if (fTraceEnum.getNbEvents() != -1) { try (CTFTraceReader reader = new CTFTraceReader(new CTFTrace(fTraceEnum.getPath()))) { EventDefinition currentEventDef = reader.getCurrentEventDef(); double start = currentEventDef.getTimestamp(); long count = 0; double end = start; while (reader.hasMoreEvents()) { reader.advance(); count++; currentEventDef = reader.getCurrentEventDef(); if (currentEventDef != null) { end = currentEventDef.getTimestamp(); if (currentEventDef.getDeclaration().getName().equals(CTFStrings.LOST_EVENT_NAME)) { count += ((IntegerDefinition) currentEventDef.getFields().getDefinition(CTFStrings.LOST_EVENTS_FIELD)).getValue() - 1; } } } assertEquals("Event count", fTraceEnum.getNbEvents(), count); assertEquals("Trace duration", fTraceEnum.getDuration(), (end - start) / 1000000000.0, 1.0); } catch (CTFReaderException e) { fail(fTraceEnum.getPath() + " " + e.getMessage()); } } else { assumeTrue("Trace did not specify events count", false); } }
Source:
<code>public LdapIdentityProvider( @Nonnull String stsEndpoint, @Nonnull String ldapUsername, @Nonnull String ldapPassword, @Nullable OkHttpClient customHttpClient) { super(customHttpClient); stsEndpoint = Objects.requireNonNull(stsEndpoint, "STS endpoint cannot be empty"); <END> HttpUrl url = Objects.requireNonNull(HttpUrl.parse(stsEndpoint), "Invalid STS endpoint"); <START> Objects.requireNonNull(ldapUsername, "LDAP username must not be null"); if (ldapUsername.isEmpty()) { throw new IllegalArgumentException("LDAP username must not be empty"); } Objects.requireNonNull(ldapPassword, "LDAP password must not be null"); HttpUrl.Builder urlBuilder = newUrlBuilder(url, "AssumeRoleWithLDAPIdentity", 0, null, null, null); url = urlBuilder .addQueryParameter("LDAPUsername", ldapUsername) .addQueryParameter("LDAPPassword", ldapPassword) .build(); this.request = new Request.Builder().url(url).method("POST", EMPTY_BODY).build(); }</code><technical_language>suggestion if (ldapUsername == null || ldapUsername.isEmpty()) { throw new IllegalArgumentException("LDAP username provided"); }</technical_language>

Target:
public LdapIdentityProvider( @Nonnull String stsEndpoint, @Nonnull String ldapUsername, @Nonnull String ldapPassword, @Nullable OkHttpClient customHttpClient) { super(customHttpClient); stsEndpoint = Objects.requireNonNull(stsEndpoint, "STS endpoint cannot be empty"); HttpUrl url = Objects.requireNonNull(HttpUrl.parse(stsEndpoint), "Invalid STS endpoint"); if (ldapUsername == null || ldapUsername.isEmpty()) { throw new IllegalArgumentException("LDAP username must be provided"); } Objects.requireNonNull(ldapPassword, "LDAP password must not be null"); HttpUrl.Builder urlBuilder = newUrlBuilder(url, "AssumeRoleWithLDAPIdentity", 0, null, null, null); url = urlBuilder .addQueryParameter("LDAPUsername", ldapUsername) .addQueryParameter("LDAPPassword", ldapPassword) .build(); this.request = new Request.Builder().url(url).method("POST", EMPTY_BODY).build(); }
Source:
<code>public CtfLocation clone() { <START> return new CtfLocation(this.getLocation()); <END> }</code><technical_language>a shallow copy is enough. Some other class a reference fLocation modifying it. For clone a deep copy is needed</technical_language>

Target:
public CtfLocation clone() { return new CtfLocation(this.getLocationData()); }
Source:
<code>public void testMoshi() throws Exception { final DateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); String birthdate = "2007-11-11"; Date date = df.parse(birthdate); Moshi moshi = SampleTypeAdapterFactory.configureMoshiBuilder(new Moshi.Builder()) .build(); Person person = Person.builder() .name("Piasy") .gender(1) .age(23) .birthdate(date) .address(Address.create("street", "city")) .build(); String json = "{\"name\":\"Piasy\",\"gender\":1," + "\"age\":23,\"birthdate\":\"" + birthdate + "\",\"address\":{\"street-name\":\"street\",\"city\":\"city\"}}"; JsonAdapter<Person> jsonAdapter = moshi.adapter(Person.class); String toJson = jsonAdapter.toJson(person); Assert.assertEquals(json, toJson); Person fromJson = jsonAdapter.fromJson(json); <START> Assert.assertEquals("Piasy", fromJson.name()); <END> Assert.assertEquals(23, fromJson.age()); Assert.assertEquals(1, fromJson.gender()); Assert.assertEquals(date, fromJson.birthdate()); }</code><technical_language>Static import methods</technical_language>

Target:
public void testMoshi() throws Exception { final DateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); Moshi moshi = new Moshi.Builder() .add(SampleTypeAdapterFactory.create()) .build(); Person person = Person.builder() .name("Piasy") .gender(1) .age(23) .address(Address.create("street", "city")) .build(); String json = "{\"name\":\"Piasy\",\"gender\":1," + "\"age\":23,\"address\":{\"street-name\":\"street\",\"city\":\"city\"}}"; JsonAdapter<Person> jsonAdapter = moshi.adapter(Person.class); String toJson = jsonAdapter.toJson(person); assertEquals(json, toJson); Person fromJson = jsonAdapter.fromJson(json); assertEquals("Piasy", fromJson.name()); assertEquals(23, fromJson.age()); assertEquals(1, fromJson.gender()); }
Source:
<code>public void testTopicNotFromConfHeader() throws UnsupportedEncodingException { Sink kafkaSink = new KafkaSink(); Context context = prepareDefaultContext(); context.put(KafkaSinkConstants.ALLOW_TOPIC_OVERRIDE_HEADER, "false"); context.put(KafkaSinkConstants.TOPIC_OVERRIDE_HEADER, "foo"); <START> context.put(KafkaSinkConstants.TOPIC_OVERRIDE_HEADER, "bar"); <END> Configurables.configure(kafkaSink, context); Channel memoryChannel = new MemoryChannel(); Configurables.configure(memoryChannel, context); kafkaSink.setChannel(memoryChannel); kafkaSink.start(); String msg = "test-topic-from-config-header"; Map<String, String> headers = new HashMap<String, String>(); headers.put(KafkaSinkConstants.DEFAULT_TOPIC_OVERRIDE_HEADER, TestConstants.CUSTOM_TOPIC); headers.put("key", TestConstants.CUSTOM_KEY); Transaction tx = memoryChannel.getTransaction(); tx.begin(); Event event = EventBuilder.withBody(msg.getBytes(), headers); memoryChannel.put(event); tx.commit(); tx.close(); try { Sink.Status status = kafkaSink.process(); if (status == Sink.Status.BACKOFF) { fail("Error Occurred"); } } catch (EventDeliveryException ex) { } MessageAndMetadata fetchedMsg = testUtil.getNextMessageFromConsumer(DEFAULT_TOPIC); assertEquals(msg, new String((byte[]) fetchedMsg.message(), "UTF-8")); assertEquals(TestConstants.CUSTOM_KEY, new String((byte[]) fetchedMsg.key(), "UTF-8")); }</code><technical_language>nit: this line of code is needed</technical_language>

Target:
public void testTopicNotFromConfHeader() throws UnsupportedEncodingException { Sink kafkaSink = new KafkaSink(); Context context = prepareDefaultContext(); context.put(KafkaSinkConstants.ALLOW_TOPIC_OVERRIDE_HEADER, "false"); context.put(KafkaSinkConstants.TOPIC_OVERRIDE_HEADER, "foo"); Configurables.configure(kafkaSink, context); Channel memoryChannel = new MemoryChannel(); Configurables.configure(memoryChannel, context); kafkaSink.setChannel(memoryChannel); kafkaSink.start(); String msg = "test-topic-from-config-header"; Map<String, String> headers = new HashMap<String, String>(); headers.put(KafkaSinkConstants.DEFAULT_TOPIC_OVERRIDE_HEADER, TestConstants.CUSTOM_TOPIC); headers.put("foo", TestConstants.CUSTOM_TOPIC); Transaction tx = memoryChannel.getTransaction(); tx.begin(); Event event = EventBuilder.withBody(msg.getBytes(), headers); memoryChannel.put(event); tx.commit(); tx.close(); try { Sink.Status status = kafkaSink.process(); if (status == Sink.Status.BACKOFF) { fail("Error Occurred"); } } catch (EventDeliveryException ex) { } MessageAndMetadata<?, ?> fetchedMsg = testUtil.getNextMessageFromConsumer(DEFAULT_TOPIC); assertEquals(msg, new String((byte[]) fetchedMsg.message(), "UTF-8")); }
Source:
<code>public HadoopDruidIndexerConfig( final @JsonProperty("spec") HadoopIngestionSpec spec ) { this.schema = spec; this.pathSpec = JSON_MAPPER.convertValue(spec.getIOConfig().getPathSpec(), PathSpec.class); for (Map.Entry<DateTime, List<HadoopyShardSpec>> entry : spec.getTuningConfig().getShardSpecs().entrySet()) { if (entry.getValue() == null || entry.getValue().isEmpty()) { continue; } final ShardSpec actualSpec = entry.getValue().get(0).getActualSpec(); shardSpecLookups.put( entry.getKey(), actualSpec.getLookup( Lists.transform( entry.getValue(), new Function<HadoopyShardSpec, ShardSpec>() { @Override public ShardSpec apply(HadoopyShardSpec input) { return input.getActualSpec(); } } ) ) ); <START> Map<ShardSpec, HadoopyShardSpec> hadoopyShardSpecLookup = Maps.newHashMap(); <END> for (HadoopyShardSpec hadoopyShardSpec : entry.getValue()) { hadoopyShardSpecLookup.put(hadoopyShardSpec.getActualSpec(), hadoopyShardSpec); } hadoopShardSpecLookup.put(entry.getKey(), hadoopyShardSpecLookup); } this.rollupGran = spec.getDataSchema().getGranularitySpec().getQueryGranularity(); }</code><technical_language>suggest rename innerHadoopShardSpecLookup - "hadoopy" is easy mistake for "hadoop" is reading this code</technical_language>

Target:
public HadoopDruidIndexerConfig( final @JsonProperty("spec") HadoopIngestionSpec spec ) { this.schema = spec; this.pathSpec = JSON_MAPPER.convertValue(spec.getIOConfig().getPathSpec(), PathSpec.class); for (Map.Entry<DateTime, List<HadoopyShardSpec>> entry : spec.getTuningConfig().getShardSpecs().entrySet()) { if (entry.getValue() == null || entry.getValue().isEmpty()) { continue; } final ShardSpec actualSpec = entry.getValue().get(0).getActualSpec(); shardSpecLookups.put( entry.getKey(), actualSpec.getLookup( Lists.transform( entry.getValue(), new Function<HadoopyShardSpec, ShardSpec>() { @Override public ShardSpec apply(HadoopyShardSpec input) { return input.getActualSpec(); } } ) ) ); Map<ShardSpec, HadoopyShardSpec> innerHadoopShardSpecLookup = Maps.newHashMap(); for (HadoopyShardSpec hadoopyShardSpec : entry.getValue()) { innerHadoopShardSpecLookup.put(hadoopyShardSpec.getActualSpec(), hadoopyShardSpec); } hadoopShardSpecLookup.put(entry.getKey(), innerHadoopShardSpecLookup); } this.rollupGran = spec.getDataSchema().getGranularitySpec().getQueryGranularity(); }
Source:
<code>public static List<List<Integer>> sortHostIdByHGDistance(int hostId, Map<Integer, String> hostGroups) { String localHostGroup = hostGroups.get(hostId); Preconditions.checkArgument(localHostGroup != null); <START> List<Integer> sortedList = hostGroups.keySet().stream() <END> .filter(hid -> hid != hostId) .sorted((hid1, hid2) -> computeHADistance(localHostGroup, hostGroups.get(hid2)) - computeHADistance(localHostGroup, hostGroups.get(hid1)) ) .collect(Collectors.toList()); List<List<Integer>> result = Lists.newArrayList(); if (sortedList.size() == 1) { result.add(sortedList); return result; } List<Integer> subgroup = Lists.newArrayList(); subgroup.add(sortedList.get(0)); for (int i = 1; i < sortedList.size(); i++) { int hid1 = sortedList.get(i - 1); int hid2 = sortedList.get(i); int distance1 = computeHADistance(localHostGroup, hostGroups.get(hid1)); int distance2 = computeHADistance(localHostGroup, hostGroups.get(hid2)); if (distance1 == distance2) { subgroup.add(hid2); } else { result.add(subgroup); subgroup = Lists.newArrayList(); subgroup.add(hid2); } } if (!subgroup.isEmpty()) { result.add(subgroup); } return result; }</code><technical_language>Is check needed? Is a host is a group</technical_language>

Target:
public static List<Collection<Integer>> sortHostIdByHGDistance(int hostId, Map<Integer, String> hostGroups) { String localHostGroup = hostGroups.get(hostId); Preconditions.checkArgument(localHostGroup != null); Multimap<Integer, Integer> distanceMap = LinkedListMultimap.create(); for (Map.Entry<Integer, String> entry : hostGroups.entrySet()) { if (hostId == entry.getKey()) continue; distanceMap.put(computeHADistance(localHostGroup, entry.getValue()), entry.getKey()); } List<Collection<Integer>> result = distanceMap.asMap().entrySet().stream() .sorted(Comparator.comparingInt(k->((Entry<Integer, Integer>) k).getKey()).reversed()) .map(x->x.getValue()) .collect(Collectors.toList()); return result; }
Source:
<code>private void markUnusedWALs() { Set<DfsLogger> candidates; synchronized (closedLogs) { candidates = new HashSet<>(closedLogs); } for (Tablet tablet : getOnlineTablets()) { tablet.removeInUseLogs(candidates); <START> if (candidates.size() == 0) { <END> break; } } try { TServerInstance session = this.getTabletSession(); for (DfsLogger candidate : candidates) { log.info("Marking " + candidate.getPath() + " as unreferenced"); walMarker.walUnreferenced(session, candidate.getPath()); } synchronized (closedLogs) { closedLogs.removeAll(candidates); } } catch (WalMarkerException ex) { log.info(ex.toString(), ex); } }</code><technical_language>isEmpty()</technical_language>

Target:
private void markUnusedWALs() { Set<DfsLogger> candidates; synchronized (closedLogs) { candidates = new HashSet<>(closedLogs); } for (Tablet tablet : getOnlineTablets()) { tablet.removeInUseLogs(candidates); if (candidates.isEmpty()) { break; } } try { TServerInstance session = this.getTabletSession(); for (DfsLogger candidate : candidates) { log.info("Marking " + candidate.getPath() + " as unreferenced"); walMarker.walUnreferenced(session, candidate.getPath()); } synchronized (closedLogs) { closedLogs.removeAll(candidates); } } catch (WalMarkerException ex) { log.info(ex.toString(), ex); } }
Source:
<code>public OSService[] getServices() { OSProcess[] process = getChildProcesses(1, 0, OperatingSystem.ProcessSort.PID); File etc = new File("/etc/init"); <START> File[] files = etc.listFiles(); <END> OSService[] svcArray = new OSService[files.size()]; for (int i = 0; i < files.length; i++) { svcArray[i].setName(files[i].getName()); for (int j = 0; j < process.length; j++) { if(process[j].getName().equals(files[i].getName())) { svcArray[i].setProcessId(process[j].getProcessID()); svcArray[i].setState(OSService.State.RUNNING); } else { svcArray[i].setState(OSService.State.STOPPED); } } } return svcArray; }</code><technical_language>Need a null check (I /etc/init exist, crash OSHI if doesn't.) issue FreeBSD Solaris implementations</technical_language>

Target:
public OSService[] getServices() { List<OSService> services = new ArrayList<>(); Set<String> running = new HashSet<>(); for (OSProcess p : getChildProcesses(1, 0, ProcessSort.PID)) { OSService s = new OSService(p.getName(), p.getProcessID(), RUNNING); ; services.add(s); running.add(p.getName()); } File dir = new File("/etc/init"); if (dir.exists() && dir.isDirectory()) { for (File f : dir.listFiles((f, name) -> name.toLowerCase().endsWith(".conf"))) { String name = f.getName().substring(0, f.getName().length() - 5); int index = name.lastIndexOf('.'); String shortName = (index < 0 || index > name.length() - 2) ? name : name.substring(index + 1); if (!running.contains(name) && !running.contains(shortName)) { OSService s = new OSService(name, 0, STOPPED); services.add(s); } } } else { LOG.error("Directory: /etc/init does not exist"); } return services.toArray(new OSService[0]); }
Source:
<code>private void setTicketUsingUpdateDevice() { Map<String, Object> devStruct = new HashMap<>(); devStruct.put("deviceType", "graphics"); devStruct.put("graphicsType", getParameters().getGraphicsType().name().toLowerCase()); devStruct.put("password", getParameters().getTicket()); devStruct.put("ttl", getParameters().getValidTime()); <START> if(getParameters().getClusterCompatibilityVersion().less(new Version(4, 0))) { <END> devStruct.put("existingConnAction", connectionAction); } devStruct.put("disconnectAction", getParameters().getDisconnectAction()); devStruct.put("params", getUidParams()); status = getBroker().vmUpdateDevice(getParameters().getVmId().toString(), devStruct); }</code><technical_language>Version.v4_0 constant. Also, space "if" "("</technical_language>

Target:
private void setTicketUsingUpdateDevice() { Map<String, Object> devStruct = new HashMap<>(); devStruct.put("deviceType", "graphics"); devStruct.put("graphicsType", getParameters().getGraphicsType().name().toLowerCase()); devStruct.put("password", getParameters().getTicket()); devStruct.put("ttl", getParameters().getValidTime()); if (getParameters().getCompatibilityVersion().less(Version.v4_0)) { devStruct.put("existingConnAction", connectionAction); } devStruct.put("disconnectAction", getParameters().getDisconnectAction()); devStruct.put("params", getUidParams()); status = getBroker().vmUpdateDevice(getParameters().getVmId().toString(), devStruct); }
Source:
<code>public static UsbPolicy getUsbPolicyOnUpdate(Usb usb, UsbPolicy currentPolicy) { if (usb == null) { return currentPolicy; } if (!usb.isSetEnabled()) { if (usb.isSetType()) { if (currentPolicy == UsbPolicy.DISABLED) { return currentPolicy; } else { <START> UsbType usbType = UsbType.fromValue(usb.getType()); <END> return mapUsbTypeToPolicy(usbType); } } else { return currentPolicy; } } else { if (!usb.isEnabled()) return UsbPolicy.DISABLED; else { if (usb.isSetType()) { UsbType usbType = UsbType.fromValue(usb.getType()); return mapUsbTypeToPolicy(usbType); } else { return currentPolicy == UsbPolicy.DISABLED ? null : currentPolicy; } } } }</code><technical_language>pls inline this variable</technical_language>

Target:
public static UsbPolicy getUsbPolicyOnUpdate(Usb usb, UsbPolicy currentPolicy) { if (usb == null) { return currentPolicy; } if (!usb.isSetEnabled()) { if (usb.isSetType()) { if (currentPolicy == UsbPolicy.DISABLED) { return currentPolicy; } else { return mapUsbTypeToPolicy(UsbType.fromValue(usb.getType())); } } else { return currentPolicy; } } else { if (!usb.isEnabled()) return UsbPolicy.DISABLED; else { if (usb.isSetType()) { return mapUsbTypeToPolicy(UsbType.fromValue(usb.getType())); } else { return currentPolicy == UsbPolicy.DISABLED ? null : currentPolicy; } } } }
Source:
<code>public void prepareRun(BatchSinkContext context) { LOG.debug("tableName = {}; pluginType = {}; pluginName = {}; connectionString = {}; columns = {}; " + "transaction isolation level: {}", dbSinkConfig.tableName, dbSinkConfig.jdbcPluginType, dbSinkConfig.jdbcPluginName, dbSinkConfig.connectionString, dbSinkConfig.columns, dbSinkConfig.transactionIsolationLevel); Class<? extends Driver> driverClass = context.loadPluginClass(getJDBCPluginId()); try { Preconditions.checkArgument( dbManager.tableExists(driverClass, dbSinkConfig.tableName), "Table %s does not exist. Please check that the 'tableName' property " + "has been set correctly, and that the connection string %s points to a valid database.", dbSinkConfig.tableName, dbSinkConfig.connectionString); } finally { DBUtils.cleanup(driverClass); } context.addOutput(Output.of(dbSinkConfig.referenceName, new DBOutputFormatProvider(dbSinkConfig, driverClass))); recordLineage(context, dbSinkConfig.referenceName, Schema.of(Schema.Type.STRING), <START> Arrays.asList(dbSinkConfig.columns.split(","))); <END> }</code><technical_language>field derived schema</technical_language>

Target:
public void prepareRun(BatchSinkContext context) { LOG.debug("tableName = {}; pluginType = {}; pluginName = {}; connectionString = {}; columns = {}; " + "transaction isolation level: {}", dbSinkConfig.tableName, dbSinkConfig.jdbcPluginType, dbSinkConfig.jdbcPluginName, dbSinkConfig.connectionString, dbSinkConfig.columns, dbSinkConfig.transactionIsolationLevel); Class<? extends Driver> driverClass = context.loadPluginClass(getJDBCPluginId()); try { Preconditions.checkArgument( dbManager.tableExists(driverClass, dbSinkConfig.tableName), "Table %s does not exist. Please check that the 'tableName' property " + "has been set correctly, and that the connection string %s points to a valid database.", dbSinkConfig.tableName, dbSinkConfig.connectionString); } finally { DBUtils.cleanup(driverClass); } context.addOutput(Output.of(dbSinkConfig.referenceName, new DBOutputFormatProvider(dbSinkConfig, driverClass))); Schema schema = context.getInputSchema(); if (schema != null && schema.getFields() != null) { recordLineage(context, dbSinkConfig.referenceName, schema, schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } }
Source:
<code>public void init() throws Exception { if (objectName == null) { objectName = getObjectName(); } if (mBeanServer == null) { mBeanServer = ManagementFactory.getPlatformMBeanServer(); } if (mBeanServer != null) { try { mBeanServer.registerMBean(this, objectName); } catch (InstanceAlreadyExistsException iaee) { mBeanServer.unregisterMBean(objectName); mBeanServer.registerMBean(this, objectName); } Object handback = null; listener = getNotificationListener(); filter = getNotificationFilter(); mBeanServer.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, listener, filter, handback); } if (logged.compareAndSet(false, true)) { String text = getVersion(); <START> if (Strings.isNotBlank(text)) { <END> text += " "; } LOG.info("Welcome to hawtio " + text); } }</code><technical_language>I remove this if statement</technical_language>

Target:
public void init() throws Exception { if (objectName == null) { objectName = getObjectName(); } if (mBeanServer == null) { mBeanServer = ManagementFactory.getPlatformMBeanServer(); } if (mBeanServer != null) { try { mBeanServer.registerMBean(this, objectName); } catch (InstanceAlreadyExistsException iaee) { mBeanServer.unregisterMBean(objectName); mBeanServer.registerMBean(this, objectName); } Object handback = null; listener = getNotificationListener(); filter = getNotificationFilter(); mBeanServer.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, listener, filter, handback); } if (logged.compareAndSet(false, true)) { LOG.info("Welcome to hawtio {}", getVersion()); } }
Source:
<code>private void configureStreamGraph(final StreamGraph graph) { checkNotNull(graph); graph.setChaining(chaining); graph.setUserArtifacts(userArtifacts); graph.setTimeCharacteristic(timeCharacteristic); graph.setJobName(jobName); if (shouldExecuteInBatchMode) { if (checkpointConfig.isCheckpointingEnabled()) { LOG.info("Disabled Checkpointing. Checkpointing is not supported when executing jobs in BATCH mode."); <START> checkpointConfig.disableCheckpointing(); <END> } graph.setAllVerticesInSameSlotSharingGroupByDefault(false); graph.setGlobalDataExchangeMode(GlobalDataExchangeMode.POINTWISE_EDGES_PIPELINED); graph.setScheduleMode(ScheduleMode.LAZY_FROM_SOURCES_WITH_BATCH_SLOT_REQUEST); setDefaultBufferTimeout(-1); setBatchStateBackendAndTimerService(graph); } else { graph.setStateBackend(stateBackend); graph.setAllVerticesInSameSlotSharingGroupByDefault(true); graph.setGlobalDataExchangeMode(GlobalDataExchangeMode.ALL_EDGES_PIPELINED); graph.setScheduleMode(ScheduleMode.EAGER); } }</code><technical_language>I setting CheckpointConfig user gave us. I in general good pass this is time modify here, I think. do internal copy of checkpoint config modify it</technical_language>

Target:
private void configureStreamGraph(final StreamGraph graph) { checkNotNull(graph); graph.setChaining(chaining); graph.setUserArtifacts(userArtifacts); graph.setTimeCharacteristic(timeCharacteristic); graph.setJobName(jobName); if (shouldExecuteInBatchMode) { if (checkpointConfig.isCheckpointingEnabled()) { LOG.info("Disabled Checkpointing. Checkpointing is not supported and not needed when executing jobs in BATCH mode."); checkpointConfig.disableCheckpointing(); } graph.setAllVerticesInSameSlotSharingGroupByDefault(false); graph.setGlobalDataExchangeMode(GlobalDataExchangeMode.POINTWISE_EDGES_PIPELINED); graph.setScheduleMode(ScheduleMode.LAZY_FROM_SOURCES_WITH_BATCH_SLOT_REQUEST); setDefaultBufferTimeout(-1); setBatchStateBackendAndTimerService(graph); } else { graph.setStateBackend(stateBackend); graph.setAllVerticesInSameSlotSharingGroupByDefault(true); graph.setGlobalDataExchangeMode(GlobalDataExchangeMode.ALL_EDGES_PIPELINED); graph.setScheduleMode(ScheduleMode.EAGER); } }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_site_list, container, false); initializeViews(view); getSitesRequest(); <START> Log.i("ONCREATE", "ONCREATAE"); <END> return view; }</code><technical_language>need this log string anymore</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_site_list, container, false); initializeViews(view); getSitesRequest(); return view; }
Source:
<code>public JSONObject getPackageConfigure(String packageName) { try { return mJSONObject.getJSONObject("Packages") .getJSONObject(packageName); } catch (JSONException | NullPointerException configurationFileError) { throw new RuntimeException( "Failed to get configuration for package = " + packageName + " from " + TEST_CONFIGURATION_FILENAME + ".", configurationFileError ); } <START> } <END></code><technical_language>Do need change line 71 too</technical_language>

Target:
public JSONObject getPackageConfigure(String packageName) { try { return mJSONObject.getJSONObject("packages") .getJSONObject(packageName); } catch (JSONException | NullPointerException configurationFileError) { throw new RuntimeException( "Failed to get configuration for package = " + packageName + " from " + TEST_CONFIGURATION_FILENAME + ".", configurationFileError ); } }
Source:
<code>private boolean canCopyAllToClipboard() { for (IResource <START> fResource : <END> fResources) { if (!canCopyToClipboard(fResource)) { return false; } } for (IJavaElement fJavaElement : fJavaElements) { if (!canCopyToClipboard(fJavaElement)) { return false; } } for (IJarEntryResource fJarEntryResource : fJarEntryResources) { if (fJarEntryResource == null) { return false; } } return true; }</code><technical_language>rename resource</technical_language>

Target:
private boolean canCopyAllToClipboard() { for (IResource resource : fResources) { if (!canCopyToClipboard(resource)) { return false; } } for (IJavaElement javaElement : fJavaElements) { if (!canCopyToClipboard(javaElement)) { return false; } } for (IJarEntryResource jarEntryResource : fJarEntryResources) { if (jarEntryResource == null) { return false; } } return true; }