auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int getHeight() { int height = 0; try { <START> height = ImageUtil.getInstance().getDimension(getFile()).height; <END> } catch(Exception e) { Logger.error(this, e.getMessage()); } return height; }</code><technical_language>Rogelio's suggestion applies well: > I modify code a call time ImageUtil.getInstance().getDimension(getFileAsset()) store dimension in a private variable, load file get height width in instance. > check if dimension is null get proper</technical_language>

Target:
public int getHeight() { try { if (fileDimension.height == 0) { fileDimension = ImageUtil.getInstance().getDimension(getFile()); } } catch (Exception e) { Logger.error(this, e.getMessage()); } return fileDimension.height; }
Source:
<code>protected static boolean shouldAlertUpgrade(ArrayList<RpmVersion> isos, String[] hostOs) { boolean alert = false; String[] hostOsVersionParts = hostOs[1].split("\\."); <START> for (int counter = 0; counter < 4 - hostOsVersionParts.length; counter++) { <END> hostOs[1] = hostOs[1] + ".0"; } Version hostVersion = new Version(hostOs[1].trim()); String releaseHost = hostOs[2].trim(); for (RpmVersion iso : isos) { if (hostVersion.getMajor() == iso.getMajor()) { if (iso.getMinor() > hostVersion.getMinor() || iso.getBuild() > hostVersion.getBuild()) { alert = true; break; } String rpmFromIso = iso.getRpmName(); int isoIndex = rpmFromIso.indexOf(".iso"); if (isoIndex != -1) { rpmFromIso = iso.getRpmName().substring(0, isoIndex); } if (RpmVersionUtils.compareRpmPart(RpmVersionUtils.splitRpmToParts(rpmFromIso)[2], releaseHost) > 0) { alert = true; break; } } } return alert; }</code><technical_language>4 constant, i surrender in brackets , a s for (int i; i < (4-len); i++) hope len larger 4.. screwed .</technical_language>

Target:
protected static boolean shouldAlertUpgrade(ArrayList<RpmVersion> isos, String[] hostOs) { final int VERSION_FIELDS_NUMBER = 4; boolean alert = false; String[] hostOsVersionParts = hostOs[1].split("\\."); for (int counter = 0; counter < VERSION_FIELDS_NUMBER - hostOsVersionParts.length; counter++) { hostOs[1] = hostOs[1].trim() + ".0"; } Version hostVersion = new Version(hostOs[1].trim()); String releaseHost = hostOs[2].trim(); for (RpmVersion iso : isos) { if (hostVersion.getMajor() == iso.getMajor()) { if (iso.getMinor() > hostVersion.getMinor() || iso.getBuild() > hostVersion.getBuild()) { alert = true; break; } String rpmFromIso = iso.getRpmName(); int isoIndex = rpmFromIso.indexOf(".iso"); if (isoIndex != -1) { rpmFromIso = iso.getRpmName().substring(0, isoIndex); } if (RpmVersionUtils.compareRpmParts(RpmVersionUtils.splitRpmToParts(rpmFromIso)[2], releaseHost) > 0) { alert = true; break; } } } return alert; }
Source:
<code>public SingleOutputStreamOperator<T> assignTimestampsAndWatermarks( AssignerWithPeriodicWatermarks<T> timestampAndWatermarkAssigner) { final int inputParallelism = getTransformation().getParallelism(); final AssignerWithPeriodicWatermarks<T> cleanedAssigner = clean(timestampAndWatermarkAssigner); final WatermarkStrategy<T> wms = new AssignerWithPeriodicWatermarksAdapter.Strategy<>(cleanedAssigner); <START> final TimestampsAndWatermarksOperator<T> operator = new TimestampsAndWatermarksOperator<>(wms); <END> return transform("Timestamps/Watermarks", getTransformation().getOutputType(), operator) .setParallelism(inputParallelism); }</code><technical_language>redirect deprecated method? downside is closure cleaner applied AssignerWithPeriodicWatermarksAdapter.Strateg I fine</technical_language>

Target:
public SingleOutputStreamOperator<T> assignTimestampsAndWatermarks( AssignerWithPeriodicWatermarks<T> timestampAndWatermarkAssigner) { final AssignerWithPeriodicWatermarks<T> cleanedAssigner = clean(timestampAndWatermarkAssigner); final WatermarkStrategy<T> wms = new AssignerWithPeriodicWatermarksAdapter.Strategy<>(cleanedAssigner); return assignTimestampsAndWatermarks(wms); }
Source:
<code>public void testNullSerializer() throws Exception { defaultInboundGateway.setSerializer(null); defaultInboundGateway.start(); try { sendChannel.send(new GenericMessage<String>("test1")); } catch(Exception e) { assertTrue(e.getMessage().contains("No reply produced")); } <START> defaultInboundGateway.stop(); <END> }</code><technical_language>is reason of start/stop in tests, if auto-startup="false" in config</technical_language>

Target:
public void testNullSerializer() throws Exception { defaultInboundGateway.setSerializer(null); try { sendChannel.send(new GenericMessage<String>("test1")); } catch(Exception e) { assertTrue(e.getMessage().contains("No reply produced")); } finally { defaultInboundGateway.setSerializer(new StringRedisSerializer()); } }
Source:
<code>public Object nextRecord(Object reuse) throws IOException { @SuppressWarnings("unchecked") IndexedRecord r = (IndexedRecord) super.nextRecord(record); <START> GenericRowData row = AvroRowDataDeserializationSchema.convertAvroRecordToRowData( <END> schema, formatRowType, r); for (int i = 0; i < selectFieldToFormatField.length; i++) { rowData.setField(selectFieldToProjectField[i], row.getField(selectFieldToFormatField[i])); } emitted++; return rowData; }</code><technical_language>need deal null here: if (r == null) { return null; }</technical_language>

