auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void addQuotaToVcpuQuotaList(QuotaPerUserUsageEntity quotaPerUserUsageEntity) { QuotaProgressBar vcpuQuotaProgressBar = new QuotaProgressBar(); if (quotaPerUserUsageEntity.isUnlimitedVcpu()) { vcpuQuotaProgressBar.setUnlimited(true); } else { vcpuQuotaProgressBar.setValueA((int) quotaPerUserUsageEntity.getOthersVcpuUsagePercentage()); vcpuQuotaProgressBar.setValueB((int) quotaPerUserUsageEntity.getUserVcpuUsagePercentage()); vcpuQuotaProgressBar.setTitle(messages.quotaFreeCpus(quotaPerUserUsageEntity.getFreeVcpu())); if (quotaPerUserUsageEntity.getVcpuTotalUsage() == 0) { vcpuQuotaProgressBar.setZeroValue(); } } VerticalPanel verticalPanel = new VerticalPanel(); Label quotaName = new Label(); quotaName.setText(quotaPerUserUsageEntity.getQuotaName()); verticalPanel.add(quotaName); verticalPanel.add(vcpuQuotaProgressBar); verticalPanel.setWidth("100%"); <START> cpusQuotasList.add(verticalPanel); <END> }</code><technical_language>this code block (VerticalPanel) copy pasted times - please extract it</technical_language>

Target:
private void addQuotaToVcpuQuotaList(QuotaPerUserUsageEntity quotaPerUserUsageEntity) { QuotaProgressBar vcpuQuotaProgressBar = new QuotaProgressBar(); if (quotaPerUserUsageEntity.isUnlimitedVcpu()) { vcpuQuotaProgressBar.setUnlimited(true); } else { vcpuQuotaProgressBar.setValueA((int) quotaPerUserUsageEntity.getOthersVcpuUsagePercentage()); vcpuQuotaProgressBar.setValueB((int) quotaPerUserUsageEntity.getUserVcpuUsagePercentage()); vcpuQuotaProgressBar.setTitle(messages.quotaFreeCpus(quotaPerUserUsageEntity.getFreeVcpu())); if (quotaPerUserUsageEntity.getVcpuTotalUsage() == 0) { vcpuQuotaProgressBar.setZeroValue(); } } addQuotaRow(cpusQuotasList, quotaPerUserUsageEntity.getQuotaName(), vcpuQuotaProgressBar); }
Source:
<code>private JXTable getNotesTable() { if (notesTable == null) { notesTable = new JXTable(); notesTable.setModel(getNotesTableModel()); <START> notesTable.setColumnSelectionAllowed(false); <END> notesTable.setCellSelectionEnabled(false); notesTable.setRowSelectionAllowed(true); notesTable.setAutoCreateRowSorter(true); notesTable.setColumnControlVisible(true); notesTable.setSortable(false); notesTable.getTableHeader().setReorderingAllowed(false); notesTable .getSelectionModel() .addListSelectionListener( new NotesTableSelectionHandler(notesTable, getExtensionHistory())); fillTable(); } return notesTable; }</code><technical_language>beta now</technical_language>

Target:
private JXTable getNotesTable() { if (notesTable == null) { notesTable = new JXTable(); notesTable.setModel(getNotesTableModel()); notesTable.setColumnSelectionAllowed(false); notesTable.setCellSelectionEnabled(false); notesTable.setRowSelectionAllowed(true); notesTable.setAutoCreateRowSorter(true); notesTable.setColumnControlVisible(true); notesTable .getSelectionModel() .addListSelectionListener( new NotesTableSelectionHandler(notesTable, getExtensionHistory())); fillTable(); } return notesTable; }
Source:
<code><START> public void setObjectId(ObjectId oid) { <END> this.oid = oid; }</code><technical_language>Return this</technical_language>

Target:
public DescribeCommand setObjectId(ObjectId oid) { this.oid = oid; return this; }
Source:
<code>public GeoJsonObjectType deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { String jsonValue = jsonParser.getText(); for (GeoJsonObjectType enumValue : GeoJsonObjectType.values()) { if (enumValue.getGeoJsonName().equals(jsonValue)) { return enumValue; } } <START> throw new IOException("No such value."); <END> }</code><technical_language>error message more descriptive</technical_language>

Target:
public GeoJsonObjectType deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { String jsonValue = jsonParser.getText(); for (GeoJsonObjectType enumValue : GeoJsonObjectType.values()) { if (enumValue.getGeoJsonName().equals(jsonValue)) { return enumValue; } } throw new IOException(jsonValue + " is not defined in GeoJsonObjectType"); }
Source:
<code>private String buildUrl(GHGeocodingRequest request) { String url = routeServiceUrl + "?"; if (request.isReverse()) { url += "reverse=true"; url += "&point=" + request.getLat() + "," + request.getLon(); } else { url += "reverse=false"; url += "&q=" + request.getQuery(); if (!Double.isNaN(request.getLat())) url += "&point=" + request.getLat() + "," + request.getLon(); <START> } <END> url += "&limit=" + request.getLimit(); url += "&locale=" + request.getLocale(); url += "&provider=" + request.getProvider(); if (!key.isEmpty()) { url += "&key=" + WebHelper.encodeURL(key); } return url; }</code><technical_language>I user a bit: if reverse throw exception if lat lon is invalid. if non-reverse throw exc if query is empty. adding point moved of if+else IMO line</technical_language>

