auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { DocumentCursor<BaseDocument> cursor = null; try { DocumentEntity<BaseDocument> targetDoc = arangoDriver.getDocument(table, key, BaseDocument.class); BaseDocument aDocument = targetDoc.getEntity(); this.fillMap(result, aDocument.getProperties(), fields); return Status.OK; } catch (ArangoException e) { if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { <START> logger.error("Fail to read: " + table + " " + key, e); <END> } else { logger.debug("Trying to read document not exist: {}", table, key); return Status.NOT_FOUND; } } catch (Exception e) { logger.error("Exception while trying read " + table + " " + key, e); } finally { if (cursor != null) { try { cursor.close(); } catch (ArangoException e) { logger.error("Fail to close cursor", e); } } } return Status.ERROR; }</code><technical_language>a format placeholder instead of string concat</technical_language>

Target:
public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { try { DocumentEntity<BaseDocument> targetDoc = arangoDriver.getDocument(table, key, BaseDocument.class); BaseDocument aDocument = targetDoc.getEntity(); if (!this.fillMap(result, aDocument.getProperties(), fields)) { return Status.ERROR; } return Status.OK; } catch (ArangoException e) { if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { logger.error("Fail to read: with ex {}", table, key, e.toString()); } else { logger.debug("Trying to read document not exist: {}", table, key); return Status.NOT_FOUND; } } catch (RuntimeException e) { logger.error("Exception while trying read with ex {}", table, key, e.toString()); } return Status.ERROR; }
Source:
<code>public Appendable write(Appendable appendable, Context context) throws IOException { appendable.append('@'); annotationName.write(appendable, context); if (!memberMap.isEmpty()) { appendable.append('('); if (memberMap.size() == 1) { Entry<String, Writable> onlyEntry = Iterables.getOnlyElement(memberMap.entrySet()); if (!onlyEntry.getKey().equals("value")) { appendable.append(onlyEntry.getKey()).append(" = "); } onlyEntry.getValue().write(appendable, context); } else { <START> boolean first = true; <END> for (Entry<String, Writable> entry : memberMap.entrySet()) { if (!first) { appendable.append(", "); } first = false; appendable.append(entry.getKey()).append(" = "); entry.getValue().write(appendable, context); } } appendable.append(')'); } return appendable; }</code><technical_language>a simpler alternative: java String sep = ""; for (Entry<String, Writable> entry : memberMap.entrySet()) { appendable.append(sep).append(entry.getKey()).append(" = "); entry.getValue().write(appendable, context); sep = ", "; }</technical_language>

Target:
public Appendable write(Appendable appendable, Context context) throws IOException { appendable.append('@'); annotationName.write(appendable, context); if (!memberMap.isEmpty()) { appendable.append('('); if (memberMap.size() == 1) { Entry<String, Writable> onlyEntry = Iterables.getOnlyElement(memberMap.entrySet()); if (!onlyEntry.getKey().equals("value")) { appendable.append(onlyEntry.getKey()).append(" = "); } onlyEntry.getValue().write(appendable, context); } else { String sep = ""; for (Entry<String, Writable> entry : memberMap.entrySet()) { appendable.append(sep).append(entry.getKey()).append(" = "); entry.getValue().write(appendable, context); sep = ", "; } } appendable.append(')'); } return appendable; }
Source:
<code>private void scanProjects(final File dir, final String prefix, final SortedSet<Project.NameKey> names) { final File[] ls = dir.listFiles(); if (ls == null) { return; } for (File f : ls) { String name = f.getName(); if (FileKey.isGitRepository(f, FS.DETECTED)) { if (name.equals(Constants.DOT_GIT)) { name = prefix.substring(0, prefix.length() - 1); } else if (name.endsWith(Constants.DOT_GIT_EXT)) { <START> name = prefix + name.substring(0, name.length() - 4); <END> } else { name = prefix + name; } Project.NameKey nameKey = new Project.NameKey(name); if (!isUnreasonableName(nameKey)) { names.add(nameKey); } } else if (f.isDirectory()) { scanProjects(f, prefix + f.getName() + "/", names); } } }</code><technical_language>Is Constants.DOT_GIT_EXT ".git" literal? If constant changes remember change this magic 4 also. I is DOT_GIT_EXT change if DOT_GIT_EXT.length()</technical_language>

Target:
private void scanProjects(final File dir, final String prefix, final SortedSet<Project.NameKey> names) { final File[] ls = dir.listFiles(); if (ls == null) { return; } for (File f : ls) { String name = f.getName(); if (FileKey.isGitRepository(f, FS.DETECTED)) { if (name.equals(Constants.DOT_GIT)) { name = prefix.substring(0, prefix.length() - 1); } else if (name.endsWith(Constants.DOT_GIT_EXT)) { int newLen = name.length() - Constants.DOT_GIT_EXT.length(); name = prefix + name.substring(0, newLen); } else { name = prefix + name; } Project.NameKey nameKey = new Project.NameKey(name); if (!isUnreasonableName(nameKey)) { names.add(nameKey); } } else if (f.isDirectory()) { scanProjects(f, prefix + f.getName() + "/", names); } } }
Source:
<code>public void sendEmail(String subject, String templateName, Map<String, Object> templateData) throws IOException, TemplateException, EmailException { <START> sendEmail(fromAddress, subject, templateName, templateData); <END> }</code><technical_language>Create a separate defaultToAddress field</technical_language>