Target:
public Object nextRecord(Object reuse) throws IOException { @SuppressWarnings("unchecked") IndexedRecord r = (IndexedRecord) super.nextRecord(record); if (r == null) { return null; } GenericRowData row = (GenericRowData) converter.convert(r); for (int i = 0; i < selectFieldToFormatField.length; i++) { rowData.setField(selectFieldToProjectField[i], row.getField(selectFieldToFormatField[i])); } emitted++; return rowData; }
Source:
<code>private String formatMonth(int count, int value, int maxIntCount, StringBuffer buffer, boolean useDateFormatSymbols, boolean standalone, int field, int style) { String current = null; if (useDateFormatSymbols) { final String[] months; if (count == 4) { months = standalone ? formatData.getStandAloneMonths() : formatData.getMonths(); } else if (count == 5) { months = standalone ? formatData.getTinyStandAloneMonths() : formatData.getTinyMonths(); } else if (count == 3) { months = standalone ? formatData.getShortStandAloneMonths() : formatData.getShortMonths(); } else { months = null; } if (months != null) { current = months[value]; } } else { if (count < 3) { current = null; } else { <START> if (standalone) { style |= 0x8000; } <END> current = calendar.getDisplayName(field, style, locale); } } if (current == null) { zeroPaddingNumber(value+1, count, maxIntCount, buffer); } return current; }</code><technical_language>sounds dangerous duplicate here. turn Calendar.toStandaloneStyle(int) a public method (but mark @hide part of SDK)</technical_language>

Target:
private String formatMonth(int count, int value, int maxIntCount, StringBuffer buffer, boolean useDateFormatSymbols, boolean standalone, int field, int style) { String current = null; if (useDateFormatSymbols) { final String[] months; if (count == 4) { months = standalone ? formatData.getStandAloneMonths() : formatData.getMonths(); } else if (count == 5) { months = standalone ? formatData.getTinyStandAloneMonths() : formatData.getTinyMonths(); } else if (count == 3) { months = standalone ? formatData.getShortStandAloneMonths() : formatData.getShortMonths(); } else { months = null; } if (months != null) { current = months[value]; } } else { if (count < 3) { current = null; } else { if (standalone) { style = Calendar.toStandaloneStyle(style); } current = calendar.getDisplayName(field, style, locale); } } if (current == null) { zeroPaddingNumber(value+1, count, maxIntCount, buffer); } return current; }
Source:
<code>public static <E> void forwardToRss(String title, String url, Collection<? extends E> entries, FeedAdapter<E> adapter, StaplerRequest req, HttpServletResponse rsp) throws IOException, ServletException { req.setAttribute("adapter",adapter); <START> String fixedTitle = title; String brokenFragment = "All all "; if (title.startsWith(brokenFragment)) { StringBuilder fixing = new StringBuilder("All "); fixing.append(title.substring(brokenFragment.length())); fixedTitle = fixing.toString(); } req.setAttribute("title",fixedTitle); <END> req.setAttribute("url",url); req.setAttribute("entries",entries); String flavor = req.getParameter("flavor"); if(flavor==null) flavor="atom"; flavor = flavor.replace('/', '_'); if (flavor.equals("atom")) { rsp.setContentType("application/atom+xml; charset=UTF-8"); } else { rsp.setContentType("text/xml; charset=UTF-8"); } req.getView(Jenkins.get(),"/hudson/"+flavor+".jelly").forward(req,rsp); }</code><technical_language>Fix broken "All ..." title a bug default view is called "All", code adds "all builds" option chosen for RSS (compared "failed builds"). I improvement, if desired. "if desired" => correcting behavior here, hiding symptom. For example, in french, default view is called "Tous" (= in english), RSS title description: "Tous builds". ~Perhaps a "better" change this is put a ":", All: builds.~ thoughts: rssHeader.jelly, I convinced need change behavior, in proposed</technical_language>

Target:
public static <E> void forwardToRss(String title, String url, Collection<? extends E> entries, FeedAdapter<E> adapter, StaplerRequest req, HttpServletResponse rsp) throws IOException, ServletException { req.setAttribute("adapter",adapter); req.setAttribute("title",title); req.setAttribute("url",url); req.setAttribute("entries",entries); String flavor = req.getParameter("flavor"); if(flavor==null) flavor="atom"; flavor = flavor.replace('/', '_'); if (flavor.equals("atom")) { rsp.setContentType("application/atom+xml; charset=UTF-8"); } else { rsp.setContentType("text/xml; charset=UTF-8"); } req.getView(Jenkins.get(),"/hudson/"+flavor+".jelly").forward(req,rsp); }
Source:
<code>public static String getAssignedDomain(String hostname, boolean strict, boolean excludePrivate) { hostname = hostname.toLowerCase(Locale.ROOT); SuffixTrie.LookupResult<EffectiveTLD> res = findEffectiveTLD(hostname, excludePrivate); if (res == null) { return (strict ? null : hostname); } EffectiveTLD etld = res.value; if (etld.isException()) { return etld.domain; } if (res.offset == 0) { return (strict ? null : hostname); } int etldStartPos = res.offset - 1; if (hostname.charAt(etldStartPos) != DOT) { <START> return (strict ? null : hostname); <END> } int start = 0; int pos; while ((pos = hostname.indexOf(DOT, start)) != -1) { if (pos == start) { return (strict ? null : hostname); } if (pos >= etldStartPos) break; start = pos + 1; } return hostname.substring(start); }</code><technical_language>debug logging helpful here, especially for non-strict case</technical_language>