Target:
private String buildUrl(GHGeocodingRequest request) { String url = routeServiceUrl + "?"; if (request.isReverse()) { if (!request.getPoint().isValid()) throw new IllegalArgumentException("For reverse geocoding you have to pass valid lat and long values"); url += "reverse=true"; } else { if (request.getQuery() == null) throw new IllegalArgumentException("For forward geocoding you have to a string for the query"); url += "reverse=false"; url += "&q=" + request.getQuery(); } if (request.getPoint().isValid()) url += "&point=" + request.getPoint().getLat() + "," + request.getPoint().getLon(); url += "&limit=" + request.getLimit(); url += "&locale=" + request.getLocale(); url += "&provider=" + request.getProvider(); if (!key.isEmpty()) { url += "&key=" + WebHelper.encodeURL(key); } return url; }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ComponentImpl)) { return false; } ComponentImpl component = (ComponentImpl) o; return getMountSources() == component.getMountSources() && Objects.equals(id, component.id) && Objects.equals(name, component.name) && Objects.equals(type, component.type) && Objects.equals(componentId, component.componentId) && Objects.equals(reference, component.reference) && Objects.equals(referenceContent, component.referenceContent) && Objects.equals(getEntrypoints(), component.getEntrypoints()) && Objects.equals(image, component.image) && Objects.equals(memoryLimit, component.memoryLimit) <START> && Objects.equals(command, component.command) <END> && Objects.equals(getArgs(), component.getArgs()) && Objects.equals(getVolumes(), component.getVolumes()) && Objects.equals(getEnv(), component.getEnv()) && Objects.equals(getEndpoints(), component.getEndpoints()); }</code><technical_language>command is a list initialized getter method, I revert this line</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ComponentImpl)) { return false; } ComponentImpl component = (ComponentImpl) o; return getMountSources() == component.getMountSources() && Objects.equals(generatedId, component.generatedId) && Objects.equals(alias, component.alias) && Objects.equals(type, component.type) && Objects.equals(componentId, component.componentId) && Objects.equals(reference, component.reference) && Objects.equals(referenceContent, component.referenceContent) && Objects.equals(image, component.image) && Objects.equals(memoryLimit, component.memoryLimit) && Objects.equals(getSelector(), component.getSelector()) && Objects.equals(getEntrypoints(), component.getEntrypoints()) && Objects.equals(getCommand(), component.getCommand()) && Objects.equals(getArgs(), component.getArgs()) && Objects.equals(getVolumes(), component.getVolumes()) && Objects.equals(getEnv(), component.getEnv()) && Objects.equals(getEndpoints(), component.getEndpoints()); }
Source:
<code>private static OGCGeometry geomFromBinary(Slice input) { requireNonNull(input, "input is null"); OGCGeometry geometry; try { geometry = OGCGeometry.fromBinary(input.toByteBuffer()); } catch (IllegalArgumentException | IndexOutOfBoundsException e) { <START> throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid WKB: " + e.toString(), e); <END> } geometry.setSpatialReference(null); return geometry; }</code><technical_language>@mpertierra e.toString() produces helpful java.lang.IndexOutOfBoundsException in test; try e.getMessage()</technical_language>

Target:
private static OGCGeometry geomFromBinary(Slice input) { requireNonNull(input, "input is null"); OGCGeometry geometry; try { geometry = OGCGeometry.fromBinary(input.toByteBuffer()); } catch (IllegalArgumentException | IndexOutOfBoundsException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid WKB", e); } geometry.setSpatialReference(null); return geometry; }
Source:
<code>public static TraceTokenScope addTraceTokenProperties(String... properties) { TokenState tokenState = token.get(); <START> checkState(tokenState != null, "no current trace token"); <END> Map<String, String> map = new LinkedHashMap<>(tokenState.getToken()); checkArgument((properties.length % 2) == 0, "odd number of elements in properties"); for (int i = 0; i < properties.length; i += 2) { requireNonNull(properties[i], "property key is null"); requireNonNull(properties[i+1], "property value is null"); map.put(properties[i], properties[i+1]); } return registerTraceToken(new TraceToken(map)); }</code><technical_language>This puts burden caller is a token set for current thread calling this method, avoid exception. is 1) this method a no-op if is trace token, 2) create a new trace token. caller safely call this worry blowing up</technical_language>

Target:
public static TraceTokenScope addTraceTokenProperties(String... properties) { TokenState tokenState = token.get(); if (tokenState == null) { return new TraceTokenScope(null); } Map<String, String> map = new LinkedHashMap<>(tokenState.getToken()); checkArgument((properties.length % 2) == 0, "odd number of elements in properties"); for (int i = 0; i < properties.length; i += 2) { requireNonNull(properties[i], "property key is null"); requireNonNull(properties[i+1], "property value is null"); map.put(properties[i], properties[i+1]); } return registerTraceToken(new TraceToken(map)); }
Source:
<code>public static RequestQueue newRequestQueue(Context context) { File cacheDir = new File(context.getCacheDir(), DEFAULT_CACHE_DIR); <START> cacheDir.mkdirs(); <END> String userAgent = "volley/0"; try { String packageName = context.getPackageName(); PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0); userAgent = packageName + "/" + info.versionCode; } catch (NameNotFoundException e) { } HttpStack stack; if (Build.VERSION.SDK_INT >= 9) { stack = new HurlStack(); } else { stack = new HttpClientStack(AndroidHttpClient.newInstance(userAgent)); } Network network = new BasicNetwork(stack); RequestQueue queue = new RequestQueue(new DiskBasedCache(cacheDir), network); queue.start(); return queue; }</code><technical_language>want do this in DiskBasedCache instead? If not, good throw DBC constructor silently fail</technical_language>

Target:
public static RequestQueue newRequestQueue(Context context) { File cacheDir = new File(context.getCacheDir(), DEFAULT_CACHE_DIR); String userAgent = "volley/0"; try { String packageName = context.getPackageName(); PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0); userAgent = packageName + "/" + info.versionCode; } catch (NameNotFoundException e) { } HttpStack stack; if (Build.VERSION.SDK_INT >= 9) { stack = new HurlStack(); } else { stack = new HttpClientStack(AndroidHttpClient.newInstance(userAgent)); } Network network = new BasicNetwork(stack); RequestQueue queue = new RequestQueue(new DiskBasedCache(cacheDir), network); queue.start(); return queue; }
Source:
<code>protected long download(T object, File outFile) throws IOException { try { openObjectFunction.open(object, outFile); } <START> catch (Exception e) { <END> throw new RuntimeException(e); } return outFile.length(); }</code><technical_language>here. checked exception is IOException propagated. Please catch types of exceptions. propagated anyway</technical_language>