Target:
public void sendEmail(String subject, String templateName, Map<String, Object> templateData) throws IOException, TemplateException, EmailException { sendEmail(defaultToAddress, subject, templateName, templateData); }
Source:
<code>public RequestBody toBody(Object object, Type type) { try { String json = LoganSquare.serialize(object); return RequestBody.create(MEDIA_TYPE, json); } catch (IOException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>AssertionError here. IOException happen writing memory</technical_language>

Target:
public RequestBody toBody(Object object, Type type) { try { String json; if (List.class.isAssignableFrom(object.getClass())) { List<Object> list = (List<Object>) object; if (list.isEmpty()) { json = "[]"; } else { json = LoganSquare.serialize(list, (Class<Object>) list.get(0).getClass()); } } else { json = LoganSquare.serialize(object); } return RequestBody.create(MEDIA_TYPE, json); } catch (Exception e) { e.printStackTrace(); throw new AssertionError(e); } }
Source:
<code>private void removeBricksFromVolumeInDb(List<GlusterBrickEntity> brickList) { <START> GlusterVolumeEntity volume = getGlusterVolume(); <END> for (GlusterBrickEntity brick : brickList) { getGlusterBrickDao().removeBrick(brick.getId()); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_REPLICATE && volume.getReplicaCount() == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.REPLICATE); } if (volume.getVolumeType().isReplicatedType()) { int replicaCount = (getParameters().getReplicaCount() == 0) ? volume.getReplicaCount() : getParameters().getReplicaCount(); volume.setReplicaCount(replicaCount); getGlusterVolumeDao().updateGlusterVolume(volume); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_STRIPE && volume.getStripeCount() == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.STRIPE); getGlusterVolumeDao().updateGlusterVolume(volume); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE && (volume.getStripeCount() * volume.getReplicaCount()) == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.STRIPED_REPLICATE); getGlusterVolumeDao().updateGlusterVolume(volume); } }</code><technical_language>I know, topic for this patch, - considered spring jdbc batch support here</technical_language>

Target:
private void removeBricksFromVolumeInDb(List<GlusterBrickEntity> brickList) { GlusterVolumeEntity volume = getGlusterVolume(); getGlusterBrickDao().removeAllInBatch(brickList); if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_REPLICATE && volume.getReplicaCount() == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.REPLICATE); } if (volume.getVolumeType().isReplicatedType()) { int replicaCount = (getParameters().getReplicaCount() == 0) ? volume.getReplicaCount() : getParameters().getReplicaCount(); volume.setReplicaCount(replicaCount); getGlusterVolumeDao().updateGlusterVolume(volume); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_STRIPE && volume.getStripeCount() == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.STRIPE); getGlusterVolumeDao().updateGlusterVolume(volume); } if (volume.getVolumeType() == GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE && (volume.getStripeCount() * volume.getReplicaCount()) == (volume.getBricks().size() - brickList.size())) { volume.setVolumeType(GlusterVolumeType.STRIPED_REPLICATE); getGlusterVolumeDao().updateGlusterVolume(volume); } }
Source:
<code>public synchronized Set<CommandMapping> getAll(String alias) { Set<CommandMapping> set = new HashSet<CommandMapping>(); <START> Optional<CommandMapping> mapping = Optional.fromNullable(this.commands.get(alias.toLowerCase())); <END> if (mapping.isPresent()) { set.add(mapping.get()); } return set; }</code><technical_language>reason wrap this in Optional unwrap again. check for null not</technical_language>

Target:
public synchronized Set<CommandMapping> getAll(String alias) { Set<CommandMapping> set = new HashSet<CommandMapping>(); CommandMapping mapping = this.commands.get(alias.toLowerCase()); if (mapping != null) { set.add(mapping); } return set; }
Source:
<code>private SSLSetup setupSSLIfNeeded(SocketChannel sc, boolean clientMode) throws IOException { if (m_sslContext == null) { return null; } ByteBuffer remnant; SSLEngine sslEngine = m_sslContext.createSSLEngine(); sslEngine.setUseClientMode(clientMode); sslEngine.setNeedClientAuth(false); Set<String> enabled = ImmutableSet.copyOf(sslEngine.getEnabledCipherSuites()); Set<String> intersection = Sets.intersection(SSLConfiguration.PREFERRED_CIPHERS, enabled); if (intersection.isEmpty()) { hostLog.warn("Preferred cipher suites are not available"); intersection = enabled; } sslEngine.setEnabledCipherSuites(intersection.toArray(new String[0])); boolean handshakeStatus; try { sc.socket().setTcpNoDelay(true); TLSHandshaker handshaker = new TLSHandshaker(sc, sslEngine); handshakeStatus = handshaker.handshake(); remnant = handshaker.getRemnantUnencrypted(); } catch (IOException e) { try { sc.close(); } catch (IOException e1) { hostLog.warn("failed to close channel",e1); } throw new IOException("Rejected accepting new internal connection, SSL handshake failed: " + e.getMessage(), e); } if (!handshakeStatus) { try { sc.close(); <START> } catch (IOException e) { <END> } throw new IOException("Rejected accepting new internal connection, SSL handshake failed."); } LOG.info("SSL enabled on internal connection " + sc.socket().getRemoteSocketAddress() + " with protocol " + sslEngine.getSession().getProtocol() + " and with cipher " + sslEngine.getSession().getCipherSuite()); return new SSLSetup(sslEngine, remnant); }</code><technical_language>caller close ScoketChannel if failed setup? **processSSC**, of callers, close channel if exception is thrown</technical_language>

Target:
private SSLSetup setupSSLIfNeeded(SocketChannel sc, boolean clientMode) throws IOException { if (m_sslContext == null) { return null; } ByteBuffer remnant; SSLEngine sslEngine = m_sslContext.createSSLEngine(); sslEngine.setUseClientMode(clientMode); sslEngine.setNeedClientAuth(false); Set<String> enabled = ImmutableSet.copyOf(sslEngine.getEnabledCipherSuites()); Set<String> intersection = Sets.intersection(SSLConfiguration.PREFERRED_CIPHERS, enabled); if (intersection.isEmpty()) { hostLog.warn("Preferred cipher suites are not available"); intersection = enabled; } sslEngine.setEnabledCipherSuites(intersection.toArray(new String[0])); boolean handshakeStatus; sc.socket().setTcpNoDelay(true); TLSHandshaker handshaker = new TLSHandshaker(sc, sslEngine); handshakeStatus = handshaker.handshake(); remnant = handshaker.getRemnantUnencrypted(); if (!handshakeStatus) { throw new IOException("Rejected accepting new internal connection, SSL handshake failed."); } LOG.info("SSL enabled on internal connection " + sc.socket().getRemoteSocketAddress() + " with protocol " + sslEngine.getSession().getProtocol() + " and with cipher " + sslEngine.getSession().getCipherSuite()); return new SSLSetup(sslEngine, remnant); }
Source:
<code>private String formatMetadataRequestKey(String key) { <START> return "metadata[" + key + "]"; <END> }</code><technical_language>suggestion return format("metadata[%s]", key);</technical_language>