Target:
public static String getAssignedDomain(String hostname, boolean strict, boolean excludePrivate) { hostname = hostname.toLowerCase(Locale.ROOT); SuffixTrie.LookupResult<EffectiveTLD> res = findEffectiveTLD(hostname, excludePrivate); if (res == null) { return (strict ? null : hostname); } EffectiveTLD etld = res.value; if (etld.isException()) { return etld.domain; } if (res.offset == 0) { return (strict ? null : hostname); } int etldStartPos = res.offset - 1; if (hostname.charAt(etldStartPos) != DOT) { LOGGER.debug("No dot before eTLD in {}", hostname.substring(res.offset), hostname); return (strict ? null : hostname); } int start = 0; int pos; while ((pos = hostname.indexOf(DOT, start)) != -1) { if (pos == start) { LOGGER.debug("Two immediately consecutive dots in hostname: {}", hostname); return (strict ? null : hostname); } if (pos >= etldStartPos) break; start = pos + 1; } return hostname.substring(start); }
Source:
<code>public AsyncFuture<Void> configure() { final IndicesAdminClient indices = client.getClient().admin().indices(); final List<AsyncFuture<AcknowledgedResponse>> writes = new ArrayList<>(); for (final Map.Entry<String, Map<String, Object>> mapping : type.getMappings().entrySet()) { final String indexType = mapping.getKey(); final String templateWithType = templateName + "-" + indexType; final String pattern = index.template().replaceAll("\\*", indexType + "-*"); log.info("[{}] updating template for {}", templateWithType, pattern); Map<String, Object> settings = new HashMap<>(); settings.put("index", index.settings()); final PutIndexTemplateRequestBuilder put = indices.preparePutTemplate(templateWithType) <START> .setSettings(settings) <END> .setPatterns(List.of(pattern)) .addMapping(mapping.getKey(), mapping.getValue()); final ResolvableFuture<AcknowledgedResponse> future = async.future(); writes.add(future); put.execute(new ActionListener<>() { @Override public void onResponse(AcknowledgedResponse response) { if (!response.isAcknowledged()) { future.fail(new Exception("request not acknowledged")); return; } future.resolve(null); } @Override public void onFailure(Exception e) { future.fail(e); } }); } return async.collectAndDiscard(writes); }</code><technical_language>config settings need merged type.getSettings i believe</technical_language>

Target:
public AsyncFuture<Void> configure() { final IndicesAdminClient indices = client.getClient().admin().indices(); final List<AsyncFuture<AcknowledgedResponse>> writes = new ArrayList<>(); for (final Map.Entry<String, Map<String, Object>> mapping : type.getMappings().entrySet()) { final String indexType = mapping.getKey(); final String templateWithType = templateName + "-" + indexType; final String pattern = index.getTemplate().replaceAll("\\*", indexType + "-*"); log.info("[{}] updating template for {}", templateWithType, pattern); Map<String, Object> settings = new HashMap<>(type.getSettings()); settings.put("index", index.getSettings()); final PutIndexTemplateRequestBuilder put = indices.preparePutTemplate(templateWithType) .setSettings(settings) .setPatterns(List.of(pattern)) .addMapping(mapping.getKey(), mapping.getValue()); final ResolvableFuture<AcknowledgedResponse> future = async.future(); writes.add(future); put.execute(new ActionListener<>() { @Override public void onResponse(AcknowledgedResponse response) { if (!response.isAcknowledged()) { future.fail(new Exception("request not acknowledged")); return; } future.resolve(null); } @Override public void onFailure(Exception e) { future.fail(e); } }); } return async.collectAndDiscard(writes); }
Source:
<code>public String generateTicket(String data) throws NoSuchAlgorithmException, SignatureException, InvalidKeyException { Base64 base64 = new Base64(0); Map<String, String> map = new HashMap<String, String>(); byte[] random = new byte[8]; new Random().nextBytes(random); map.put("salt", base64.encodeToString(random)); map.put( "time", new SimpleDateFormat("yyyyMMddHHmmss").format( Calendar.getInstance( TimeZone.getTimeZone("UTC") ).getTime() ) <START> ); <END> map.put("data", data); Signature signature = Signature.getInstance("SHA1withRSA"); signature.initSign(_key); StringBuilder fields = new StringBuilder(); for (Map.Entry<String, String> entry : map.entrySet()) { if (fields.length() > 0) { fields.append(","); } fields.append(entry.getKey()); signature.update(entry.getValue().getBytes(Charset.forName("UTF-8"))); } map.put("signedFields", fields.toString()); map.put("signature", base64.encodeToString(signature.sign())); StringBuilder ret = new StringBuilder(); ret.append("{"); boolean first = true; for (Map.Entry<String, String> entry : map.entrySet()) { if (first) { first = false; } else { ret.append(","); } ret.append(String.format("\"%s\":\"%s\"", entry.getKey(), entry.getValue())); } ret.append("}"); return base64.encodeToString(ret.toString().getBytes(Charset.forName("UTF-8"))); }</code><technical_language>I a mistake here... date out in local time. be: SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); df.setTimeZone(TimeZone.getTimeZone("UTC")); map.put( "time", df.format(new Date()) );</technical_language>

Target:
public String generateTicket(String data) throws NoSuchAlgorithmException, SignatureException, InvalidKeyException { Base64 base64 = new Base64(0); Map<String, String> map = new HashMap<String, String>(); byte[] random = new byte[8]; new Random().nextBytes(random); map.put("salt", base64.encodeToString(random)); SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); df.setTimeZone(TimeZone.getTimeZone("UTC")); map.put( "validFrom", df.format(new Date()) ); Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); cal.add(Calendar.SECOND, lifetime); map.put( "validTo", df.format(cal.getTime()) ); map.put("data", data); Signature signature = Signature.getInstance("SHA1withRSA"); signature.initSign(key); StringBuilder fields = new StringBuilder(); for (Map.Entry<String, String> entry : map.entrySet()) { if (fields.length() > 0) { fields.append(","); } fields.append(entry.getKey()); signature.update(entry.getValue().getBytes(Charset.forName("UTF-8"))); } map.put("signedFields", fields.toString()); map.put("signature", base64.encodeToString(signature.sign())); StringBuilder ret = new StringBuilder(); ret.append("{"); boolean first = true; for (Map.Entry<String, String> entry : map.entrySet()) { if (first) { first = false; } else { ret.append(","); } ret.append(String.format("\"%s\":\"%s\"", entry.getKey(), entry.getValue())); } ret.append("}"); return base64.encodeToString(ret.toString().getBytes(Charset.forName("UTF-8"))); }
Source:
<code>public void init() { Font.loadFont(FafClientApplication.class.getResourceAsStream("/font/dfc-icons.ttf"), 10); JavaFxUtil.fixTooltipDuration(); CountDownLatch runAndWaitLatch = new CountDownLatch(1); Runnable initRunnable = () -> { applicationContext = new SpringApplicationBuilder(FafClientApplication.class) .profiles(getAdditionalProfiles()) .bannerMode(Mode.OFF) .run(getParameters().getRaw().toArray(new String[0])); runAndWaitLatch.countDown(); }; if (!Platform.isFxApplicationThread()) { Platform.runLater(initRunnable); } else { initRunnable.run(); <START> } <END> noCatch((NoCatchRunnable) runAndWaitLatch::await); }</code><technical_language>check JavaFxUtil.runLater()</technical_language>