Target:
protected long download(T object, File outFile) throws IOException { openObjectFunction.open(object, outFile); return outFile.length(); }
Source:
<code>public void testSnapshot() throws IOException { Admin admin = getConnection().getAdmin(); admin.createTable( new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(COLUMN_FAMILY))); <START> Map<String, Long> values = createTable(); <END> admin.snapshot(snapshotName, tableName); List<SnapshotDescription> snapshots = admin.listSnapshots(snapshotName); Assert.assertEquals(1, snapshots.size()); admin.cloneSnapshot(snapshotName, clonedTableName); validateClone(values); admin.close(); }</code><technical_language>populateTable()</technical_language>

Target:
public void testSnapshot() throws IOException { Admin admin = getConnection().getAdmin(); admin.createTable( new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(COLUMN_FAMILY))); Map<String, Long> values = createAndPopulateTable(); Assert.assertEquals(0, admin.listSnapshots(snapshotName).size()); admin.snapshot(snapshotName, tableName); Assert.assertEquals(1, admin.listSnapshots(snapshotName).size()); admin.cloneSnapshot(snapshotName, clonedTableName); validateClone(values); Assert.assertEquals(1, admin.listSnapshots(snapshotName).size()); admin.deleteSnapshot(snapshotName); Assert.assertEquals(0, admin.listSnapshots(snapshotName).size()); admin.close(); }
Source:
<code>public void checkEmptyFormGroupDisplay(){ Assert.assertEquals(testGroup.display(DisplayMode.Edit, new String[] { "phenotype", "negative_phenotype" }), ""); <START> Assert.assertEquals(testGroup.display(DisplayMode.View, new String[] { "phenotype", "negative_phenotype" }), ""); <END> }</code><technical_language>Format for assertions is Assert.assertSomthing(EXPECTED, ACTUAL). Change order</technical_language>

Target:
public void checkEmptyFormGroupDisplay(){ Assert.assertEquals("", testGroup.display(DisplayMode.Edit, new String[] { "phenotype", "negative_phenotype" })); Assert.assertEquals("", testGroup.display(DisplayMode.View, new String[] { "phenotype", "negative_phenotype" })); }
Source:
<code><START> protected void onSessionChange(String originalSessionId, HttpSession newSession, Authentication auth) { <END> String newId = newSession.getId(); if(migrateSessionAttributes) { applicationEventPublisher.publishEvent(new SessionMigrationEvent(auth, originalSessionId, newId)); } else { applicationEventPublisher.publishEvent(new SessionIdChangedEvent(auth, originalSessionId, newId)); } }</code><technical_language>I agree proposal awkward phrasing...I proposal mine</technical_language>

Target:
protected void onSessionChange(String originalSessionId, HttpSession newSession, Authentication auth) { if(applicationEventPublisher != null) { applicationEventPublisher.publishEvent(new SessionFixationProtectionMigrationEvent( auth, originalSessionId, newSession.getId(), migrateSessionAttributes )); } }
Source:
<code>public static synchronized SMSEventAdapter getSMSEventAdapter(Map<String, String> dynamicProperties) { if (smsAdapter == null) { <START> <END> OutputEventAdapterConfiguration configuration = new OutputEventAdapterConfiguration(); configuration.setName("smsNotification"); configuration.setType("sms"); configuration.setStaticProperties(dynamicProperties); configuration.setMessageFormat("text"); smsAdapter = new SMSEventAdapter(configuration, dynamicProperties); } try { smsAdapter.init(); } catch (OutputEventAdapterException e) { log.error("unable to initialize adapter"+ emailAdapter + e); } return smsAdapter; }</code><technical_language>Define properties string constants</technical_language>

Target:
public static synchronized SMSEventAdapter getSMSEventAdapter(Map<String, String> dynamicProperties) { if (smsAdapter == null) { smsAdapter = new SMSEventAdapter(null, dynamicProperties); } try { smsAdapter.init(); } catch (OutputEventAdapterException e) { log.error("Unable to initialize sms adapter.", e); } return smsAdapter; }
Source:
<code>private void startSubscription() { LOG.info("consumer {}, subscribes to ", this, topicPartitions2SSP.keySet()); try { synchronized (kafkaConsumer) { kafkaConsumer.assign(topicPartitions2SSP.keySet()); } } catch (Exception e) { <START> LOG.warn("startSubscription failed.", e); <END> throw new SamzaException(e); } }</code><technical_language>Log consumer id in exception message for context</technical_language>

Target:
private void startSubscription() { LOG.info("{}: Consumer subscribes to {}", this, topicPartitionsToSSP.keySet()); try { synchronized (kafkaConsumer) { kafkaConsumer.assign(topicPartitionsToSSP.keySet()); } } catch (Exception e) { throw new SamzaException("Consumer subscription failed for " + this, e); } }
Source:
<code>public T get() { if (bean != null) { return getBeanInstance(bean); } else if (isUnsatisfied()) { <START> throw BeanManagerLogger.LOG.injectionPointHasUnsatisfiedDependencies(ip, <END> Formats.formatAnnotations(ip.getQualifiers()), Formats.formatInjectionPointType(ip.getType()), Formats.formatAsStackTraceElement(ip), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ip, getBeanManager())); } else { throw BeanManagerLogger.LOG.injectionPointHasAmbiguousDependencies(ip, Formats.formatAnnotations(ip.getQualifiers()), Formats.formatInjectionPointType(ip.getType()), Formats.formatAsStackTraceElement(ip), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ip, getBeanManager())); } }</code><technical_language>Including ip.toString() in log message sense - a DynamicLookupInjectionPoint instance meaningful info</technical_language>

Target:
public T get() { if (bean != null) { return getBeanInstance(bean); } else if (isUnsatisfied()) { throw BeanManagerLogger.LOG.injectionPointHasUnsatisfiedDependencies( Formats.formatAnnotations(ip.getQualifiers()), Formats.formatInjectionPointType(ip.getType()), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ip, getBeanManager())); } else { throw BeanManagerLogger.LOG.injectionPointHasAmbiguousDependencies( Formats.formatAnnotations(ip.getQualifiers()), Formats.formatInjectionPointType(ip.getType()), WeldCollections.toMultiRowString(allBeans)); } }
Source:
<code>public boolean cancel(boolean mayInterruptIfRunning) { <START> set(null); <END> return true; }</code><technical_language>I concerned this changes behavior of future returned createNewListener a callback a null value. Instead, create a constant CancellationException setException(constant)? give benefit</technical_language>