Target:
private String formatMetadataRequestKey(String key) { return String.format("metadata[%s]", key); }
Source:
<code>public boolean hasChildren(Object element) { if (!(element instanceof PathNode)) return false; IPath parent = ((PathNode) element).path; for (IPath childPath : leftPathsWithChildren) { <START> if (childPath.removeLastSegments(1).equals(parent)) { <END> return true; } } for (IPath mapPath : leftVersionMap.keySet()) { if (mapPath.removeLastSegments(1).equals(parent) && (showEquals || !equalContentPaths.contains(mapPath))) { return true; } } return false; }</code><technical_language>style nit: braces</technical_language>

Target:
public boolean hasChildren(Object element) { if (!(element instanceof PathNode)) return false; IPath parent = ((PathNode) element).path; for (IPath childPath : baseVersionPathsWithChildren) { if (childPath.removeLastSegments(1).equals(parent)) return true; } for (IPath mapPath : baseVersionMap.keySet()) { if (mapPath.removeLastSegments(1).equals(parent) && (showEquals || !equalContentPaths.contains(mapPath))) { return true; } } return false; }
Source:
<code>private boolean shouldUpdateVmsAndTemplates() { return isVersionChanged() || isBiosTypeChanged() || isCpuNameChanged() <START> || oldCluster.getArchitecture() == getArchitecture(); <END> }</code><technical_language>condition inverted, it</technical_language>

Target:
private boolean shouldUpdateVmsAndTemplates() { return isVersionChanged() || isBiosTypeChanged() || isCpuNameChanged() || oldCluster.getArchitecture() != getArchitecture(); }
Source:
<code>private void initialize() { try { ExchangeInfoType exInfo = ExchangeInfoDAOFileImpl.getInstance().loadExchangeInfo(); long interval = exInfo.getRefreshInterval(); if (interval <= 0) { <START> refreshInterval = DEFAULT_EXCHANGE_REFRESH_INTERVAL * MINUTES_TO_MILLIS; <END> } else { refreshInterval = interval * MINUTES_TO_MILLIS; } } catch (ExchangeManagerException ex) { LOG.error("Unable to load exchange information {}", ex.getLocalizedMessage(), ex); } }</code><technical_language>Optional: this calculation convert day milisecond: TimeUnit.MILLISECONDS.convert(1, TimeUnit.DAYS) TimeUnit.DAYS.toMillis(1);</technical_language>

Target:
private void initialize() { try { ExchangeInfoType exInfo = ExchangeInfoDAOFileImpl.getInstance().loadExchangeInfo(); long interval = exInfo.getRefreshInterval(); if (interval <= 0) { refreshInterval = TimeUnit.MINUTES.toMillis(DEFAULT_EXCHANGE_REFRESH_INTERVAL); } else { refreshInterval = TimeUnit.MINUTES.toMillis(interval); } } catch (ExchangeManagerException ex) { LOG.error("Unable to load exchange information {}", ex.getLocalizedMessage(), ex); } }
Source:
<code><START> public void send(byte[] data) { <END> ByteBuffer buffer = ByteBuffer.allocateDirect(data.length); CANJNI.FRCNetCommCANSessionMuxSendMessage(this.outboundArbitrationId, buffer, CANJNI.CAN_SEND_PERIOD_NO_REPEAT); }</code><technical_language>Data appears</technical_language>

Target:
public void send(byte[] data) { ByteBuffer buffer = ByteBuffer.allocateDirect(data.length); buffer.put(data); CANJNI.FRCNetCommCANSessionMuxSendMessage(this.outboundArbitrationId, buffer, CANJNI.CAN_SEND_PERIOD_NO_REPEAT); }
Source:
<code>public CountryVersion(String uid, String country, int version, Date lastUpdate, String reference, String name) { <START> setUid(required(uid,"UID is required")); <END> setCountry(required(country,"country is required")); setVersion(required(version,"version is required")); setLastUpdate(required(lastUpdate,"version is required")); setReference(required(reference,"reference is required")); setName(name); }</code><technical_language>remove private setters? necessary private setters, reduce size of class</technical_language>

Target:
public CountryVersion(String uid, String country, int version, Date lastUpdate, String reference, String name) { this.uid = (required(uid, "UID is required")); this.country = (required(country, "country is required")); this.version = (required(version, "version is required")); this.lastUpdate = (required(lastUpdate, "version is required")); this.reference = (required(reference, "reference is required")); this.name = name; }
Source:
<code>public static String loadFile(String path) { String result = ""; Scanner sc = new Scanner(ResourcesUtil.class.getClassLoader().getResourceAsStream(path)); while (sc.hasNextLine()) { result += sc.nextLine(); } <START> sc.close(); <END> return result; }</code><technical_language>try/finally</technical_language>

Target:
public static String loadFile(String path) { String result = ""; Scanner sc = null; try { sc = new Scanner(ResourcesUtil.class.getClassLoader().getResourceAsStream(path)); while (sc.hasNextLine()) { result += sc.nextLine(); } sc.close(); } finally { if (sc != null) { sc.close(); } } return result; }
Source:
<code>public AbstractListDataView<T> addItem(T item) { final ListDataProvider<T> dataProvider = getDataProvider(); <START> if (!contains(item)) { <END> dataProvider.getItems().add(item); dataProvider.refreshAll(); } return this; }</code><technical_language>do public contains(T item) calls a private boolean contains(ListDataProvider<T> dataProvider, T item) instead of creating dataProvider itself? This increase performance especially if call containsinside a loop in addItems, addItemsAfter addItemsBefore</technical_language>

Target:
public AbstractListDataView<T> addItem(T item) { final ListDataProvider<T> dataProvider = getDataProvider(); if (!contains(item, dataProvider)) { dataProvider.getItems().add(item); dataProvider.refreshAll(); } return this; }
Source:
<code>public Principal authenticate(HttpServletRequest request) throws AuthenticationException { String header = nullToEmpty(request.getHeader(AUTHORIZATION)); int space = header.indexOf(' '); if ((space < 0) || !header.substring(0, space).equalsIgnoreCase("bearer")) { throw needAuthentication(null); } String token = header.substring(space + 1).trim(); try { Jws<Claims> claimsJws = jwtParser.parseClaimsJws(token); String subject = claimsJws.getBody().getSubject(); return new BasicPrincipal(subject); } <START> catch (RuntimeException e) { <END> throw new RuntimeException("Authentication error", e); } }</code><technical_language>This needs catch JwtException (and others) call needAuthentication() message. A RuntimeException thrown authenticate() server return a 500, happen if is internal error, due expired token similar</technical_language>