Target:
public void init() { Font.loadFont(FafClientApplication.class.getResourceAsStream("/font/dfc-icons.ttf"), 10); JavaFxUtil.fixTooltipDuration(); applicationContext = new SpringApplicationBuilder(FafClientApplication.class) .profiles(getAdditionalProfiles()) .bannerMode(Mode.OFF) .run(getParameters().getRaw().toArray(new String[0])); }
Source:
<code>public void invalidate(@Nullable String path) { if (path == null) { <START> return; <END> } invalidate(Uri.parse(path)); }</code><technical_language>Flip if move invalidate call</technical_language>

Target:
public void invalidate(@Nullable String path) { if (path != null) { invalidate(Uri.parse(path)); } }
Source:
<code>public CompletableFuture<Void> downloadAndInstallMod(String uid) { return fafService.getModVersion(uid) .thenCompose(mod -> downloadAndInstallMod(mod, null, null)) .exceptionally(throwable -> { <START> logger.warn("Sim mod was not installed", throwable); <END> return null; }); }</code><technical_language>Sim mod installed (otherwise, sounds "it is")</technical_language>

Target:
public CompletableFuture<Void> downloadAndInstallMod(String uid) { return fafService.getModVersion(uid) .thenCompose(mod -> downloadAndInstallMod(mod, null, null)) .exceptionally(throwable -> { logger.warn("Sim mod could not be installed", throwable); return null; }); }
Source:
<code>public Map<String, String> getHostLabels(final String host) { final ZooKeeperClient client = provider.get("getHostStatus"); if (!ZooKeeperRegistrarUtil.isHostRegistered(client, host)) { <START> log.warn("Host isn't registered in ZooKeeper.", host); <END> return emptyMap(); } final Map<String, String> labels = getLabels(client, host); return labels == null ? emptyMap() : labels; }</code><technical_language>helpful more context in log messages this - method this is from, this host in place, etc. In this case is log warning useful</technical_language>

Target:
public Map<String, String> getHostLabels(final String host) { final ZooKeeperClient client = provider.get("getHostStatus"); if (!ZooKeeperRegistrarUtil.isHostRegistered(client, host)) { return emptyMap(); } final Map<String, String> labels = getLabels(client, host); return labels == null ? emptyMap() : labels; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_mas_optimization); <START> stops = new ArrayList<Position>(); <END> final Position origin = Position.fromCoordinates(-122.408818, 37.784015); stops.add(origin); mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { map = mapboxMap; mapboxMap.addMarker(new MarkerOptions() .position(new LatLng(origin.getLatitude(), origin.getLongitude())) .title("1")); map.setOnMapClickListener(new MapboxMap.OnMapClickListener() { @Override public void onMapClick(@NonNull LatLng point) { if (stops.size() == 12) { Toast.makeText(OptimizationActivity.this, "Only 12 stops allowed on route", Toast.LENGTH_LONG).show(); } else { map.addMarker(new MarkerOptions() .position(new LatLng(point.getLatitude(), point.getLongitude())) .title("1")); stops.add(Position.fromCoordinates(point.getLongitude(), point.getLatitude())); getOptimized(stops); } } }); } }); }</code><technical_language>Explicit type argument Position replaced <></technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_mas_optimization); initializeListOfStops(); mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { map = mapboxMap; mapboxMap.addMarker(new MarkerOptions() .position(new LatLng(origin.getLatitude(), origin.getLongitude())) .title(getString(R.string.origin))); map.setOnMapClickListener(new MapboxMap.OnMapClickListener() { @Override public void onMapClick(@NonNull LatLng point) { if (alreadyTwelveMarkersOnMap()) { Toast.makeText(OptimizationActivity.this, R.string.only_twelve_stops_allowed, Toast.LENGTH_LONG).show(); } else { addDestinationMarker(point); addPointToStopsList(point); getOptimizedRoute(stops); } } }); Toast.makeText(OptimizationActivity.this, R.string.click_instructions, Toast.LENGTH_SHORT).show(); } }); }
Source:
<code>public static Map<String, Certificate> getKeystoreMap(final KeyStore keystore) throws KeyStoreException { Map<String, Certificate> retObj = new HashMap<>(); Enumeration<String> alaises = keystore.aliases(); String alias; Certificate cert; String subjectKeyId; <START> while(alaises.hasMoreElements()){ <END> alias = alaises.nextElement(); cert = keystore.getCertificate(alias); subjectKeyId = getCertKeyIdSubject(cert); retObj.put(subjectKeyId, cert); } return retObj; }</code><technical_language>do need this method</technical_language>

Target:
public static Map<String, Certificate> getKeystoreMap(final KeyStore keystore) throws KeyStoreException { Map<String, Certificate> retObj = new HashMap<>(); Enumeration<String> aliases = keystore.aliases(); while (aliases.hasMoreElements()) { String alias = aliases.nextElement(); Certificate cert = keystore.getCertificate(alias); retObj.put(getCertKeyIdSubject(cert), cert); } return retObj; }
Source:
<code>public RecordWriter<Long, SinkRecord> getRecordWriter(Configuration conf, String fileName, SinkRecord record) throws IOException{ Object value = AvroData.convertToAvro(record.getValue()); Schema avroSchema = ((GenericRecord) value).getSchema(); <START> CompressionCodecName compressionCodecName = CompressionCodecName.SNAPPY; <END> int blockSize = 256 * 1024 * 1024; int pageSize = 64 * 1024; Path path = new Path(fileName); path.getFileSystem(conf).create(path); final ParquetWriter<GenericRecord> writer = new AvroParquetWriter<GenericRecord>(path, avroSchema, compressionCodecName, blockSize, pageSize); return new RecordWriter<Long, SinkRecord>(){ @Override public void write(Long key, SinkRecord record) throws IOException{ Object value = AvroData.convertToAvro(record.getValue()); writer.write((GenericRecord) value); } @Override public void close() throws IOException{ writer.close(); } @Override public void flush() throws IOException{ writer.close(); } }; }</code><technical_language>good candidates turned config options. need change here, file issue(s) for these</technical_language>