Target:
public boolean cancel(boolean mayInterruptIfRunning) { if (canceled.compareAndSet(false, true)) { setException(EXCEPTION); return true; } return false; }
Source:
<code><START> public UnavailableSolrException(Throwable cause) { <END> super(ErrorCode.SERVICE_UNAVAILABLE, cause); }</code><technical_language>Is this constructor used? If not, remove force throwing this exception provide a message</technical_language>

Target:
public UnavailableSolrException(Throwable cause) { super(ErrorCode.SERVICE_UNAVAILABLE, cause.getMessage(), cause); }
Source:
<code>public static String concat(String... args) { <START> List<String> argList = Arrays.asList(args); <END> StringBuilder str = new StringBuilder(argList.stream().mapToInt(String::length).sum()); argList.forEach(str::append); return str.toString(); }</code><technical_language>String.join("", args)</technical_language>

Target:
public static String concat(String... args) { return String.join("", args); }
Source:
<code>private String getTabWithCondition( java.util.function.Predicate<? super Pair<String, String>> condition) { Optional<String> newTab = driver .getWindowHandles() .stream() .map(handleName -> Pair.of(handleName, driver.switchTo().window(handleName).getTitle())) .filter(condition) .map(Pair::getKey) .findFirst(); return newTab.orElseThrow(() -> new NotFoundException( <START> String.format("Tab with title %1$s doesn't exist", title))); <END> }</code><technical_language>this Tab title %s exist</technical_language>

Target:
private String getTabWithCondition( java.util.function.Predicate<? super Pair<String, String>> condition) { Optional<String> newTab = driver .getWindowHandles() .stream() .map(handleName -> Pair.of(handleName, driver.switchTo().window(handleName).getTitle())) .filter(condition) .map(Pair::getKey) .findFirst(); return newTab.orElseThrow(() -> new NotFoundException( String.format("Tab with title %s doesn't exist", title))); }
Source:
<code>public void registerConnectorUis() { registerFromExtensionPoint(); <START> registerConnetorToConnectorUi(); <END> registerFromAdaptable(); }</code><technical_language>move this 1 line remove call setConnectorForConnectorUi registerFromAdaptable</technical_language>

Target:
public void registerConnectorUis() { registerFromExtensionPoint(); registerFromAdaptable(); registerConnetorToConnectorUi(); }
Source:
<code>public void assertAll() { if (!m_errors.isEmpty()) { StringBuilder sb = new StringBuilder("The following asserts failed:"); boolean first = true; for (Map.Entry<AssertionError, IAssert<?>> ae : m_errors.entrySet()) { if (first) { first = false; } else { sb.append(","); } <START> sb.append("\n\t"); <END> AssertionError error = ae.getKey(); sb.append(error.getMessage()); Throwable cause = error.getCause(); if (cause != null) { sb.append(" ").append(cause.getMessage()); } } throw new AssertionError(sb.toString()); } }</code><technical_language>of ae map entry is used. sense simplify</technical_language>

Target:
public void assertAll() { if (!m_errors.isEmpty()) { StringBuilder sb = new StringBuilder("The following asserts failed:"); boolean first = true; for (AssertionError error : m_errors.keySet()) { if (first) { first = false; } else { sb.append(","); } sb.append("\n\t"); sb.append(error.getMessage()); Throwable cause = error.getCause(); while (cause != null) { sb.append(" ").append(cause.getMessage()); cause = cause.getCause(); } } throw new AssertionError(sb.toString()); } }
Source:
<code>public void onMessageReceived(ThingUID bridge, LIRCResponse response) { <START> <END> String command = response.getCommand(); if ("LIST".equals(command) && response.isSuccess()) { boolean found = false; for (String remote : response.getData()) { if (remoteName.equals(remote)) { found = true; } } if (found) { updateStatus(ThingStatus.ONLINE); } else { logger.error("Remote {}: Remote was removed from LIRC server.", remoteName); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); } } else if (!response.isSuccess()) { String error = response.getData()[0]; Matcher m = UNKNOWN_REMOTE_PATTERN.matcher(error); if (m.matches() && remoteName.equals(m.group(1))) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); } } }</code><technical_language>blank line</technical_language>