Target:
public Principal authenticate(HttpServletRequest request) throws AuthenticationException { String header = nullToEmpty(request.getHeader(AUTHORIZATION)); int space = header.indexOf(' '); if ((space < 0) || !header.substring(0, space).equalsIgnoreCase("bearer")) { throw needAuthentication(null); } String token = header.substring(space + 1).trim(); if (token.isEmpty()) { throw needAuthentication(null); } try { Jws<Claims> claimsJws = jwtParser.parseClaimsJws(token); String subject = claimsJws.getBody().getSubject(); return new BasicPrincipal(subject); } catch (JwtException e) { throw needAuthentication(e.getMessage()); } catch (RuntimeException e) { throw new RuntimeException("Authentication error", e); } }
Source:
<code>private synchronized RedisConnection getRedisConnection() throws Exception { try { RedisConnection connection = redisClient.connect(new ByteArrayCodec()); logger.info("Redis Connection is Opened"); return connection; <START> } catch (Exception e) { <END> logger.error("Exception Occurred while connecting to the server", e); throw e; } }</code><technical_language>need for a try/catch here</technical_language>

Target:
private synchronized RedisConnection getRedisConnection() { RedisConnection connection = redisClient.connect(new ByteArrayCodec()); logger.info("Redis Connection is Opened"); return connection; }
Source:
<code><START> private static boolean isReloadable(String optionName) throws SecurityException, NoSuchFieldException { <END> return ConfigValues.class.getField(optionName).isAnnotationPresent(Reloadable.class); }</code><technical_language>SecurityException? is unchekced.</technical_language>

Target:
private static boolean isReloadable(String optionName) throws NoSuchFieldException { return ConfigValues.class.getField(optionName).isAnnotationPresent(Reloadable.class); }
Source:
<code>public String[] getCriteriaNames() { <START> criteriaList.put("a", a); <END> criteriaList.put("b", b); criteriaList.put("c", c); criteriaList.put("d", d); criteriaList.put("e", e); criteriaList.put("f", f); criteriaList.put("g", g); criteriaList.put("h", h); String[] criteria = new String[100]; int i = 0; String[] letter = {"A", "B"}; HashMap<String, Integer> sub = new HashMap<String, Integer>(); sub.put("b5", 2); for(Map.Entry<String, int[]> entry: criteriaList.entrySet()){ for(int j : entry.getValue()){ if(sub.containsKey(entry.getKey() + String.valueOf(j))){ for(int k = 0; k < sub.get(entry.getKey() + String.valueOf(j)); k++){ criteria[i] = "170.314 (" + entry.getKey() + ")(" + j + ")(" + letter[k] + ")"; i++; } }else{ criteria[i] = "170.314 (" + entry.getKey() + ")(" + j + ")"; i++; } } } return criteria; }</code><technical_language>Agreed. In months idea re-read stuff</technical_language>

Target:
public String[] getCriteriaNames() { return this.criteriaNames; }
Source:
<code>public void updateMappingsConcurrently() throws InterruptedException { final VControl control = VViewFactory.eINSTANCE.createControl(); final EObject domainObject = EcoreUtil.create(EcorePackage.eINSTANCE.getEClass()); final SettingToControlMapperImpl settingToControlMapper = new SettingToControlMapperImpl( new EMFFormsMappingProviderManager() { @Override public Set<UniqueSetting> getAllSettingsFor(VDomainModelReference domainModelReference, EObject domainObject) { final Set<UniqueSetting> settings = new LinkedHashSet<UniqueSetting>(); settings.add( UniqueSetting.createSetting(domainObject, EcorePackage.eINSTANCE.getEClass_EAttributes())); return settings; } }, new FakeViewContext(domainObject, control)); final List<Throwable> exceptions = Collections.synchronizedList(new ArrayList<Throwable>()); final ArrayList<Runnable> runnables = new ArrayList<Runnable>(); for (int i = 0; i < NR_RUNNABLES; i++) { runnables.add(new Runnable() { @Override public void run() { try { int j = 0; while (j < NR_UPDATES) { settingToControlMapper.updateControlMapping(control); Thread.sleep(1); j += 1; } } catch (final Exception exception) { exceptions.add(exception); END SUPRESS CATCH EXCEPTION } } }); } final ExecutorService newFixedThreadPool = Executors.newFixedThreadPool(runnables.size()); for (final Runnable runnable : runnables) { newFixedThreadPool.submit(runnable); } <START> assertTrue(exceptions.isEmpty()); <END> }</code><technical_language>This assertion runnables finished, it? I need a CountDownLatch lines</technical_language>

Target:
public void updateMappingsConcurrently() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(NR_RUNNABLES); final VControl control = VViewFactory.eINSTANCE.createControl(); final EObject domainObject = EcoreUtil.create(EcorePackage.eINSTANCE.getEClass()); final SettingToControlMapperImpl settingToControlMapper = new SettingToControlMapperImpl( new EMFFormsMappingProviderManager() { @Override public Set<UniqueSetting> getAllSettingsFor(VDomainModelReference domainModelReference, EObject domainObject) { final Set<UniqueSetting> settings = new LinkedHashSet<UniqueSetting>(); settings.add( UniqueSetting.createSetting(domainObject, EcorePackage.eINSTANCE.getEClass_EAttributes())); return settings; } }, new FakeViewContext(domainObject, control)); final List<Throwable> exceptions = Collections.synchronizedList(new ArrayList<Throwable>()); final ArrayList<Runnable> runnables = new ArrayList<Runnable>(); for (int i = 0; i < NR_RUNNABLES; i++) { runnables.add(new Runnable() { @Override public void run() { try { int j = 0; while (j < NR_UPDATES) { settingToControlMapper.updateControlMapping(control); Thread.sleep(1); j += 1; } latch.countDown(); } catch (final Exception exception) { exceptions.add(exception); END SUPRESS CATCH EXCEPTION } } }); } final ExecutorService newFixedThreadPool = Executors.newFixedThreadPool(runnables.size()); for (final Runnable runnable : runnables) { newFixedThreadPool.submit(runnable); } latch.await(); assertTrue(exceptions.isEmpty()); }
Source:
<code>protected void setupEventRouting(EventRouting<UserId> routing) { super.setupEventRouting(routing); <START> routing.route(RUserSignedIn.class, (e, ctx) -> ImmutableSet.of(e.getUserId())); <END> routing.route(RUserConsentRequested.class, (e, ctx) -> ImmutableSet.of(e.getUserId())); }</code><technical_language>Please EventRoute.withId()</technical_language>