Target:
public RecordWriter<Long, SinkRecord> getRecordWriter(Configuration conf, String fileName, SinkRecord record) throws IOException{ Object value = AvroData.convertToAvro(record.getValue()); Schema avroSchema = ((GenericRecord) value).getSchema(); CompressionCodecName compressionCodecName = CompressionCodecName.SNAPPY; int blockSize = 256 * 1024 * 1024; int pageSize = 64 * 1024; Path path = new Path(fileName); path.getFileSystem(conf).create(path); final ParquetWriter<GenericRecord> writer = new AvroParquetWriter<GenericRecord>(path, avroSchema, compressionCodecName, blockSize, pageSize); return new RecordWriter<Long, SinkRecord>(){ @Override public void write(Long key, SinkRecord record) throws IOException{ Object value = AvroData.convertToAvro(record.getValue()); writer.write((GenericRecord) value); } @Override public void close() throws IOException{ writer.close(); } }; }
Source:
<code>public void testSessionUserReadOnlyPrivilegeDefault() { setUp(); <START> assertEquals(HOST.hasReadOnlyAccessPrivilege(), new Boolean(false)); <END> }</code><technical_language>assertTrue</technical_language>

Target:
public void testSessionUserReadOnlyPrivilegeDefault() { assertEquals(HOST.hasPrivilege(UserPrivilege.Keys.SESSION_READONLY_ACCESS), false); }
Source:
<code>public void testIteratorCloses() throws Exception { Kabob bob = db.getJdbi().onDemand(Kabob.class); Iterator<Something> itty = bob.iterateAll(); <START> assertThat(itty.hasNext()).isFalse(); <END> }</code><technical_language>Considering expected exception for this test, assertThat is superfluous, want is itty.hasNext();</technical_language>

Target:
public void testIteratorCloses() throws Exception { Kabob bob = db.getJdbi().onDemand(Kabob.class); Iterator<Something> itty = bob.iterateAll(); itty.hasNext(); }
Source:
<code>public void processResponse(XBeeResponse response) { if(response.getApiId() == ApiId.ZNET_RX_RESPONSE) { final ZNetRxResponse rxResponse = (ZNetRxResponse) response; final String message = ByteUtils.toString(rxResponse.getData()); final String remoteAddress = FormatUtil.readableAddress(rxResponse.getRemoteAddress64().getAddress()); final String[] lines = message.split("\\r\\n"); for (final String line : lines) { <START> logger.debug("received message: '" + line + " from '" + remoteAddress + "'"); <END> final int idxEquals = line.indexOf('='); if(idxEquals > 0) { final String key = line.substring(0, idxEquals); final String value = line.substring(idxEquals + 1, line.length()); boolean updated = false; for (final DiyOnXBeeBindingProvider provider : providers) { for (final String itemName : provider.getItemNames()) { final String id = provider.getId(itemName); final String remote = provider.getRemote(itemName); if(key.equals(id) && remote.equals(remoteAddress)) { final List<Class<? extends State>> availableTypes = provider.getAvailableItemTypes(itemName); final State state = parseState(value, availableTypes); if(state != null) { updated = true; eventPublisher.postUpdate(itemName, state); } } } } if(!updated) { logger.warn("unmatched item: key='" + key + "', value='" + value + "' from " + remoteAddress); } } } } }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
public void processResponse(XBeeResponse response) { if (response.getApiId() == ApiId.ZNET_RX_RESPONSE) { final ZNetRxResponse rxResponse = (ZNetRxResponse) response; final String message = ByteUtils.toString(rxResponse.getData()); final String remoteAddress = FormatUtil.readableAddress(rxResponse.getRemoteAddress64().getAddress()); final String[] lines = message.split("\\r\\n"); for (final String line : lines) { logger.debug("received message: '{}' from '{}'", line, remoteAddress); final int idxEquals = line.indexOf('='); if (idxEquals > 0) { final String key = line.substring(0, idxEquals); final String value = line.substring(idxEquals + 1, line.length()); boolean updated = false; for (final DiyOnXBeeBindingProvider provider : providers) { for (final String itemName : provider.getItemNames()) { final String id = provider.getId(itemName); final String remote = provider.getRemote(itemName); if (key.equals(id) && remote.equals(remoteAddress)) { final List<Class<? extends State>> availableTypes = provider .getAvailableItemTypes(itemName); final State state = parseState(value, availableTypes, provider, itemName); if (state != null) { updated = true; eventPublisher.postUpdate(itemName, state); } } } } if (!updated) { logger.warn("unmatched item: key='{}', value='{}' from '{}'", key, value, remoteAddress); } } } } }
Source:
<code>public PortableInfoboxObject clickGalleryImage(int index) { <START> Assertion.assertFalse(galleryImageList.isEmpty()); <END> wait.forElementClickable(galleryImageList.get(index)); galleryImageList.get(index).click(); return this; }</code><technical_language>asserting this</technical_language>

Target:
public PortableInfoboxObject clickGalleryImage(int index) { wait.forElementClickable(galleryImageList.get(index)).click(); return this; }
Source:
<code>protected boolean validateImageTransfer() { DiskImage diskImage = getDiskImage(); DiskValidator diskValidator = getDiskValidator(diskImage); DiskImagesValidator diskImagesValidator = getDiskImagesValidator(diskImage); StorageDomainValidator storageDomainValidator = getStorageDomainValidator( storageDomainDao.getForStoragePool(diskImage.getStorageIds().get(0), diskImage.getStoragePoolId())); return validate(diskValidator.isDiskExists()) && <START> validate(diskValidator.isDiskPluggedToAnyNonDownVm(false, false)) <END> && validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()) && validate(storageDomainValidator.isDomainExistAndActive()); }</code><technical_language>Suggestion: I more readable do so: !disk.isDiskSnapshot() && validate(diskValidator.isDisk... unnecessary overloading magic booleans client need guess calling isDiskPluggedToAnyNonDownVm</technical_language>

Target:
protected boolean validateImageTransfer() { DiskImage diskImage = getDiskImage(); DiskValidator diskValidator = getDiskValidator(diskImage); DiskImagesValidator diskImagesValidator = getDiskImagesValidator(diskImage); StorageDomainValidator storageDomainValidator = getStorageDomainValidator( storageDomainDao.getForStoragePool(diskImage.getStorageIds().get(0), diskImage.getStoragePoolId())); return validate(diskValidator.isDiskExists()) && validateActiveDiskPluggedToAnyNonDownVm(diskImage, diskValidator) && validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()) && validate(storageDomainValidator.isDomainExistAndActive()); }
Source:
<code>public boolean processInParallel() { <START> return true; <END> }</code><technical_language>Nope, false please :)</technical_language>