Target:
public void onMessageReceived(ThingUID bridge, LIRCResponse response) { String command = response.getCommand(); if ("LIST".equals(command) && response.isSuccess()) { boolean found = false; for (String remote : response.getData()) { if (remoteName.equals(remote)) { found = true; } } if (found) { updateStatus(ThingStatus.ONLINE); } else { logger.error("Remote {}: Remote was removed from LIRC server.", remoteName); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); } } else if (!response.isSuccess()) { String error = response.getData()[0]; Matcher m = UNKNOWN_REMOTE_PATTERN.matcher(error); if (m.matches() && remoteName.equals(m.group(1))) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Unknown remote"); } } }
Source:
<code>public CamusAvroWrapper(Record record) { <START> this(record, null, null); <END> }</code><technical_language>null for timestampfield timestampFormat, 'timestamp' 'unix_millesecond' default</technical_language>

Target:
public CamusAvroWrapper(Record record) { this(record, DEFAULT_TIMESTAMP_FIELD, UNIX_MILLISECONDS); }
Source:
<code>public static void compute(Wrapper wrapper) { new CalculateWrapPressureInterest().calculate(wrapper, null); new CalculateMultiplyWithContainerInterest().calculate(wrapper, null); new CalculateSizeInterest().calculate(wrapper, null); new CalculateNInterest().calculate(wrapper, null); <START> } <END></code><technical_language>al Calculate classes private method? Creating new everytime is a bit useless</technical_language>

Target:
public static void compute(Wrapper wrapper) { pressureInterest.calculate(wrapper, null); multiplyInterest.calculate(wrapper, null); sizeInterest.calculate(wrapper, null); nInterest.calculate(wrapper, null); }
Source:
<code>public void tearDown() { closeClient(this.client); try { testingServer.stop(); } catch (IOException e) { log.warn("Exception thrown while shutting down ZooKeeper: ", e); } testingServer.getTempDirectory().delete(); <START> } <END></code><technical_language>Is good create destroy server client for test-method</technical_language>

Target:
public void tearDown() throws Exception { CloseableUtils.closeQuietly(this.client); }
Source:
<code>private static void checkConnectTag(Bundle b) { List<String> namespaces = Arrays.asList(IdentityNamespace.IDENTITY_NAMESPACE, HostNamespace.HOST_NAMESPACE, BundleNamespace.BUNDLE_NAMESPACE); <START> namespaces.forEach(ns -> { <END> List<String> tags = (List<String>) b.adapt(BundleRevision.class) .getCapabilities(ns).stream().findFirst() .get().getAttributes().get(IdentityNamespace.CAPABILITY_TAGS_ATTRIBUTE); assertNotNull("No tags found.", tags); assertEquals("Wrong number of tags.", 1, tags.size()); assertTrue("Connect tag not found.", tags.contains(ConnectContent.TAG_OSGI_CONNECT)); }); }</code><technical_language>I recommend keeping single stream passing null for getCapabilities adding a filter stream remove namespaces contained in expected namespaces</technical_language>

Target:
private static void checkConnectTag(Bundle b) { final List<String> namespaces = new ArrayList<>(Arrays.asList(BundleNamespace.BUNDLE_NAMESPACE, HostNamespace.HOST_NAMESPACE, IdentityNamespace.IDENTITY_NAMESPACE)); final AtomicReference<List<String>> tags = new AtomicReference<>(); b.adapt(BundleRevision.class).getCapabilities(null).stream().filter(i -> namespaces.contains(i.getNamespace())).forEach(c -> { tags.set(((List<String>) c.getAttributes().get(IdentityNamespace.CAPABILITY_TAGS_ATTRIBUTE))); assertNotNull("No tags found.", tags.get()); assertEquals("Wrong number of tags.", 1, tags.get().size()); assertTrue("Connect tag not found.", tags.get().contains(ConnectContent.TAG_OSGI_CONNECT)); namespaces.remove(c.getNamespace()); }); assertTrue("Connect tag namespaces were not removed completely. Found " + namespaces, namespaces.isEmpty()); }
Source:
<code>private static boolean isBinaryFile(String fullPath) { byte[] firstBytes = new byte[8]; try (FileInputStream input = new FileInputStream(fullPath)) { input.read(firstBytes); } catch (IOException e) { <START> Activator.getDefault().logInfo("Cannot read the file "+fullPath+" due to "+e.getMessage()); END> } for (byte[] header : BINARY_HEADERS) { if (firstBytes.length >= header.length && startsWith(header, firstBytes)) { return true; } } return false; }</code><technical_language>logError(String, Throwable)</technical_language>

Target:
private static boolean isBinaryFile(String fullPath) { byte[] firstBytes = new byte[8]; try (FileInputStream input = new FileInputStream(fullPath)) { input.read(firstBytes); } catch (IOException e) { Activator.getDefault().logError("Cannot read the file "+fullPath+" due to ", e); } for (byte[] header : BINARY_HEADERS) { if (firstBytes.length >= header.length && startsWith(header, firstBytes)) { return true; } } return false; }
Source:
<code>public void close() { <START> synchronized (offsetReadFutures) { <END> closed.set(true); for (Future<Map<ByteBuffer, ByteBuffer>> offsetReadFuture : offsetReadFutures) { offsetReadFuture.cancel(true); } offsetReadFutures.clear(); } }</code><technical_language>check if this is closed, if simply return</technical_language>

Target:
public void close() { if (!closed.getAndSet(true)) { synchronized (offsetReadFutures) { for (Future<Map<ByteBuffer, ByteBuffer>> offsetReadFuture : offsetReadFutures) { try { offsetReadFuture.cancel(true); } catch (Throwable t) { log.error("Failed to cancel offset read future", t); } } offsetReadFutures.clear(); } } }
Source:
<code><START> public static void traceSignal(TmfSignal signal) { <END> System.out.println(signal.getSource().toString() + ": " + signal.toString()); }</code><technical_language>is this ok</technical_language>

Target:
public void traceSignal(TmfSignal signal) { System.out.println(signal.getSource().toString() + ": " + signal.toString()); }
Source:
<code>public Object[][] testSexDataProviderStr() { return new Object[][] { <START> new Object[]{Sex.Male, "M", true}, <END> new Object[]{Sex.Female, "Female", true}, new Object[]{Sex.Unknown, "Unknown", true}, new Object[]{Sex.NotReported, "NotReported", true}, new Object[]{Sex.Female, "M", false}, new Object[]{Sex.Unknown, "female", false} }; }</code><technical_language>test out cases full/short versions for</technical_language>

Target:
public Object[][] testSexDataProviderStr() { return new Object[][]{ {Sex.Female, "F"}, {Sex.Female, "f"}, {Sex.Female, "Female"}, {Sex.Female, "female"}, {Sex.Male, "M"}, {Sex.Male, "m"}, {Sex.Male, "Male"}, {Sex.Male, "male"}, {Sex.Unknown, "Unknown"}, {Sex.Unknown, "U"}, {Sex.Unknown, "unknown"}, {Sex.Unknown, "u"}, }; }
Source:
<code>public void testGcsLazyConfigurationEnabled() throws IOException, URISyntaxException { GoogleHadoopFileSystem testInstance = new GoogleHadoopFileSystem(); ghfs = testInstance; ghfsFileSystemDescriptor = testInstance; ghfsHelper = new HadoopFileSystemIntegrationHelper(ghfs, ghfsFileSystemDescriptor); Configuration conf = loadConfig(); <START> conf.set( <END> GoogleHadoopFileSystemConfiguration.GCS_LAZY_INITIALIZATION_ENABLE.getKey(), "true"); URI initUri = new URI("gs://" + ghfsHelper.getUniqueBucketName("init")); ghfs.initialize(initUri, conf); Path filePath = new Path("testfile"); ghfsHelper.writeFile(filePath, "test", 1, true); assertThat(ghfsHelper.readTextFile(filePath)).isEqualTo("test"); ghfsHelper.delete(initUri,true); }</code><technical_language>setBoolean() method</technical_language>

Target:
public void testGcsLazyConfigurationEnabled() throws IOException, URISyntaxException { GoogleHadoopFileSystem testInstance = new GoogleHadoopFileSystem(); ghfs = testInstance; ghfsFileSystemDescriptor = testInstance; ghfsHelper = new HadoopFileSystemIntegrationHelper(ghfs, ghfsFileSystemDescriptor); Configuration conf = loadConfig(); conf.setBoolean( GoogleHadoopFileSystemConfiguration.GCS_LAZY_INITIALIZATION_ENABLE.getKey(), true); URI initUri = new URI("gs://" + ghfsHelper.getUniqueBucketName("init")); ghfs.initialize(initUri, conf); Path filePath = new Path("testfile"); ghfsHelper.writeFile(filePath, "test", 1, true); assertThat(ghfsHelper.readTextFile(filePath)).isEqualTo("test"); ghfsHelper.delete(initUri, true); }
Source:
<code><START> public void clearParagraphRuntimeInfo(InterpreterSetting setting) { <END> Map<String, Set<String>> noteIdAndParaMap = setting.getNoteIdAndParaMap(); if (noteIdAndParaMap != null && !noteIdAndParaMap.isEmpty()) { for (String noteId : noteIdAndParaMap.keySet()) { Set<String> paraIdSet = noteIdAndParaMap.get(noteId); if (paraIdSet != null && !paraIdSet.isEmpty()) { for (String paraId : paraIdSet) { Note note = notebook().getNote(noteId); if (note != null) { Paragraph paragraph = note.getParagraph(paraId); if (paragraph != null) { paragraph.clearRuntimeInfo(); broadcast(noteId, new Message(OP.PARAGRAPH).put("paragraph", paragraph)); } } } } } } setting.clearNoteIdAndParaMap(); }</code><technical_language>I afraid this method some issues binding InterpreterSetting Note/Paragraph change. e.g. beginning I spark in p1, I flink in p1, method clear runtime info of p1 I restart spark interpreter</technical_language>

Target:
public void clearParagraphRuntimeInfo(InterpreterSetting setting) { Map<String, Set<String>> noteIdAndParaMap = setting.getNoteIdAndParaMap(); if (noteIdAndParaMap != null && !noteIdAndParaMap.isEmpty()) { for (String noteId : noteIdAndParaMap.keySet()) { Set<String> paraIdSet = noteIdAndParaMap.get(noteId); if (paraIdSet != null && !paraIdSet.isEmpty()) { for (String paraId : paraIdSet) { Note note = notebook().getNote(noteId); if (note != null) { Paragraph paragraph = note.getParagraph(paraId); if (paragraph != null) { paragraph.clearRuntimeInfo(setting.getId()); broadcast(noteId, new Message(OP.PARAGRAPH).put("paragraph", paragraph)); } } } } } } setting.clearNoteIdAndParaMap(); }
Source:
<code>private CalculatedDesiredPoolSize calculateDesiredPoolSize(long currentPoolSize) { long now = System.currentTimeMillis(); WindowSummary downsizeSummary = recentDesiredResizes.summarizeWindow(getResizeDownStabilizationDelay().toMilliseconds()); <START> WindowSummary upsizeSummary = recentDesiredResizes.summarizeWindow(getResizeUpStabilizationDelay().toMilliseconds()); <END> long maxDesiredPoolSize = upsizeSummary.min; boolean stableForGrowing = upsizeSummary.stableForGrowth; long minDesiredPoolSize = downsizeSummary.max; boolean stableForShrinking = downsizeSummary.stableForShrinking; long desiredPoolSize; boolean stable; if (currentPoolSize < maxDesiredPoolSize) { desiredPoolSize = maxDesiredPoolSize; stable = stableForGrowing; } else if (currentPoolSize > minDesiredPoolSize) { desiredPoolSize = minDesiredPoolSize; stable = stableForShrinking; } else { desiredPoolSize = currentPoolSize; stable = stableForGrowing && stableForShrinking; } if (LOG.isTraceEnabled()) LOG.trace("{} calculated desired pool size: from to {}; minDesired {}, maxDesired {}; " + "stable {}; now {}; downsizeHistory {}; upsizeHistory {}", new Object[] {this, currentPoolSize, desiredPoolSize, minDesiredPoolSize, maxDesiredPoolSize, stable, now, downsizeSummary, upsizeSummary}); return new CalculatedDesiredPoolSize(desiredPoolSize, stable); }</code><technical_language>WindowSummary methods updated Duration params? a blocker now</technical_language>

Target:
private CalculatedDesiredPoolSize calculateDesiredPoolSize(long currentPoolSize) { long now = System.currentTimeMillis(); WindowSummary downsizeSummary = recentDesiredResizes.summarizeWindow(getResizeDownStabilizationDelay()); WindowSummary upsizeSummary = recentDesiredResizes.summarizeWindow(getResizeUpStabilizationDelay()); long maxDesiredPoolSize = upsizeSummary.min; boolean stableForGrowing = upsizeSummary.stableForGrowth; long minDesiredPoolSize = downsizeSummary.max; boolean stableForShrinking = downsizeSummary.stableForShrinking; long desiredPoolSize; boolean stable; if (currentPoolSize < maxDesiredPoolSize) { desiredPoolSize = maxDesiredPoolSize; stable = stableForGrowing; } else if (currentPoolSize > minDesiredPoolSize) { desiredPoolSize = minDesiredPoolSize; stable = stableForShrinking; } else { desiredPoolSize = currentPoolSize; stable = stableForGrowing && stableForShrinking; } if (LOG.isTraceEnabled()) LOG.trace("{} calculated desired pool size: from to {}; minDesired {}, maxDesired {}; " + "stable {}; now {}; downsizeHistory {}; upsizeHistory {}", new Object[] {this, currentPoolSize, desiredPoolSize, minDesiredPoolSize, maxDesiredPoolSize, stable, now, downsizeSummary, upsizeSummary}); return new CalculatedDesiredPoolSize(desiredPoolSize, stable); }
Source:
<code>private void appendSASTokenToQuery(String path, String operation, AbfsUriQueryBuilder queryBuilder) throws SASTokenProviderException { try { <START> LOG.trace("Fetch SAS token for {}", path); <END> String sasToken = sasTokenProvider.getSASToken(this.accountName, this.filesystem, path, operation); queryBuilder.setSASToken(sasToken); LOG.trace("SAS token fetch complete for {}", path); } catch (Exception ex) { throw new SASTokenProviderException("Failed to acquire a SAS token.", ex); } }</code><technical_language>add operation traces; handy in production</technical_language>

Target:
private void appendSASTokenToQuery(String path, String operation, AbfsUriQueryBuilder queryBuilder) throws SASTokenProviderException { if (this.authType == AuthType.SAS) { try { LOG.trace("Fetch SAS token for on {}", operation, path); String sasToken = sasTokenProvider.getSASToken(this.accountName, this.filesystem, path, operation); if ((sasToken == null) || sasToken.isEmpty()) { throw new UnsupportedOperationException("SASToken received is empty or null"); } queryBuilder.setSASToken(sasToken); LOG.trace("SAS token fetch complete for on {}", operation, path); } catch (Exception ex) { throw new SASTokenProviderException(String.format("Failed to acquire a SAS token for %s on %s due to %s", operation, path, ex.toString())); } } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_motion_tracking); Intent intent = getIntent(); <START> mIsAutoReset = intent.getBooleanExtra("com.projecttango.motiontrackingjava.useautoreset", false); <END> mPose = (TextView) findViewById(R.id.pose); mQuat = (TextView) findViewById(R.id.quat); mPoseCount =(TextView) findViewById(R.id.posecount); mDelta =(TextView) findViewById(R.id.deltatime); mTangoEvent =(TextView) findViewById(R.id.tangoevent); mFirstPersonButton = (Button) findViewById(R.id.first_person_button); mThirdPersonButton = (Button) findViewById(R.id.third_person_button); mTopDownButton = (Button) findViewById(R.id.top_down_button); mMotionReset = (Button) findViewById(R.id.resetmotion); mPoseStatus = (TextView) findViewById(R.id.status); mVersion = (TextView) findViewById(R.id.version); mGLView = (GLSurfaceView) findViewById(R.id.gl_surface_view); mMotionReset.setOnClickListener(this); mFirstPersonButton.setOnClickListener(this); mThirdPersonButton.setOnClickListener(this); mTopDownButton.setOnClickListener(this); mRenderer = new MTGLRenderer(); mGLView.setEGLContextClientVersion(2); mGLView.setRenderer(mRenderer); mGLView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); mMotionReset.setVisibility(View.GONE); mTango = new Tango(this); startMotionTracking(); }</code><technical_language>This key string a public static member of some class, of Start.java. named KEY_MOTIONTRACKING_AUTORESET</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_motion_tracking); Intent intent = getIntent(); mIsAutoReset = intent.getBooleanExtra(StartActivity.KEY_MOTIONTRACKING_AUTORESET, false); mPose = (TextView) findViewById(R.id.pose); mQuat = (TextView) findViewById(R.id.quat); mPoseCount =(TextView) findViewById(R.id.posecount); mDelta =(TextView) findViewById(R.id.deltatime); mTangoEvent =(TextView) findViewById(R.id.tangoevent); findViewById(R.id.first_person_button).setOnClickListener(this); findViewById(R.id.third_person_button).setOnClickListener(this); findViewById(R.id.top_down_button).setOnClickListener(this); mMotionReset = (Button) findViewById(R.id.resetmotion); mPoseStatus = (TextView) findViewById(R.id.status); mVersion = (TextView) findViewById(R.id.version); mGLView = (GLSurfaceView) findViewById(R.id.gl_surface_view); mMotionReset.setOnClickListener(this); mRenderer = new MTGLRenderer(); mGLView.setEGLContextClientVersion(2); mGLView.setRenderer(mRenderer); mGLView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); mMotionReset.setVisibility(View.GONE); mTango = new Tango(this); startMotionTracking(); }
Source:
<code>public void testGetQuestionDetails() { FeedbackQuestionAttributes fq = new FeedbackQuestionAttributes(); ______TS("Text question: new Json format"); fq.feedbackSessionName = "First Feedback Session"; fq.courseId = "CS1101"; fq.creatorEmail = "instructor1@course1.com"; fq.questionType = FeedbackQuestionType.TEXT; fq.giverType = FeedbackParticipantType.NONE; fq.recipientType = FeedbackParticipantType.RECEIVER; fq.showGiverNameTo = new ArrayList<FeedbackParticipantType>(); fq.showGiverNameTo.add(FeedbackParticipantType.SELF); fq.showRecipientNameTo = new ArrayList<FeedbackParticipantType>(); fq.showRecipientNameTo.add(FeedbackParticipantType.SELF); fq.showResponsesTo = new ArrayList<FeedbackParticipantType>(); fq.showResponsesTo.add(FeedbackParticipantType.SELF); fq.giverType = FeedbackParticipantType.TEAMS; fq.recipientType = FeedbackParticipantType.TEAMS; fq.showGiverNameTo = new ArrayList<FeedbackParticipantType>(); fq.showGiverNameTo.add(FeedbackParticipantType.RECEIVER); fq.showRecipientNameTo = new ArrayList<FeedbackParticipantType>(); fq.showRecipientNameTo.add(FeedbackParticipantType.RECEIVER); fq.showResponsesTo = new ArrayList<FeedbackParticipantType>(); <START> fq.showResponsesTo.add(FeedbackParticipantType.RECEIVER); <END> FeedbackTextQuestionDetails questionDetails = new FeedbackTextQuestionDetails("New format text question"); fq.setQuestionDetails(questionDetails); assertTrue(fq.isValid()); assertEquals(fq.getQuestionDetails().getQuestionText(), "New format text question"); ______TS("Text question: old string format"); fq = typicalBundle.feedbackQuestions.get("qn2InSession1InCourse1"); assertEquals(fq.getQuestionDetails().getQuestionText(), "Rate 1 other student's product"); }</code><technical_language>Instead of assigning attributes manually, add a sample text question typicalDataBundle.json new questionMetaData format question perform assertion</technical_language>