Target:
protected void setupEventRouting(EventRouting<UserId> routing) { super.setupEventRouting(routing); routing.route(RUserSignedIn.class, (e, ctx) -> withId(e.getUserId())); routing.route(RUserConsentRequested.class, (e, ctx) -> withId(e.getUserId())); }
Source:
<code>public static void cleanUp() { fLogger.removeAllAppenders(); <START> fFileLocation.delete(); <END> }</code><technical_language>removing tearDown() project is deleted</technical_language>

Target:
public static void cleanUp() { fLogger.removeAllAppenders(); fFileLocation.delete(); tearDown(); }
Source:
<code>public Void visitAggregation(AggregationNode node, ImmutableList.Builder<RowExpression> context) { node.getAggregations().values() .forEach(aggregation -> { <START> aggregation.getArguments().stream() <END> .map(OriginalExpressionUtils::castToRowExpression) .forEach(context::add); aggregation.getFilter().map(OriginalExpressionUtils::castToRowExpression).ifPresent(context::add); aggregation.getOrderBy().map(OrderingScheme::getOrderBy).orElse(ImmutableList.of()) .stream().map(Symbol::toSymbolReference).map(OriginalExpressionUtils::castToRowExpression).forEach(context::add); }); return super.visitAggregation(node, context); }</code><technical_language>argument line java aggregation.getArguments() .stream() .map(OriginalExpressionUtils::castToRowExpression) .forEach(context::add); aggregation.getFilter().map(OriginalExpressionUtils::castToRowExpression).ifPresent(context::add); aggregation.getOrderBy() .map(OrderingScheme::getOrderBy) .orElse(ImmutableList.of()) .stream() .map(Symbol::toSymbolReference) .map(OriginalExpressionUtils::castToRowExpression) .forEach(context::add);</technical_language>

Target:
public Void visitAggregation(AggregationNode node, ImmutableList.Builder<RowExpression> context) { node.getAggregations().values() .forEach(aggregation -> { aggregation.getArguments().forEach(context::add); aggregation.getFilter().ifPresent(context::add); aggregation.getOrderBy() .map(OrderingScheme::getOrderBy) .orElse(ImmutableList.of()) .forEach(context::add); }); return super.visitAggregation(node, context); }
Source:
<code>public void setup() { <START> Signature signature = new Signature("$operator$CAST", FunctionKind.SCALAR, RowType.anonymous(fromFieldTypes).getTypeSignature(), RowType.anonymous(toFieldTypes).getTypeSignature()); <END> List<RowExpression> projections = ImmutableList.of( new CallExpression(signature, RowType.anonymous(fromFieldTypes), ImmutableList.of(field(0, RowType.anonymous(toFieldTypes))))); MetadataManager metadata = MetadataManager.createTestMetadataManager(); pageProcessor = new ExpressionCompiler(metadata, new PageFunctionCompiler(metadata, 0)) .compilePageProcessor(Optional.empty(), projections) .get(); Block[] fieldBlocks = fromFieldTypes.stream() .map(type -> createBlock(POSITION_COUNT, type)) .toArray(Block[]::new); Block rowBlock = RowBlock.fromFieldBlocks(new boolean[POSITION_COUNT], fieldBlocks); page = new Page(rowBlock); }</code><technical_language>static import SCALAR</technical_language>

Target:
public void setup() { Signature signature = new Signature("$operator$CAST", SCALAR, RowType.anonymous(fromFieldTypes).getTypeSignature(), RowType.anonymous(toFieldTypes).getTypeSignature()); List<RowExpression> projections = ImmutableList.of( new CallExpression(signature, RowType.anonymous(fromFieldTypes), ImmutableList.of(field(0, RowType.anonymous(toFieldTypes))))); MetadataManager metadata = MetadataManager.createTestMetadataManager(); pageProcessor = new ExpressionCompiler(metadata, new PageFunctionCompiler(metadata, 0)) .compilePageProcessor(Optional.empty(), projections) .get(); Block[] fieldBlocks = fromFieldTypes.stream() .map(type -> createBlock(POSITION_COUNT, type)) .toArray(Block[]::new); Block rowBlock = fromFieldBlocks(new boolean[POSITION_COUNT], fieldBlocks); page = new Page(rowBlock); }
Source:
<code><START> public SelectorResolutionResult(Status status, Throwable throwable) { <END> this.status = status; this.throwable = throwable; }</code><technical_language>Comparing [TestExecutionResult](<LINK_0> this Constructor private</technical_language>

Target:
private SelectorResolutionResult(Status status, Throwable throwable) { this.status = status; this.throwable = throwable; }
Source:
<code><START> public long getDiskCount() { <END> long count = 0; for (Datacenter datacenter : datacenters) { for (DataNode dataNode : datacenter.getDataNodes()) { count += dataNode.getDisks().size(); } } return count; }</code><technical_language>invokes minute. expensive for a cluster resources</technical_language>

Target:
public long getDiskCount() { return diskCount; }
Source:
<code>public Single<String> getTextForBadge(EvaluationContext ec) { <START> final EvaluationContext[] abandonableContext = <END> new EvaluationContext[] {ec.spawnWithCleanLifecycle()}; if (display.getBadgeText() == null) { return Single.just(""); } return Single.fromCallable(new Callable<String>() { @Override public String call() throws Exception { return display.getBadgeText().evaluate(abandonableContext[0]); } }).doOnDispose(new Action() { @Override public void run() throws Exception { abandonableContext[0].signalAbandoned(); abandonableContext[0] = null; } }); }</code><technical_language>is reason for making this array of ECs</technical_language>

Target:
public Single<String> getTextForBadge(EvaluationContext ec) { if (display.getBadgeText() == null) { return Single.just(""); } return display.getBadgeText().getDisposableSingleForEvaluation(ec); }
Source:
<code>public void testCluster() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.getInterfaces().addInterface("127.0.0.1"); networkConfig.getJoin().getMulticastConfig().setEnabled(false); networkConfig.getJoin().getTcpIpConfig().setEnabled(true).addMember("127.0.0.1"); try { HazelcastInstance hz1 = Hazelcast.newHazelcastInstance(config); HazelcastInstance hz2 = Hazelcast.newHazelcastInstance(config); hz1.getMap("test").put("a", "b"); assertClusterSize(2, hz1, hz2); HazelcastInstance client = HazelcastClient.newHazelcastClient(); assertEquals("b", client.getMap("test").get("a")); } finally { HazelcastInstanceFactory.terminateAll(); <START> HazelcastClient.shutdownAll(); <END> } }</code><technical_language>I shutdown clients first, disconnect exceptions in log, unwanted noise</technical_language>