Target:
public boolean processInParallel() { return false; }
Source:
<code>protected void submitCallback(int code) { if (BKException.Code.OK == code) { numPendingEntries--; if (numPendingEntries != 0) { return; } } if (!complete.compareAndSet(false, true)) { return; } long latencyNanos = MathUtils.elapsedNanos(requestTimeNanos); if (code != BKException.Code.OK) { long firstUnread = LedgerHandle.INVALID_ENTRY_ID; for (LedgerEntryRequest req : seq) { if (!req.isComplete()) { firstUnread = req.getEntryId(); break; } } LOG.error("Read of ledger entry failed: L{} E{}-E{}, Heard from {}. First unread entry is {}", <START> new Object[] { lh.getId(), startEntryId, endEntryId, heardFromHostsBitSet, firstUnread }); <END> readOpLogger.registerFailedEvent(latencyNanos, TimeUnit.NANOSECONDS); } else { readOpLogger.registerSuccessfulEvent(latencyNanos, TimeUnit.NANOSECONDS); } cancelSpeculativeTask(true); cb.readComplete(code, lh, PendingReadOp.this, PendingReadOp.this.ctx); cb = null; }</code><technical_language>I get bookie inet address extensively for debugging. this get index right</technical_language>

Target:
protected void submitCallback(int code) { if (BKException.Code.OK == code) { numPendingEntries--; if (numPendingEntries != 0) { return; } } if (!complete.compareAndSet(false, true)) { return; } long latencyNanos = MathUtils.elapsedNanos(requestTimeNanos); if (code != BKException.Code.OK) { long firstUnread = LedgerHandle.INVALID_ENTRY_ID; for (LedgerEntryRequest req : seq) { if (!req.isComplete()) { firstUnread = req.getEntryId(); break; } } LOG.error("Read of ledger entry failed: L{} E{}-E{}, Heard from : bitset = {}. First unread entry is {}", new Object[] { lh.getId(), startEntryId, endEntryId, heardFromHosts, heardFromHostsBitSet, firstUnread }); readOpLogger.registerFailedEvent(latencyNanos, TimeUnit.NANOSECONDS); } else { readOpLogger.registerSuccessfulEvent(latencyNanos, TimeUnit.NANOSECONDS); } cancelSpeculativeTask(true); cb.readComplete(code, lh, PendingReadOp.this, PendingReadOp.this.ctx); cb = null; }
Source:
<code>private void buildIncludeList() { includes = new ArrayList<IncludeHierarchy>(); includes.add(includeHierarchy); <START> stack = new Stack<>(); <END> stackIterator = new Stack<Iterator<IncludeHierarchy>>(); pushIteratorForOneLevel(includeHierarchy); IncludeHierarchy include = nextHierarchyFromCurrentIterator(); while (include != null) { includes.add(include); include = nextHierarchyFromCurrentIterator(); } iterator = includes.iterator(); }</code><technical_language>I stack again? Is this class finished</technical_language>

Target:
private void buildIncludeList() { includes = new ArrayList<IncludeHierarchy>(); includes.add(includeHierarchy); stackIterator = new Stack<Iterator<IncludeHierarchy>>(); pushIteratorForOneLevel(includeHierarchy); IncludeHierarchy include = nextHierarchyFromCurrentIterator(); while (include != null) { includes.add(include); include = nextHierarchyFromCurrentIterator(); } iterator = includes.iterator(); }
Source:
<code><START> private void reportTree(MethodInvocationTree mit) { <END> ExpressionTree methodSelect = mit.methodSelect(); if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { reportTree(((MemberSelectExpressionTree) methodSelect).identifier()); } else { reportTree(methodSelect); } }</code><technical_language>ExpressionUtils.methodName(mit) for that</technical_language>

Target:
private void reportTree(MethodInvocationTree mit) { reportTree(ExpressionUtils.methodName(mit)); }
Source:
<code>public static void getThreadExecutionState(final DSFSessionState sessionState, final ICPUDMContext cpuContext, final ICoreDMContext coreContext, final IMIExecutionDMContext execContext, final IThreadDMData threadData, final DSFDebugModelListener listener, final Object arg) { IRunControl runControl = sessionState.getService(IRunControl.class); if (runControl == null) { listener.getThreadExecutionStateDone(cpuContext, coreContext, execContext, threadData, null, null, arg); return; } if (runControl.isSuspended(execContext) == false) { listener.getThreadExecutionStateDone(cpuContext, coreContext, execContext, threadData, null, VisualizerExecutionState.RUNNING, arg); } else { <START> final IStack stackService = sessionState.getService(IStack.class); <END> stackService.getTopFrame(execContext, new ImmediateDataRequestMonitor<IFrameDMContext>(null) { @Override protected void handleCompleted() { IFrameDMContext targetFrameContext = getData(); if (targetFrameContext!= null) { stackService.getFrameData(targetFrameContext, new ImmediateDataRequestMonitor<IFrameDMData>(null) { @Override protected void handleCompleted() { IFrameDMData frameData = getData(); getThreadSuspendReason(sessionState, cpuContext, coreContext, execContext, threadData, frameData, listener, arg); super.handleCompleted(); } }); } else { getThreadSuspendReason(sessionState, cpuContext, coreContext, execContext, threadData, null, listener, arg); } super.handleCompleted(); } }); } }</code><technical_language>Check stackService is null</technical_language>