Target:
public void testGetQuestionDetails() { ______TS("Text question: new Json format"); FeedbackQuestionAttributes fq = typicalBundle.feedbackQuestions.get("qn5InSession1InCourse1"); FeedbackTextQuestionDetails questionDetails = new FeedbackTextQuestionDetails("New format text question"); fq.setQuestionDetails(questionDetails); assertTrue(fq.isValid()); assertEquals(fq.getQuestionDetails().getQuestionText(), "New format text question"); ______TS("Text question: old string format"); fq = typicalBundle.feedbackQuestions.get("qn2InSession1InCourse1"); assertEquals(fq.getQuestionDetails().getQuestionText(), "Rate 1 other student's product"); }
Source:
<code>public final void testValidate() { SqliteTableSchemaValidator validator = new SqliteTableSchemaValidator(); TableInfo metaData = mock(TableInfo.class); assertNotNull(validator); Table<TestObject> table = mock(Table.class); Mockito.when(table.getTableInfo()).thenReturn(metaData); try { assertEquals(true, validator.validate(table)); } catch (ValidationException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>eat exceptions in tests expect exception in case need pattern try { fail(....) } catch { assert e.getMessage }</technical_language>

Target:
public final void testValidate() { SqliteTableSchemaValidator validator = new SqliteTableSchemaValidator(); TableInfo metaData = mock(TableInfo.class); assertNotNull(validator); Table<TestObject> table = mock(Table.class); Mockito.when(table.getTableInfo()).thenReturn(metaData); try { assertTrue(validator.validate(table)); } catch (ValidationException e) { fail("Validation should not fail"); } }
Source:
<code>public static <T> Lazy<Seq<T>> sequence(Iterable<? extends Lazy<? extends T>> values) { Objects.requireNonNull(values, "values is null"); <START> return Lazy.of(() -> List.ofAll(values).map(l -> l.get())); <END> }</code><technical_language>do error (please Travis log pull locally) a simplification (e.g. Character constructor), advantage of Java 9's wisdom. true</technical_language>

Target:
public static <T> Lazy<Seq<T>> sequence(Iterable<? extends Lazy<? extends T>> values) { Objects.requireNonNull(values, "values is null"); return Lazy.of(() -> Vector.ofAll(values).map(Lazy::get)); }
Source:
<code>public static String convertSmpToHtmlEntity(String text) { <START> StringBuffer sb = new StringBuffer(); <END> Matcher m = Pattern.compile("([^\u0000-\uFFFF])").matcher(text); while (m.find()) { String a = "&#x" + Integer.toHexString(m.group(1).codePointAt(0)) + ";"; m.appendReplacement(sb, Matcher.quoteReplacement(a)); } m.appendTail(sb); return sb.toString(); }</code><technical_language>git blame / history this - I thought I read this. I if is a problem anymore? I mean, AnkiDroid started API1, WebView is Chrome, so...could this deleted sunsetted a Compat implementation API cutoff (and API number access current Chrome WebView okay, if this a historical thing)</technical_language>

Target:
public static String convertSmpToHtmlEntity(String text) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return text; } StringBuffer sb = new StringBuffer(); Matcher m = Pattern.compile("([^\u0000-\uFFFF])").matcher(text); while (m.find()) { String a = "&#x" + Integer.toHexString(m.group(1).codePointAt(0)) + ";"; m.appendReplacement(sb, Matcher.quoteReplacement(a)); } m.appendTail(sb); return sb.toString(); }
Source:
<code>public boolean isWrapperFor(Class<?> iface) { if (gridCoverage instanceof Wrapper) return ((Wrapper) gridCoverage).isWrapperFor(iface); <START> else if (iface.isInstance(gridCoverage)) return true; <END> else return false; }</code><technical_language>I woudl remove this else, if gridCoverage is a wrapper "false" iface is "GridCoverage2D" want fall isInstance check anyways</technical_language>