Target:
public void testCluster() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.getInterfaces().addInterface("127.0.0.1"); networkConfig.getJoin().getMulticastConfig().setEnabled(false); networkConfig.getJoin().getTcpIpConfig().setEnabled(true).addMember("127.0.0.1"); HazelcastInstance hz1 = Hazelcast.newHazelcastInstance(config); HazelcastInstance hz2 = Hazelcast.newHazelcastInstance(config); hz1.getMap("test").put("a", "b"); assertClusterSize(2, hz1, hz2); HazelcastInstance client = HazelcastClient.newHazelcastClient(); assertEquals("b", client.getMap("test").get("a")); }
Source:
<code>public SimpleCertificateResponseMessageType undoImportKeystore(ImportCertificateChainRequestMessageType request) { if (StringUtils.isBlank(request.getAlias()) || null == request.getRootCert() || CollectionUtils.isEmpty(request.getIntermediateList())) { <START> return buildSimpleResponse(false, "Undo import in KeyStore required Alias, CA Root and CA Intermediate."); <END> } try{ Map<String, Certificate> removeCerts = convertCertificateMap(request.getAlias(), request); removeCertificatesFrom(getTempKeystore(), removeCerts.values()); saveTempKeystore(); } catch (UtilException | KeyStoreException | CertificateManagerException ex) { LOG.error("Error occured on undo import in temporary KeyStore: {}", ex.getLocalizedMessage(), ex); return buildSimpleResponse(false, "Error occured on undo import in temporary KeyStore."); } return buildSimpleResponse(true, "Undo import in temporary Keystore successful."); }</code><technical_language>"Undoing import requires Alias, CA Root, Intermediate certificates"</technical_language>

Target:
public SimpleCertificateResponseMessageType undoImportKeystore(ImportCertificateChainRequestMessageType request) { if (null == request.getRootCert() || CollectionUtils.isEmpty(request.getIntermediateList())) { return buildSimpleResponse(false, "Undoing an import requires the CA Root, and Intermediate certificates."); } try{ Map<String, Certificate> removeCerts = convertCertificateMap("noalias", request); removeCertificatesFrom(getTempKeystore(), removeCerts.values()); saveTempKeystore(); } catch (UtilException | KeyStoreException | CertificateManagerException ex) { LOG.error("Error occured on undo import in temporary KeyStore: {}", ex.getLocalizedMessage(), ex); return buildSimpleResponse(false, "Error occured on undo import in temporary KeyStore."); } return buildSimpleResponse(true, "Undo import in temporary Keystore successful."); }
Source:
<code>public ImmutableCollection<EntityRecord> readAllByType(final TypeUrl type, FieldMask fieldMask) { final Map<AggregateStateId, EntityRecord> allRecords = readAll(fieldMask); final Map<AggregateStateId, EntityRecord> resultMap = Maps.filterKeys( allRecords, new Predicate<AggregateStateId>() { @Override <START> public boolean apply(@Nullable AggregateStateId stateId) { <END> checkNotNull(stateId); final boolean typeMatches = stateId.getStateType() .equals(type); return typeMatches; } }); final ImmutableList<EntityRecord> result = ImmutableList.copyOf(resultMap.values()); return result; }</code><technical_language>unformatted. Maybe, a GitHub bug</technical_language>

Target:
public ImmutableCollection<EntityRecord> readAllByType(final TypeUrl type, FieldMask fieldMask) { final Map<AggregateStateId, EntityRecord> allRecords = readAll(fieldMask); final Map<AggregateStateId, EntityRecord> resultMap = filterByType(allRecords, type); final ImmutableList<EntityRecord> result = ImmutableList.copyOf(resultMap.values()); return result; }
Source:
<code>public void onEquipped(ItemStack itemstack, EntityLivingBase player) { if (!player.worldObj.isRemote) { <START> player.worldObj.playAuxSFXAtEntity((EntityPlayer) player, 1, new BlockPos(player.posX, player.posY, player.posZ), 1); <END> } }</code><technical_language>SoundEvent instead</technical_language>

Target:
public void onEquipped(ItemStack itemstack, EntityLivingBase player) { if (!player.worldObj.isRemote) { player.playSound(SoundEvents.item_armor_equip_diamond, 0.1F, 1.3f); } }
Source:
<code>public void init(MessageLocation messageLocation) { <START> <END> }</code><technical_language>do getJsonTextArea().setText(messageLocation.getValue()); original payload default</technical_language>

Target:
public void init(MessageLocation messageLocation) { getJsonTextArea().setText(messageLocation.getValue()); }
Source:
<code>public boolean canEditPipeline(String pipelineName, Username username) { <START> if (getCurrentConfig().hasPipelineNamed(new CaseInsensitiveString(pipelineName)) && <END> isUserAdminOfGroup(username.getUsername(), findGroupNameByPipeline(new CaseInsensitiveString(pipelineName)))) { return true; } return false; }</code><technical_language>getCurrentConfig().hasPipelineNamed internally getPipelineConfigByName list of pipeline-groups slow. change implementation of hasPipelineNamed pipelineConfigByName. pipelineConfigByName a cached map get this information</technical_language>