Target:
public static void getThreadExecutionState(final DSFSessionState sessionState, final ICPUDMContext cpuContext, final ICoreDMContext coreContext, final IMIExecutionDMContext execContext, final IThreadDMData threadData, final DSFDebugModelListener listener, final Object arg) { IRunControl runControl = sessionState.getService(IRunControl.class); if (runControl == null) { listener.getThreadExecutionStateDone(cpuContext, coreContext, execContext, threadData, null, null, arg); return; } if (runControl.isSuspended(execContext) == false) { listener.getThreadExecutionStateDone(cpuContext, coreContext, execContext, threadData, null, VisualizerExecutionState.RUNNING, arg); } else { final IStack stackService = sessionState.getService(IStack.class); if (stackService != null) { stackService.getTopFrame(execContext, new ImmediateDataRequestMonitor<IFrameDMContext>(null) { @Override protected void handleCompleted() { IFrameDMContext targetFrameContext = null; if (isSuccess()) { targetFrameContext = getData(); } if (targetFrameContext!= null) { stackService.getFrameData(targetFrameContext, new ImmediateDataRequestMonitor<IFrameDMData>(null) { @Override protected void handleCompleted() { IFrameDMData frameData = null; if (isSuccess()) { frameData = getData(); } getThreadSuspendReason(sessionState, cpuContext, coreContext, execContext, threadData, frameData, listener, arg); } }); } else { getThreadSuspendReason(sessionState, cpuContext, coreContext, execContext, threadData, null, listener, arg); } } }); } else { getThreadSuspendReason(sessionState, cpuContext, coreContext, execContext, threadData, null, listener, arg); } } }
Source:
<code><START> public static Optional<ChronoUnit> getChronoUnitFromURI(URI durationURI) { <END> if (isValidDurationType(durationURI)) { return Optional.of(DURATION_MAP.get(durationURI)); } return Optional.empty(); }</code><technical_language>This function simplified to: java public static Optional<ChronoUnit> getChronoUnitFromURI(URI durationURI) { return Optional.ofNullable(DURATION_MAP.get(durationURI)); }</technical_language>

Target:
public static Optional<ChronoUnit> getChronoUnitFromURI(URI durationURI) { return Optional.ofNullable(DURATION_MAP.get(durationURI)); }
Source:
<code>public void browserAcceptHeader_should_include_default_if_browser_accept_header_not_provided(@Nullable String browserAcceptHeader) { <START> authCardDetails.setAcceptHeader(browserAcceptHeader); <END> List<NameValuePair> result = epdqPayloadDefinitionFor3ds2NewOrder.extract(epdqTemplateData); assertThat(result, hasItem(new BasicNameValuePair(BROWSER_ACCEPT_HEADER, "*/*"))); }</code><technical_language>I string "null" actual null</technical_language>

Target:
public void browserAcceptHeader_should_include_default_if_browser_accept_header_not_provided(@Nullable String browserAcceptHeader) { authCardDetails.setAcceptHeader(browserAcceptHeader); List<NameValuePair> result = epdqPayloadDefinitionFor3ds2NewOrder.extract(epdqTemplateData); assertThat(result, is(aParameterBuilder().withBrowserAcceptHeader(DEFAULT_BROWSER_ACCEPT_HEADER).build())); }
Source:
<code>public void testExceptionWithTableGenerator() throws Exception { thrown.expect( HibernateException.class ); thrown.expectMessage( "OGM001109: Counter is not defined and cannot be created. Global persistent-location is missing in the Infinispan configuration" ); OgmEntityManagerFactory emFactory = ( (OgmEntityManagerFactory) getFactory() ); <START> SessionFactoryImplementor sessionFactory = emFactory.getSessionFactory(); <END> IdentifierGenerator generator = sessionFactory.getIdentifierGenerator( GlobalConfigNotEnabledTableGenerationTest.EntityWithTableGenerator.class.getName() ); IdSourceKeyMetadata tableMetadata = ( (OgmTableGenerator) generator ).getGeneratorKeyMetadata(); IdSourceKey generatorKey = IdSourceKey.forTable( tableMetadata, TABLE_ROW_KEY_NAME ); dialect.nextValue( new NextValueRequest( generatorKey, 1, 0 ) ); fail( "expected exception on next value invocation was not raised" ); }</code><technical_language>This need rebased merge of ORM 5.2 branch. easy, sessionFactory is obtained changed. Feel free ping if issue it</technical_language>

Target:
public void testExceptionWithTableGenerator() throws Exception { thrown.expect( HibernateException.class ); thrown.expectMessage( "OGM001109: Counter is not defined and cannot be created. Global persistent-location is missing in the Infinispan configuration" ); SessionFactoryImplementor sessionFactory = getFactory().unwrap( SessionFactoryImplementor.class ); IdentifierGenerator generator = sessionFactory.getIdentifierGenerator( GlobalConfigNotEnabledTableGenerationTest.EntityWithTableGenerator.class.getName() ); IdSourceKeyMetadata tableMetadata = ( (OgmTableGenerator) generator ).getGeneratorKeyMetadata(); IdSourceKey generatorKey = IdSourceKey.forTable( tableMetadata, TABLE_ROW_KEY_NAME ); dialect.nextValue( new NextValueRequest( generatorKey, 1, 0 ) ); fail( "expected exception on next value invocation was not raised" ); }
Source:
<code>public void testIssue15() throws Exception { OpenAPI oas = getConvertedOpenAPIFromJsonFile(ISSUE_15_JSON); assertNotNull(oas); Info info = oas.getInfo(); assertNotNull(info.getExtensions().get("x-apis-json")); assertNotNull(info.getLicense().getExtensions().get("x-notes")); assertNotNull(oas.getExternalDocs().getExtensions().get("x-docs-extension")); assertNotNull(oas.getTags().get(0).getExtensions().get("x-tag-extension")); assertNotNull(oas.getTags().get(0).getExternalDocs().getExtensions().get("x-tag-docs-extension")); PathItem pathItem = oas.getPaths().get("/something"); assertNotNull(pathItem.getExtensions().get("x-path-item-extension")); Operation get = pathItem.getGet(); assertNotNull(get.getExtensions().get("x-version")); assertNotNull(get.getExternalDocs().getExtensions().get("x-operation-docs-extension")); assertNotNull(get.getResponses().get("200").getExtensions().get("x-response-extension")); ArraySchema schema = (ArraySchema) get.getParameters().get(0).getSchema(); <START> assertNotNull(schema.getItems().getExtensions().get("x-example")); <END> Map<String, SecurityScheme> securitySchemes = oas.getComponents().getSecuritySchemes(); assertNotNull(securitySchemes); assertNotNull(securitySchemes.get("OAuth2Implicit").getExtensions().get("x-auth-extension")); }</code><technical_language>x-example, x-examples, x-nullable moved extensions converted 'native' equivalent in OAS3</technical_language>