Target:
public boolean isWrapperFor(Class<?> iface) { if (gridCoverage instanceof Wrapper) { return ((Wrapper) gridCoverage).isWrapperFor(iface); } return iface.isInstance(gridCoverage); }
Source:
<code>public void downloadExists(URL url, File file) { <START> if (observer == null) <END> return; observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file)); checkIfComplete(); }</code><technical_language>braces refactorings, please</technical_language>

Target:
public void downloadExists(URL url, File file) { if (observer == null) { return; } observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file)); checkIfComplete(); }
Source:
<code>protected String maskSensitiveElements(final Message message, String originalLogString) { <START> return (new MaskSensitiveHelper(sensitiveElementNames)) <END> .maskSensitiveElements(message, originalLogString); }</code><technical_language>MaskSensitiveHelper is thread-safe, more performant create sensitiveElementNames set</technical_language>

Target:
protected String maskSensitiveElements(final Message message, String originalLogString) { return maskSensitiveHelper.maskSensitiveElements(message, originalLogString); }
Source:
<code>public OwaspDiffRunner(Runtime runTime, Invoker invoker) { <START> setRuntime(runTime); <END> setInvoker(invoker); }</code><technical_language>returned squid:S2209 suppressed. justification is this ctor is for unit test</technical_language>

Target:
OwaspDiffRunner(Runtime runTime, Invoker invoker) { this.runTime = runTime; this.invoker = invoker; }
Source:
<code>public void addBuilder(IBuildConfiguration config, IncrementalProjectBuilder newBuilder) { synchronized (builderLock) { IncrementalProjectBuilder <START> currentBuilder = <END> builders == null ? null : builders.get(config); if (currentBuilder == null && builder == null) { if (supportsConfigs()) { if (builders == null) builders = new HashMap<>(1); builders.put(config, newBuilder); } else builder = newBuilder; } } }</code><technical_language>a problem of current patch, code: variable name is misleading. "builder" field "builders config", "currentBuilder" match I name "configBuilder"</technical_language>

Target:
public void addBuilder(IBuildConfiguration config, IncrementalProjectBuilder newBuilder) { synchronized (builderLock) { IncrementalProjectBuilder configBuilder = builders == null ? null : builders.get(config); if (configBuilder == null && builder == null) { if (supportsConfigs()) { if (builders == null) builders = new HashMap<>(1); builders.put(config, newBuilder); } else builder = newBuilder; } } }