Target:
public boolean canEditPipeline(String pipelineName, Username username) { if (pipelineExists(pipelineName) && isUserAdminOfGroup(username.getUsername(), findGroupNameByPipeline(new CaseInsensitiveString(pipelineName)))) { return true; } return false; }
Source:
<code>public List<SourceRecord> poll() { if (!stopped) { if (throttler.shouldThrottle(seqno - startingSeqno, System.currentTimeMillis())) { throttler.throttle(); } taskHandle.record(batchSize); return LongStream.range(0, batchSize) .mapToObj(i -> new SourceRecord( Collections.singletonMap("task.id", taskId), Collections.singletonMap("saved", ++seqno), topicName, null, Schema.STRING_SCHEMA, "key-" + taskId + "-" + seqno, Schema.STRING_SCHEMA, "value-" + taskId + "-" + seqno)) .collect(Collectors.toList()); } else { <START> log.info("Task stopped but still going: {}", stopped); <END> } return null; }</code><technical_language>nit: of stopped clarity here. taskId</technical_language>

Target:
public List<SourceRecord> poll() { if (!stopped) { if (throttler.shouldThrottle(seqno - startingSeqno, System.currentTimeMillis())) { throttler.throttle(); } taskHandle.record(batchSize); return LongStream.range(0, batchSize) .mapToObj(i -> new SourceRecord( Collections.singletonMap("task.id", taskId), Collections.singletonMap("saved", ++seqno), topicName, null, Schema.STRING_SCHEMA, "key-" + taskId + "-" + seqno, Schema.STRING_SCHEMA, "value-" + taskId + "-" + seqno)) .collect(Collectors.toList()); } return null; }
Source:
<code>private boolean validateCanUpdateShareable() { if (DiskStorageType.LUN == getOldDisk().getDiskStorageType()) { return true; } if (!isVmNotInPreviewSnapshot()) { return false; } if (isUpdatedToShareable(getOldDisk(), getNewDisk())) { <START> StorageDomain storageDomain = getStorageDomainDAO().get(((DiskImage)getNewDisk()).getStorageIds().get(0)); <END> if (storageDomain.getStorageType() == StorageType.GLUSTERFS) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN); } List<DiskImage> diskImageList = getDiskImageDao().getAllSnapshotsForImageGroup(getOldDisk().getId()); if ((diskImageList.size() > 1) || !Guid.Empty.equals(((DiskImage) getOldDisk()).getImageTemplateId())) { return failCanDoAction(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_FOR_DISK); } if (!isVersionSupportedForShareable(getOldDisk(), getStoragePoolDAO().get(getVm().getStoragePoolId()) .getcompatibility_version() .getValue())) { return failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); } if (!isVolumeFormatSupportedForShareable(((DiskImage) getNewDisk()).getVolumeFormat())) { return failCanDoAction(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT); } } else if (isUpdatedToNonShareable(getOldDisk(), getNewDisk())) { if (vmsDiskOrSnapshotAttachedTo.size() > 1) { return failCanDoAction(VdcBllMessages.DISK_IS_ALREADY_SHARED_BETWEEN_VMS); } } return true; }</code><technical_language>please check getOldDisk</technical_language>

Target:
private boolean validateCanUpdateShareable() { if (DiskStorageType.LUN == getOldDisk().getDiskStorageType()) { return true; } if (!isVmNotInPreviewSnapshot()) { return false; } if (isUpdatedToShareable(getOldDisk(), getNewDisk())) { StorageDomainStatic sds = getStorageDomainStaticDAO().get(((DiskImage)getNewDisk()).getStorageIds().get(0)); if (sds.getStorageType() == StorageType.GLUSTERFS) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN); } List<DiskImage> diskImageList = getDiskImageDao().getAllSnapshotsForImageGroup(getOldDisk().getId()); if ((diskImageList.size() > 1) || !Guid.Empty.equals(((DiskImage) getOldDisk()).getImageTemplateId())) { return failCanDoAction(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_FOR_DISK); } if (!isVersionSupportedForShareable(getOldDisk(), getStoragePoolDAO().get(getVm().getStoragePoolId()) .getcompatibility_version() .getValue())) { return failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); } if (!isVolumeFormatSupportedForShareable(((DiskImage) getNewDisk()).getVolumeFormat())) { return failCanDoAction(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT); } } else if (isUpdatedToNonShareable(getOldDisk(), getNewDisk())) { if (vmsDiskOrSnapshotAttachedTo.size() > 1) { return failCanDoAction(VdcBllMessages.DISK_IS_ALREADY_SHARED_BETWEEN_VMS); } } return true; }
Source:
<code>private Map<String, String> buildSamHeaderParameters(final List<String> barcodes) { final Map<String, String> params = new LinkedHashMap<>(); String platformUnit = RUN_BARCODE + "." + LANE; if (barcodes != null) { final String barcodeString = IlluminaUtil.barcodeSeqsToString(barcodes); <START> platformUnit += ("." + barcodeString); <END> if (INCLUDE_BC_IN_RG_TAG) params.put("BC", barcodeString); } if (PLATFORM != null) { params.put(SAMReadGroupRecord.PLATFORM_TAG, PLATFORM); } params.put(SAMReadGroupRecord.PLATFORM_UNIT_TAG, platformUnit); if (SEQUENCING_CENTER != null) params.put(SAMReadGroupRecord.SEQUENCING_CENTER_TAG, SEQUENCING_CENTER); params.put(SAMReadGroupRecord.DATE_RUN_PRODUCED_TAG, RUN_START_DATE == null ? null : new Iso8601Date(RUN_START_DATE).toString()); return params; }</code><technical_language>unnecessary ( )s</technical_language>