Target:
public void testIssue15() throws Exception { OpenAPI oas = getConvertedOpenAPIFromJsonFile(ISSUE_15_JSON); assertNotNull(oas); Info info = oas.getInfo(); assertNotNull(info.getExtensions().get("x-apis-json")); assertNotNull(info.getLicense().getExtensions().get("x-notes")); assertNotNull(oas.getExternalDocs().getExtensions().get("x-docs-extension")); assertNotNull(oas.getTags().get(0).getExtensions().get("x-tag-extension")); assertNotNull(oas.getTags().get(0).getExternalDocs().getExtensions().get("x-tag-docs-extension")); PathItem pathItem = oas.getPaths().get("/something"); assertNotNull(pathItem.getExtensions().get("x-path-item-extension")); Operation get = pathItem.getGet(); assertNotNull(get.getExtensions().get("x-version")); assertNotNull(get.getExternalDocs().getExtensions().get("x-operation-docs-extension")); assertNotNull(get.getResponses().get("200").getExtensions().get("x-response-extension")); ArraySchema schema = (ArraySchema) get.getParameters().get(0).getSchema(); assertNull(schema.getItems().getExtensions().get("x-example")); Map<String, SecurityScheme> securitySchemes = oas.getComponents().getSecuritySchemes(); assertNotNull(securitySchemes); assertNotNull(securitySchemes.get("OAuth2Implicit").getExtensions().get("x-auth-extension")); }
Source:
<code>public List<Message> validateProperties(Object object, String... properties) { logger.warn("You are willing to validate an object, but there is no bean validation engine " + "registered. Please add the jars of some implementation of Bean Validator."); <START> return Collections.emptyList(); <END> }</code><technical_language>extract this warning somehow.. simply return validate(object);</technical_language>

Target:
public List<Message> validateProperties(Object object, String... properties) { return validate(object); }
Source:
<code>public int getCountContentletsReferencingStep(WorkflowStep step) throws DotDataException{ final DotConnect db = new DotConnect(); db.setSQL(sql.SELECT_COUNT_CONTENTLES_BY_STEP); db.addParam(step.getId()); Map<String,Object> res = db.loadObjectResults().get(0); <START> return Integer.parseInt(String.valueOf(res.get("count"))); <END> }</code><technical_language>replace this ConversionUtils.toInt(res.get("count"), 0);</technical_language>

Target:
public int getCountContentletsReferencingStep(WorkflowStep step) throws DotDataException{ final DotConnect db = new DotConnect(); db.setSQL(sql.SELECT_COUNT_CONTENTLES_BY_STEP); db.addParam(step.getId()); Map<String,Object> res = db.loadObjectResults().get(0); return ConversionUtils.toInt(res.get("count"), 0); }
Source:
<code>private <K extends Exception> void logNumberOfAttempts(Exception ex, int numberOfAttempts) throws K { if (numberOfAttempts > 1) { log.debug("Error occurred talking to cassandra. Attempt of {}. Exception message was: : {}", SafeArg.of("numTries", numberOfAttempts), SafeArg.of("maxTotalTries", maxTriesTotal), SafeArg.of("exceptionClass", ex.getClass().getTypeName()), UnsafeArg.of("exceptionMessage", ex.getMessage())); } else { <START> log.debug("Error occurred talking to cassandra. Attempt of {}.", <END> SafeArg.of("numTries", numberOfAttempts), SafeArg.of("maxTotalTries", maxTriesTotal), ex); } }</code><technical_language>~this message useful for detecting ongoing issues, e.g. sweep is misbehaving.~</technical_language>

Target:
private <K extends Exception> void logNumberOfAttempts(Exception ex, int numberOfAttempts) throws K { if (numberOfAttempts > 1) { log.debug("Error occurred talking to cassandra. Attempt of {}. Exception message was: : {}", SafeArg.of("numTries", numberOfAttempts), SafeArg.of("maxTotalTries", maxTriesTotal.get()), SafeArg.of("exceptionClass", ex.getClass().getTypeName()), UnsafeArg.of("exceptionMessage", ex.getMessage())); } else { log.debug("Error occurred talking to cassandra. Attempt of {}.", SafeArg.of("numTries", numberOfAttempts), SafeArg.of("maxTotalTries", maxTriesTotal.get()), ex); } }
Source:
<code>public URL getRuleset() throws CheckstylePluginException, CoreException { String configLocation = this.getConfigLocation(); URL ruleset = null; <START> if (CHECKSTYLE_DEFAULT_CONFIG_FILE_NAME.equals(configLocation)) { <END> ruleset = getInlineRules(); } if (ruleset == null) { ruleset = resolveLocation(this.getConfigLocation()); } if (ruleset == null) { throw new CheckstylePluginException( "Failed to resolve RuleSet from configLocation,SKIPPING Eclipse checkstyle configuration"); } return ruleset; }</code><technical_language>@Serranya is this CHECKSTYLE_DEFAULT_CONFIG_FILE_NAME exactly? Is a fake name detect is configuration file specified? I find strange if user wants this file config/sun_checks.xml? some problem then, no</technical_language>

Target:
public URL getRuleset() throws CheckstylePluginException, CoreException { final String configLocation = this.getConfigLocation(); URL ruleset = getInlineRules(); if (ruleset != null && !CHECKSTYLE_DEFAULT_CONFIG_FILE_NAME.equals(configLocation)) { throw new CheckstylePluginException("If you use inline configuration for rules, don't specify a configLocation"); } if (ruleset == null) { ruleset = resolveLocation(this.getConfigLocation()); } if (ruleset == null) { throw new CheckstylePluginException( "Failed to resolve RuleSet from inlineConfig or configLocation,SKIPPING Eclipse checkstyle configuration"); } return ruleset; }
Source:
<code>public GitClient subGit(String subdir) { <START> return new CliGitAPIImpl(gitExe, new File(workspace, subdir), listener, environment, null); <END> }</code><technical_language>passing launcher</technical_language>

Target:
public GitClient subGit(String subdir) { return new CliGitAPIImpl(gitExe, new File(workspace, subdir), listener, environment, launcher); }