Target:
private Map<String, String> buildSamHeaderParameters(final List<String> barcodes) { final Map<String, String> params = new LinkedHashMap<>(); String platformUnit = RUN_BARCODE + "." + LANE; if (barcodes != null) { final String barcodeString = IlluminaUtil.barcodeSeqsToString(barcodes); platformUnit += "." + barcodeString; if (INCLUDE_BC_IN_RG_TAG) { params.put("BC", barcodeString); } } if (PLATFORM != null) { params.put(SAMReadGroupRecord.PLATFORM_TAG, PLATFORM); } params.put(SAMReadGroupRecord.PLATFORM_UNIT_TAG, platformUnit); if (SEQUENCING_CENTER != null) { params.put(SAMReadGroupRecord.SEQUENCING_CENTER_TAG, SEQUENCING_CENTER); } params.put(SAMReadGroupRecord.DATE_RUN_PRODUCED_TAG, RUN_START_DATE == null ? null : new Iso8601Date(RUN_START_DATE).toString()); return params; }
Source:
<code>public void setToolchain( Toolchain toolchain ) throws Exception { Field toolchainField = AbstractSurefireMojo.class.getDeclaredField( "toolchain" ); <START> toolchainField.setAccessible( true ); <END> toolchainField.set( this, toolchain ); }</code><technical_language>pls substitute lines setInternalState( this, "toolchain", toolchain );</technical_language>

Target:
public void setToolchain( Toolchain toolchain ) throws Exception { setInternalState( this, "toolchain", toolchain ); }
Source:
<code><START> public final MessageSerializer getDefaultSerializer() { <END> if (null == this.defaultSerializer) { this.defaultSerializer = getSerializer(false, false); } return defaultSerializer; }</code><technical_language>this synchronized</technical_language>

Target:
public final MessageSerializer getDefaultSerializer() { if (null == this.defaultSerializer) { synchronized(this) { if (null == this.defaultSerializer) { this.defaultSerializer = getSerializer(false, false); } } } return defaultSerializer; }
Source:
<code>public void testGet() throws Exception { final IgniteCache<Integer, Integer> cache = grid(2).getOrCreateCache(getConfig()); for (TransactionConcurrency concurrency : TransactionConcurrency.values()) for (TransactionIsolation isolation : TransactionIsolation.values()) { try (Transaction tx = grid(2).transactions().txStart(concurrency, isolation)) { <START> info(concurrency + " " + isolation); <END> tx.savepoint("sp"); assertEquals("Broken savepoint in " + concurrency + " " + isolation + " transaction.", null, cache.get(1)); tx.rollbackToSavepoint("sp"); IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return cache.putIfAbsentAsync(1, 1).get(); } },cacheMode().name()+"_get"); assertTrue(fut.get(3_000)); assertEquals("Broken multithreaded rollback to savepoint in " + concurrency + " " + isolation + " transaction.", (Integer) 1, cache.get(1)); tx.commit(); } finally { cache.remove(1); } } }</code><technical_language>info("Starting transaction .... )</technical_language>

Target:
public void testGet() throws Exception { executeTestForAllCaches( new CIX3<NodeCombination, IgniteCache<Integer, Integer>, CacheConfiguration<Integer, Integer>>() { @Override public void applyx( NodeCombination nodes, IgniteCache<Integer, Integer> cache, CacheConfiguration<Integer, Integer> cfg) throws IgniteCheckedException { int key = generateKey(cfg, nodes.primaryForKey()); IgniteCache<Integer, Integer> cacheAsync = nodes.anotherTxOwner().getOrCreateCache(cfg); for (TxType txType : txTypes) { info("Transaction type [" + txType + ']'); try (Transaction tx = nodes.txOwner().transactions().txStart(txType.concurrency, txType.isolation)) { tx.savepoint("sp"); assertEquals("Broken savepoint in " + txType.concurrency + ' ' + txType.isolation + " transaction.", null, cache.get(key)); tx.rollbackToSavepoint("sp"); IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(() -> cacheAsync.putIfAbsent(key, 1), cacheMode().name() + "_get"); assertTrue(fut.get(FUT_TIMEOUT)); assertEquals("Broken multithreaded rollback to savepoint in " + txType.concurrency + ' ' + txType.isolation + " transaction.", (Integer)1, cache.get(key)); tx.commit(); } finally { cache.remove(key); } } }}); }
Source:
<code>public void testListRemote_Smart_DetachedHEAD() throws Exception { Repository src = remoteRepository.getRepository(); RefUpdate u = src.updateRef(Constants.HEAD, true); RevCommit Q = remoteRepository.commit().message("Q").create(); u.setNewObjectId(Q); assertEquals(RefUpdate.Result.FORCED, u.forceUpdate()); Repository dst = createBareRepository(); Ref head; <START> try (Transport t = Transport.open(dst, smartAuthNoneURI)) { try (FetchConnection c = t.openFetch()) { <END> head = c.getRef(Constants.HEAD); } } assertNotNull("has " + Constants.HEAD, head); assertEquals(Q, head.getObjectId()); }</code><technical_language>this one</technical_language>

Target:
public void testListRemote_Smart_DetachedHEAD() throws Exception { Repository src = remoteRepository.getRepository(); RefUpdate u = src.updateRef(Constants.HEAD, true); RevCommit Q = remoteRepository.commit().message("Q").create(); u.setNewObjectId(Q); assertEquals(RefUpdate.Result.FORCED, u.forceUpdate()); Repository dst = createBareRepository(); Ref head; try (Transport t = Transport.open(dst, smartAuthNoneURI); FetchConnection c = t.openFetch()) { head = c.getRef(Constants.HEAD); } assertNotNull("has " + Constants.HEAD, head); assertEquals(Q, head.getObjectId()); }
Source:
<code>private PageMode getMode() { final PageMode currentMode = PageMode.get(request); return currentMode.showLive ? currentMode : <START> APILocator.getHTMLPageAssetRenderedAPI().getDefaultEditPageMode(user, request, uri, response); <END> }</code><technical_language>removing response, some of figured out is request coming response, if is this time, in future</technical_language>

Target:
private PageMode getMode() { final PageMode currentMode = PageMode.get(request); return currentMode.showLive ? currentMode : APILocator.getHTMLPageAssetRenderedAPI().getDefaultEditPageMode(user, request, uri); }
Source:
<code>private boolean outerScopeIsImmutable() { <START> if (getFirstOuterMixin() == null) { <END> return true; } return getFirstOuterMixin().allSlotsAreImmutable && getFirstOuterMixin().outerScopeIsImmutable(); }</code><technical_language>isModule()? unrelated change improvement, I noticed, getContext() instead of getFirstOuterMixin()</technical_language>

Target:
private boolean outerScopeIsImmutable() { if (isModule()) { return true; } return outerMixin.allSlotsAreImmutable && outerMixin.outerScopeIsImmutable(); }