auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void transform(StructuredRecord in, Emitter<StructuredRecord> emitter) throws Exception { StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); Schema inSchema = in.getSchema(); List<Field> inFields = inSchema.getFields(); <START> try { <END> for (Field field : inFields) { String name = field.getName(); if (!outSchemaMap.containsKey(name)) { continue; } Schema.Type outFieldType = outSchemaMap.get(name); if (!decodeMap.containsKey(name) || decodeMap.get(name) == DecoderType.NONE) { builder.set(name, in.get(name)); } else { byte[] obj = new byte[0]; if (field.getSchema().getType() == Schema.Type.STRING) { obj = ((String) in.get(name)).getBytes(); } else if (field.getSchema().getType() == Schema.Type.BYTES) { obj = in.get(name); } byte[] outValue = new byte[0]; DecoderType type = decodeMap.get(name); if (type == DecoderType.STRING_BASE32 || type == DecoderType.BASE32) { outValue = base32Decoder.decode(obj); } else if (type == DecoderType.STRING_BASE64 || type == DecoderType.BASE64) { outValue = base64Decoder.decode(obj); } else if (type == DecoderType.HEX) { outValue = hexDecoder.decode(obj); } if (outFieldType == Schema.Type.BYTES) { builder.set(name, outValue); } else if (outFieldType == Schema.Type.STRING) { builder.set(name, new String(outValue, "UTF-8")); } } } emitter.emit(builder.build()); } catch (Exception e) { emitter.emitError(new InvalidEntry<>(31, e.getStackTrace()[0].toString() + " : " + e.getMessage(), in)); } }</code><technical_language>remove generic try/catch wrapper for this function</technical_language>

Target:
public void transform(StructuredRecord in, Emitter<StructuredRecord> emitter) throws Exception { StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); Schema inSchema = in.getSchema(); List<Field> inFields = inSchema.getFields(); for (Field field : inFields) { String name = field.getName(); if (!outSchemaMap.containsKey(name)) { continue; } Schema.Type outFieldType = outSchemaMap.get(name); if (!decodeMap.containsKey(name) || decodeMap.get(name) == DecoderType.NONE) { builder.set(name, in.get(name)); } else { byte[] obj = new byte[0]; if (field.getSchema().getType() == Schema.Type.STRING) { obj = ((String) in.get(name)).getBytes(); } else if (field.getSchema().getType() == Schema.Type.BYTES) { obj = in.get(name); } byte[] outValue = new byte[0]; DecoderType type = decodeMap.get(name); if (type == DecoderType.STRING_BASE32 || type == DecoderType.BASE32) { outValue = base32Decoder.decode(obj); } else if (type == DecoderType.STRING_BASE64 || type == DecoderType.BASE64) { outValue = base64Decoder.decode(obj); } else if (type == DecoderType.HEX) { outValue = hexDecoder.decode(obj); } if (outFieldType == Schema.Type.BYTES) { builder.set(name, outValue); } else if (outFieldType == Schema.Type.STRING) { builder.set(name, new String(outValue, "UTF-8")); } } } emitter.emit(builder.build()); }
Source:
<code>public Map<String, ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle connectorTableHandle) { KuduTableHandle tableHandle = fromConnectorTableHandle(session, connectorTableHandle); Schema schema = clientSession.getTableSchema(tableHandle); ImmutableMap.Builder<String, ColumnHandle> columnHandles = ImmutableMap.builder(); <START> for (int i = 0; i < schema.getColumnCount(); i++) { <END> ColumnSchema col = schema.getColumnByIndex(i); String name = col.getName(); Type type = TypeHelper.fromKuduColumn(col); KuduColumnHandle columnHandle = new KuduColumnHandle(name, i, type); columnHandles.put(name, columnHandle); } return columnHandles.build(); }</code><technical_language>s/i/oridinal</technical_language>

Target:
public Map<String, ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle connectorTableHandle) { KuduTableHandle tableHandle = (KuduTableHandle) connectorTableHandle; Schema schema = clientSession.getTableSchema(tableHandle); ImmutableMap.Builder<String, ColumnHandle> columnHandles = ImmutableMap.builder(); for (int ordinal = 0; ordinal < schema.getColumnCount(); ordinal++) { ColumnSchema col = schema.getColumnByIndex(ordinal); String name = col.getName(); Type type = TypeHelper.fromKuduColumn(col); KuduColumnHandle columnHandle = new KuduColumnHandle(name, ordinal, type); columnHandles.put(name, columnHandle); } return columnHandles.build(); }
Source:
<code>public void makeBucket(MakeBucketArgs args) throws InvalidBucketNameException, RegionConflictException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException, IOException { if ((args == null)) { throw new IllegalArgumentException("null value is not allowed in arguments"); } <START> String region = null; <END> if (args.region() != null && !args.region().isEmpty()) { region = args.region(); } else if (this.region != null && !this.region.isEmpty()) { region = this.region; } else { region = US_EAST_1; } if (this.region != null && !this.region.equals(region)) { throw new RegionConflictException( "passed region conflicts with the one previously specified"); } CreateBucketConfiguration config = null; if (!region.equals(US_EAST_1)) { config = new CreateBucketConfiguration(region); } Map<String, String> headerMap = null; if (args.objectLock()) { headerMap = new HashMap<>(); headerMap.put("x-amz-bucket-object-lock-enabled", "true"); } Response response = executePut(args.bucketName(), null, region, headerMap, null, config, 0); response.body().close(); }</code><technical_language>initialize US_EAST_1 null remove else part</technical_language>

Target:
public void makeBucket(MakeBucketArgs args) throws InvalidBucketNameException, RegionConflictException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException, IOException { if (args == null) { throw new IllegalArgumentException("null value is not allowed in arguments"); } String region = US_EAST_1; if (args.region() != null && !args.region().isEmpty()) { region = args.region(); } else if (this.region != null && !this.region.isEmpty()) { region = this.region; } if (this.region != null && !this.region.equals(region)) { throw new RegionConflictException( "passed region conflicts with the one previously specified"); } CreateBucketConfiguration config = null; if (!region.equals(US_EAST_1)) { config = new CreateBucketConfiguration(region); } Map<String, String> headerMap = null; if (args.objectLock()) { headerMap = new HashMap<>(); headerMap.put("x-amz-bucket-object-lock-enabled", "true"); } Response response = executePut(args.bucketName(), null, region, headerMap, null, config, 0); response.body().close(); }
Source:
<code>public UnweightedDoubleReservoirSample(int maxSamples) { this.maxSamples = maxSamples; checkArguments(); this.elements = new double[0]; <START> } <END></code><technical_language>inline checkArguments() move assignment - cap maxSamples reasonable; allow people collect billions of samples private static final int MAX_SAMPLES_LIMIT = 1_000_000; private final int maxSamples; private long count; private double[] elements; public UnweightedDoubleReservoirSample(int maxSamples) { checkArgument(maxSamples > 0, "Number of reservoir samples strictly positive"); checkArgument(maxSamples < MAX_SAMPLES_LIMIT, "Number of reservoir samples exceed " + MAX_SAMPLES_LIMIT); this.maxSamples = maxSamples; ..</technical_language>

Target:
public UnweightedDoubleReservoirSample(int maxSamples) { checkArgument(maxSamples > 0, "Cannot use 0 number of samples for a reservoir"); checkArgument(maxSamples <= MAX_SAMPLES_LIMIT, "Maximum number of reservoir samples is capped"); this.count = 0; this.samples = new double[maxSamples]; }
Source:
<code>public static <T extends NamedNode> T createModelFromXml(CamelContext context, InputStream stream, Class<T> type) throws JAXBException { JAXBContext jaxbContext; if (context == null) { jaxbContext = createJAXBContext(); } else { jaxbContext = context.getModelJAXBContextFactory().newJAXBContext(); } Map<String, String> namespaces = new LinkedHashMap<>(); Document dom = context.getTypeConverter().convertTo(Document.class, stream); extractNamespaces(dom, namespaces); Binder<Node> binder = jaxbContext.createBinder(); Object result = binder.unmarshal(dom); if (result == null) { throw new JAXBException("Cannot unmarshal to " + type + " using JAXB"); } <START> if (result instanceof RoutesDefinition) { <END> List<RouteDefinition> routes = ((RoutesDefinition) result).getRoutes(); for (RouteDefinition route : routes) { applyNamespaces(route, namespaces); } } else if (result instanceof RouteDefinition) { RouteDefinition route = (RouteDefinition) result; applyNamespaces(route, namespaces); } return type.cast(result); }</code><technical_language>duplicate block of code is l.135-145</technical_language>

Target:
public static <T extends NamedNode> T createModelFromXml(CamelContext context, InputStream stream, Class<T> type) throws JAXBException { return modelToXml(context, stream, type); }
Source:
<code>public void update(KijiTableLayout layout) throws IOException { if (mState.get() == State.CLOSED) { <START> LOG.debug("KijiTableReader instance is closed; ignoring layout update."); <END> return; } final CellDecoderProvider provider; if (null != mCellSpecOverrides) { provider = CellDecoderProvider.create( layout, mTable.getKiji().getSchemaTable(), SpecificCellDecoderFactory.get(), mCellSpecOverrides); } else { provider = CellDecoderProvider.create( layout, mOverrides, mAlternatives, mOnDecoderCacheMiss); } if (mReaderLayoutCapsule != null) { LOG.debug( "Updating layout used by KijiTableReader: for table: from version: to: {}", this, mTable.getURI(), mReaderLayoutCapsule.getLayout().getDesc().getLayoutId(), layout.getDesc().getLayoutId()); } else { LOG.debug("Initializing KijiTableReader: for table: with table layout version: {}", this, mTable.getURI(), layout.getDesc().getLayoutId()); } mReaderLayoutCapsule = new ReaderLayoutCapsule( provider, layout, HBaseColumnNameTranslator.from(layout)); }</code><technical_language>Change of log messages async interface name</technical_language>

Target:
public void update(KijiTableLayout layout) throws IOException { if (mState.get() == State.CLOSED) { LOG.debug("AsyncKijiTableReader instance is closed; ignoring layout update."); return; } final CellDecoderProvider provider; if (null != mCellSpecOverrides) { provider = CellDecoderProvider.create( layout, mTable.getKiji().getSchemaTable(), SpecificCellDecoderFactory.get(), mCellSpecOverrides); } else { provider = CellDecoderProvider.create( layout, mOverrides, mAlternatives, mOnDecoderCacheMiss); } if (mReaderLayoutCapsule != null) { LOG.debug( "Updating layout used by AsyncKijiTableReader: for table: from version: to: {}", this, mTable.getURI(), mReaderLayoutCapsule.getLayout().getDesc().getLayoutId(), layout.getDesc().getLayoutId()); } else { LOG.debug("Initializing AsyncKijiTableReader: for table: with table layout version: {}", this, mTable.getURI(), layout.getDesc().getLayoutId()); } mReaderLayoutCapsule = new ReaderLayoutCapsule( provider, layout, HBaseColumnNameTranslator.from(layout)); }
Source:
<code>private Map<String, List<TurboIssue>> tallyMetadataUpdate(List<FilterExpression> filterExprs) { MultiModel models = logic.getModels(); List<TurboIssue> allModelIssues = models.getIssues(); return filterExprs.stream() .filter(Qualifier::hasUpdatedQualifier) .flatMap(filterExpr -> allModelIssues.stream() .filter(issue -> { try { return Qualifier.process(models, filterExpr, issue); } catch (SemanticException e) { return false; } <START> })) <END> .distinct() .collect(Collectors.groupingBy(TurboIssue::getRepoId)); }</code><technical_language>Hmm, this is conflict #1323... wait Martin is done. a similar approach carry warnings UI. I feel try distinguish warnings errors this point, warning is returned (same error), want a list of errors in future anyway. treat a missing assignee error, change errors show in a tooltip (to new UI features implemented here, want move out of status bar in future anyway)? @damithc work able collect multiple warnings/errors in future</technical_language>

Target:
private Map<String, List<TurboIssue>> tallyMetadataUpdate(List<FilterExpression> filterExprs) { MultiModel models = logic.getModels(); List<TurboIssue> allModelIssues = models.getIssues(); return filterExprs.stream() .filter(Qualifier::hasUpdatedQualifier) .flatMap(filterExpr -> allModelIssues.stream() .filter(issue -> { try { return Qualifier.process(models, filterExpr, issue); } catch (FilterException e) { Platform.runLater(() -> UI.events.triggerEvent( new FilterExceptionEvent(filterExpr, e.getMessage()))); return false; } })) .distinct() .collect(Collectors.groupingBy(TurboIssue::getRepoId)); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_matching_picture); animation_to_middle = AnimationUtils.loadAnimation(this, R.anim.to_middle); animation_from_middle = AnimationUtils.loadAnimation(this, R.anim.from_middle); flowLayout = (com.wefika.flowlayout.FlowLayout) findViewById(R.id.flow_layout_id); addViews(); gameManager = new GameManager(); if (onePersonMod){ gameManager.addPlayer(new Player(0, <START> "Thien")); <END> } tvScore = (TextView) findViewById(R.id.tv_sore); tvScore.setText(gameManager.getPlayer(0).getScore()+""); tvName = (TextView) findViewById(R.id.tv_name); tvName.setText(gameManager.getPlayer(0).getName()); }</code><technical_language>User created retrieving data database/configuration file</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_matching_picture); animation_to_middle = AnimationUtils.loadAnimation(this, R.anim.to_middle); animation_from_middle = AnimationUtils.loadAnimation(this, R.anim.from_middle); flowLayout = (com.wefika.flowlayout.FlowLayout) findViewById(R.id.flow_layout_id); gameManager = new GameManager(); gameManager.setEndGameListenner(this); if (onePersonMod) { gameManager.addPlayer(new Player(0, "Thien")); } newGame(); tvScore = (TextView) findViewById(R.id.tv_sore); tvScore.setText(gameManager.getCurrentPlayer().getScore() + ""); tvName = (TextView) findViewById(R.id.tv_name); tvName.setText(gameManager.getCurrentPlayer().getName()); }
Source:
<code>protected Map<String, Long> collectMessagesCountByType(String prefix) { Map<String, Long> res = new HashMap<>(); prefix = MetricUtils.metricName(COMMUNICATION_METRICS_GROUP_NAME, prefix); for (Metric metric : mreg) { if (metric.name().startsWith(prefix)) { try { short directType = Short.parseShort(metric.name().substring(prefix.length())); Map<Short, String> msgTypMap0 = msgTypMap; if (msgTypMap0 != null) { String typeName = msgTypMap0.get(directType); if (typeName != null) res.put(typeName, ((LongMetric)metric).value()); } } <START> catch (NumberFormatException ignore) { <END> } } } return res; }</code><technical_language>print warning log here</technical_language>

Target:
protected Map<String, Long> collectMessagesCountByType(String prefix) { Map<String, Long> res = new HashMap<>(); prefix = metricName(COMMUNICATION_METRICS_GROUP_NAME, prefix); for (Metric metric : mreg) { if (metric.name().startsWith(prefix)) { short directType = Short.parseShort(metric.name().substring(prefix.length())); Map<Short, String> msgTypMap0 = msgTypMap; if (msgTypMap0 != null) { String typeName = msgTypMap0.get(directType); if (typeName != null) res.put(typeName, ((LongMetric)metric).value()); } } } return res; }
Source:
<code>public void lookupAddessAll() { <START> FavouritesDbHelper favorites = ctx.getFavorites(); <END> lookupAddressForPointToNavigate(); lookupAddessForStartPoint(); for (TargetPoint targetPoint : intermediatePoints) { lookupAddressForIntermediatePoint(targetPoint); } favorites.lookupAddressForHomePoint(); favorites.lookupAddressForWorkPoint(); favorites.lookupAddressForParkingPoint(); lookupAddressForMyLocationPoint(); }</code><technical_language>favorites here?? Run lookup for favorites app.getTargetPointsHelper().lookupAddessAll();</technical_language>

Target:
public void lookupAddessAll() { lookupAddressForPointToNavigate(); lookupAddessForStartPoint(); for (TargetPoint targetPoint : intermediatePoints) { lookupAddressForIntermediatePoint(targetPoint); } lookupAddressForMyLocationPoint(); }
Source:
<code>public List<Script> fromScriptPaths(List<Path> scriptPaths, Charset charset){ <START> List<Script> scripts = scriptsUnderTest; <END> int index = 0; for (Path path : scriptPaths) { Preconditions.checkState(Files.exists(path), "File %s does not exist", path); try { String sqlText = new String(Files.readAllBytes(path), charset); scripts.add(new HiveRunnerScript(index++, path, sqlText)); } catch (IOException e) { throw new IllegalArgumentException("Failed to load script file '" + path + "'"); } } return scripts; }</code><technical_language>suggestion List<Script> scripts = new ArrayList(); do this avoid this method a side effect of altering scriptsUnderTest member variable</technical_language>

Target:
public List<Script> fromScriptPaths(List<Path> scriptPaths, Charset charset) { List<Script> scripts = new ArrayList(); int index = 0; for (Path path : scriptPaths) { Preconditions.checkState(Files.exists(path), "File %s does not exist", path); try { String sqlText = new String(Files.readAllBytes(path), charset); scripts.add(new HiveRunnerScript(index++, path, sqlText)); } catch (IOException e) { throw new IllegalArgumentException("Failed to load script file '" + path + "'"); } } return scripts; }
Source:
<code>public void sendFeedBackEmail(final String feedBack, final String pluginVersion, final String rating, final String customerEmail) { StringBuilder mailBody = new StringBuilder(); if ((customerEmail != null) && !customerEmail.isEmpty()) { mailBody.append(CUSTOMER_EMAIL_PREFIX); mailBody.append(customerEmail); mailBody.append("\n"); } mailBody.append(PREFIX_PLUGIN_RATED); mailBody.append(rating); mailBody.append("\n"); mailBody.append(feedBack); String defaultFrom = getFromMail(); if (!FEEDBACK_EMAIL_DEFAULT_VALUE.equals(feedBackEmailTo) && (defaultFrom != null)) { Email email = new Email(feedBackEmailTo); email.setFrom(defaultFrom); email.setSubject(FEEDBACK_EMAIL_SUBJECT + " " + pluginVersion + " - " + DateTimeConverterUtil.dateToString(new Date())); email.setBody(mailBody.toString()); SingleMailQueueItem singleMailQueueItem = new SingleMailQueueItem(email); singleMailQueueItem.setMailThreader(null); ComponentAccessor.getMailQueue().addItem(singleMailQueueItem); } else { LOGGER.info( <START> "Feedback not sent, beacause To mail address is not setted . \n" <END> + "The message: \n" + mailBody.toString()); } }</code><technical_language>is defined</technical_language>

Target:
public void sendFeedBackEmail(final String feedBack, final String pluginVersion, final String rating, final String customerEmail) { StringBuilder mailBody = new StringBuilder(); if ((customerEmail != null) && !customerEmail.isEmpty()) { mailBody.append(CUSTOMER_EMAIL_PREFIX); mailBody.append(customerEmail); mailBody.append("\n"); } mailBody.append(PREFIX_PLUGIN_RATED); mailBody.append(rating); mailBody.append("\n"); mailBody.append(feedBack); String defaultFrom = getFromMail(); if (!FEEDBACK_EMAIL_DEFAULT_VALUE.equals(feedBackEmailTo) && (defaultFrom != null)) { Email email = new Email(feedBackEmailTo); email.setFrom(defaultFrom); email.setSubject(FEEDBACK_EMAIL_SUBJECT + " " + pluginVersion + " - " + DateTimeConverterUtil.dateToString(new Date())); email.setBody(mailBody.toString()); SingleMailQueueItem singleMailQueueItem = new SingleMailQueueItem(email); singleMailQueueItem.setMailThreader(null); ComponentAccessor.getMailQueue().addItem(singleMailQueueItem); } else { LOGGER.info( "Feedback not sent, beacause To mail address is not defined. \n" + "The message: \n" + mailBody.toString()); } }
Source:
<code><START> public static ArrayList<State> getStates(Region region) { <END> ArrayList<State> states = new ArrayList<>(); for (Vertex vertex : region.getSubvertices()) { if (vertex instanceof State) { states.add((State) vertex); } } return states; }</code><technical_language>here, ArrayList<></technical_language>

Target:
public static List<State> getStates(Region region) { List<State> states = new ArrayList<>(); for (Vertex vertex : region.getSubvertices()) { if (vertex instanceof State) { states.add((State) vertex); } } return states; }
Source:
<code>public Catalog loadSchema(HSQLInterface hsql, DdlProceduresToLoad whichProcs, String... ddlFilePaths) throws VoltCompilerException { m_catalog = new Catalog(); m_catalog.execute("add / clusters cluster"); Database db = initCatalogDatabase(m_catalog); List<VoltCompilerReader> ddlReaderList = DDLPathsToReaderList(ddlFilePaths); final VoltDDLElementTracker voltDdlTracker = new VoltDDLElementTracker(this); InMemoryJarfile jarOutput = new InMemoryJarfile(); <START> compileDatabase(db, hsql, voltDdlTracker, null, null, ddlReaderList, new ArrayList<>(), null, whichProcs, jarOutput); <END> return m_catalog; }</code><technical_language>Collections.emptyList() better</technical_language>

Target:
public Catalog loadSchema(HSQLInterface hsql, DdlProceduresToLoad whichProcs, String... ddlFilePaths) throws VoltCompilerException { m_catalog = new Catalog(); m_catalog.execute("add / clusters cluster"); Database db = initCatalogDatabase(m_catalog); List<VoltCompilerReader> ddlReaderList = DDLPathsToReaderList(ddlFilePaths); final VoltDDLElementTracker voltDdlTracker = new VoltDDLElementTracker(this); InMemoryJarfile jarOutput = new InMemoryJarfile(); compileDatabase(db, hsql, voltDdlTracker, null, null, ddlReaderList, Collections.emptyList(), null, whichProcs, jarOutput); return m_catalog; }
Source:
<code>public boolean match() { if (m_expr1 == null || m_expr2 == null) { return m_expr1 == m_expr2; <START> } else if (!exprTypesMatch(m_expr1, m_expr2)) { <END> return valueConstantsMatch(m_expr1, m_expr2) || comparisonsMatch(m_expr1, m_expr2); } else if (m_expr1 instanceof ConstantValueExpression) { return m_expr1.equals(m_expr2); } else if (m_expr1 instanceof TupleValueExpression) { return tvesMatch((TupleValueExpression) m_expr1, (TupleValueExpression) m_expr2); } else if (m_expr1 instanceof VectorValueExpression) { return vectorsMatch((VectorValueExpression) m_expr1, (VectorValueExpression) m_expr2) && childrenMatch(m_expr1, m_expr2); } else if(EXCHANGEABLE_EXPRESSIONS.contains(m_expr1.getExpressionType())) { return (argsMatch(m_expr1, m_expr2) && childrenMatch(m_expr1, m_expr2)) || ((new FilterMatcher(m_expr1.getLeft(), m_expr2.getRight())).match() && (new FilterMatcher(m_expr1.getRight(), m_expr2.getLeft())).match()); } else return argsMatch(m_expr1, m_expr2) && childrenMatch(m_expr1, m_expr2); }</code><technical_language>Add a space</technical_language>

Target:
public boolean match() { if (m_expr1 == null || m_expr2 == null) { return m_expr1 == m_expr2; } else if (m_expr1.getExpressionType() != m_expr2.getExpressionType()) { return valueConstantsMatch(m_expr1, m_expr2) || revComparisonsMatch(m_expr1, m_expr2); } else if (m_expr1 instanceof ConstantValueExpression) { return m_expr1.equals(m_expr2); } else if (m_expr1 instanceof TupleValueExpression) { return tvesMatch((TupleValueExpression) m_expr1, (TupleValueExpression) m_expr2); } else if (m_expr1 instanceof VectorValueExpression) { return vectorsMatch((VectorValueExpression) m_expr1, (VectorValueExpression) m_expr2); } else if(EXCHANGEABLE_EXPRESSIONS.contains(m_expr1.getExpressionType())) { return (argsMatch(m_expr1, m_expr2) && childrenMatch(m_expr1, m_expr2)) || (new FilterMatcher(m_expr1.getLeft(), m_expr2.getRight()).match() && new FilterMatcher(m_expr1.getRight(), m_expr2.getLeft()).match()); } else { return argsMatch(m_expr1, m_expr2) && childrenMatch(m_expr1, m_expr2); } }
Source:
<code>public void expire(String version) { String barrierStatePath = keyBuilder.getBarrierStatePath(version); State barrierState = zkUtils.getZkClient().readData(barrierStatePath); if (Objects.equals(barrierState, State.NEW)) { LOG.info(String.format("Expiring the barrier version: %s. Marking the barrier state: %s as %s.", version, barrierStatePath, State.TIMED_OUT)); zkUtils.writeData(keyBuilder.getBarrierStatePath(version), State.TIMED_OUT); <START> } <END> }</code><technical_language>necessarily in this PR: For debugability, helpful write strings zookeeper instead of objects. Often, open-source tools _zooinspector_ internal UIs _reflection_ work UTF-8 encoded strings</technical_language>

Target:
public void expire(String version) { String barrierStatePath = keyBuilder.getBarrierStatePath(version); State barrierState = zkUtils.getZkClient().readData(barrierStatePath); if (Objects.equals(barrierState, State.NEW)) { LOG.info(String.format("Expiring the barrier version: %s. Marking the barrier state: %s as %s.", version, barrierStatePath, State.TIMED_OUT)); zkUtils.writeData(keyBuilder.getBarrierStatePath(version), State.TIMED_OUT); } else { LOG.debug(String.format("Barrier version: %s is at: %s state. Not marking barrier as %s.", version, barrierState, State.TIMED_OUT)); } }
Source:
<code>private void deleteSegmentsOnAck(PBDSegment<M> segment, int entryNumber) { if (m_cursorClosed || m_segments.size() == 1) { return; } <START> PBDSegment<M> lastSegment = m_segments.lastEntry().getValue(); <END> if (segment.segmentIndex() == m_segments.firstKey() && segment.m_deleteOnAck == true) { Iterator<PBDSegment<M>> itr = m_segments.values().iterator(); while (itr.hasNext()) { PBDSegment<M> toDelete = itr.next(); try { if (toDelete.segmentIndex() != lastSegment.segmentIndex() && canDeleteSegment(toDelete)) { itr.remove(); closeAndDeleteSegment(toDelete); } else { break; } } catch(IOException e) { m_usageSpecificLog.error("Unexpected error deleting segment after all have been read and acked", e); } } return; } deleteSegmentsBefore(segment, entryNumber); }</code><technical_language>Minor: This is of if block this put block</technical_language>

Target:
private void deleteSegmentsOnAck(PBDSegment<M> segment, int entryNumber) { if (m_cursorClosed || m_segments.size() == 1) { return; } if (segment.m_deleteOnAck == true && segment.segmentIndex() == m_segments.firstKey()) { Iterator<PBDSegment<M>> itr = m_segments.values().iterator(); while (itr.hasNext()) { PBDSegment<M> toDelete = itr.next(); try { if (toDelete.m_deleteOnAck == true && canDeleteSegment(toDelete)) { itr.remove(); closeAndDeleteSegment(toDelete); } else { break; } } catch(IOException e) { m_usageSpecificLog.error("Unexpected error deleting segment after all have been read and acked", e); } } return; } deleteSegmentsBefore(segment, entryNumber); }
Source:
<code>@Test public void forResource_inJarFile() throws URISyntaxException, IOException { JavaFileObject resourceInJar = JavaFileObjects.forResource("java/lang/Object.class"); ASSERT.that(resourceInJar.getKind()).isEqualTo(CLASS); ASSERT.that(resourceInJar.toUri()) .isEqualTo(Resources.getResource("java/lang/Object.class").toURI()); ASSERT.that(resourceInJar.getName()) <START> .isEqualTo(Resources.getResource("java/lang/Object.class").toURI().getSchemeSpecificPart()); <END> }</code><technical_language>toURI().getPath() working, javac internals fail</technical_language>

Target:
@Test public void forResource_inJarFile() throws URISyntaxException, IOException { JavaFileObject resourceInJar = JavaFileObjects.forResource("java/lang/Object.class"); ASSERT.that(resourceInJar.getKind()).isEqualTo(CLASS); ASSERT.that(resourceInJar.toUri()).isEqualTo(URI.create("/java/lang/Object.class")); ASSERT.that(resourceInJar.getName()) .isEqualTo(Resources.getResource("java/lang/Object.class").toString()); ASSERT.that(resourceInJar.isNameCompatible("Object", CLASS)); }
Source:
<code>public void testAlterDatabase() { sql("alter database db1 set dbproperties('k1'='v1')") .ok("ALTER DATABASE `DB1` SET (\n" + " 'k1' = 'v1',\n" + <START> " 'alter.database.op' = 'CHANGE_PROPS'\n" + <END> ")"); sql("alter database db1 set location '/new/path'") .ok("ALTER DATABASE `DB1` SET (\n" + " 'alter.database.op' = 'CHANGE_LOCATION',\n" + " 'database.location_uri' = '/new/path'\n" + ")"); sql("alter database db1 set owner user user1") .ok("ALTER DATABASE `DB1` SET (\n" + " 'alter.database.op' = 'CHANGE_OWNER',\n" + " 'database.owner.type' = 'user',\n" + " 'database.owner.name' = 'USER1'\n" + ")"); sql("alter database db1 set owner role role1") .ok("ALTER DATABASE `DB1` SET (\n" + " 'alter.database.op' = 'CHANGE_OWNER',\n" + " 'database.owner.type' = 'role',\n" + " 'database.owner.name' = 'ROLE1'\n" + ")"); }</code><technical_language>unparse SQL is different</technical_language>

Target:
public void testAlterDatabase() { sql("alter database db1 set dbproperties('k1'='v1')") .ok("ALTER DATABASE `DB1` SET DBPROPERTIES (\n" + " 'k1' = 'v1'\n" + ")"); sql("alter database db1 set location '/new/path'") .ok("ALTER DATABASE `DB1` SET LOCATION '/new/path'"); sql("alter database db1 set owner user user1") .ok("ALTER DATABASE `DB1` SET OWNER USER `USER1`"); sql("alter database db1 set owner role role1") .ok("ALTER DATABASE `DB1` SET OWNER ROLE `ROLE1`"); }
Source:
<code>private void playSound() { try { AssetFileDescriptor fileDescriptor = getAssets().openFd(DRUMROLL_FILE_NAME); player.reset(); player.setDataSource( fileDescriptor.getFileDescriptor(), fileDescriptor.getStartOffset(), fileDescriptor.getLength()); player.prepare(); player.start(); <START> player.setOnCompletionListener(mediaPlayer -> textToSpeechManager.speak(chosenNamesText)); <END> } catch (Exception ex) { UIUtils.showLongToast(R.string.drumroll_error, this); } handler.removeCallbacks(animateNamesTask); handler.postDelayed(animateNamesTask, 2600); }</code><technical_language>this. app speak in animation end block</technical_language>

Target:
private void playSound() { try { AssetFileDescriptor fileDescriptor = getAssets().openFd(DRUMROLL_FILE_NAME); player.reset(); player.setDataSource( fileDescriptor.getFileDescriptor(), fileDescriptor.getStartOffset(), fileDescriptor.getLength()); player.prepare(); player.start(); } catch (Exception ex) { UIUtils.showLongToast(R.string.drumroll_error, this); } handler.removeCallbacks(animateNamesTask); handler.postDelayed(animateNamesTask, 2600); }
Source:
<code>private void parseCounterBound(XMLExtendedStreamReader reader, Element element, ModelNode counter) throws XMLStreamException { for (int i = 0; i < reader.getAttributeCount(); i++) { String value = reader.getAttributeValue(i); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case VALUE: { if (element.equals(Element.LOWER_BOUND)) { StrongCounterResource.LOWER_BOUND.parseAndSetParameter(value, counter, reader); } if (element.equals(Element.UPPER_BOUND)) { StrongCounterResource.UPPER_BOUND.parseAndSetParameter(value, counter, reader); } break; } default: { throw ParseUtils.unexpectedAttribute(reader, i); } } } <START> while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { <END> throw ParseUtils.unexpectedElement(reader); } }</code><technical_language>replace if loops</technical_language>

Target:
private void parseCounterBound(XMLExtendedStreamReader reader, Element element, ModelNode counter) throws XMLStreamException { for (int i = 0; i < reader.getAttributeCount(); i++) { String value = reader.getAttributeValue(i); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case VALUE: { if (element.equals(Element.LOWER_BOUND)) { StrongCounterResource.LOWER_BOUND.parseAndSetParameter(value, counter, reader); } if (element.equals(Element.UPPER_BOUND)) { StrongCounterResource.UPPER_BOUND.parseAndSetParameter(value, counter, reader); } break; } default: { throw ParseUtils.unexpectedAttribute(reader, i); } } } if (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { throw ParseUtils.unexpectedElement(reader); } }
Source:
<code>private <T> void unregisterHandler(String address, Handler<Message<T>> handler, Handler<AsyncResult<Void>> completionHandler) { checkStarted(); Handlers handlers = handlerMap.get(address); if (handlers != null) { synchronized (handlers) { int size = handlers.list.size(); for (int i = 0; i < size; i++) { HandlerHolder holder = handlers.list.get(i); if (holder.handler == handler) { if (holder.timeoutID != -1) { vertx.cancelTimer(holder.timeoutID); } handlers.list.remove(i); holder.setRemoved(); if (handlers.list.isEmpty()) { handlerMap.remove(address); if (subs != null && !holder.localOnly) { removeSub(address, serverID, completionHandler); } else if (completionHandler != null) { <START> callCompletionHandlerAsync(completionHandler); <END> } } else if (completionHandler != null) { callCompletionHandler(completionHandler); } holder.context.removeCloseHook(new HandlerEntry<T>(address, handler)); break; } } } } }</code><technical_language>reason this is async lines is sync</technical_language>

Target:
private <T> void unregisterHandler(String address, Handler<Message<T>> handler, Handler<AsyncResult<Void>> completionHandler) { checkStarted(); Handlers handlers = handlerMap.get(address); if (handlers != null) { synchronized (handlers) { int size = handlers.list.size(); for (int i = 0; i < size; i++) { HandlerHolder holder = handlers.list.get(i); if (holder.handler == handler) { if (holder.timeoutID != -1) { vertx.cancelTimer(holder.timeoutID); } handlers.list.remove(i); holder.setRemoved(); if (handlers.list.isEmpty()) { handlerMap.remove(address); if (subs != null && !holder.localOnly) { removeSub(address, serverID, completionHandler); } else if (completionHandler != null) { callCompletionHandlerAsync(completionHandler); } } else if (completionHandler != null) { callCompletionHandlerAsync(completionHandler); } holder.context.removeCloseHook(new HandlerEntry<T>(address, handler)); break; } } } } }
Source:
<code>public void launch() { List<String> commands = Lists.newLinkedList(); <START> String appName = getEntity().getConfig(NodeJsWebAppService.APP_NAME); <END> String appFile = getEntity().getConfig(NodeJsWebAppService.APP_FILE); String appCommand = getEntity().getConfig(NodeJsWebAppService.APP_COMMAND); commands.add(String.format("cd %s", Os.mergePathsUnix(getRunDir(), appName))); commands.add(BashCommands.sudo("nohup " + appCommand + " " + appFile + " &")); newScript(MutableMap.of(USE_PID_FILE, true), LAUNCHING) .body.append(commands) .execute(); }</code><technical_language>added (in places!): protected <K> getRequiredConfig(ConfigKey<K> key) { return checkNotNull(getConfig(key), key.getName()); } I presume this fail in a strange if of null (i.e. command exec string "null")</technical_language>

Target:
public void launch() { List<String> commands = Lists.newLinkedList(); String appName = getEntity().getConfig(NodeJsWebAppService.APP_NAME); String appFile = getEntity().getConfig(NodeJsWebAppService.APP_FILE); String appCommand = getEntity().getConfig(NodeJsWebAppService.APP_COMMAND); String appCommandLine = getEntity().getConfig(NodeJsWebAppService.APP_COMMAND_LINE); if (Strings.isBlank(appCommandLine)) { appCommandLine = appCommand + " " + appFile; } commands.add(String.format("cd %s", Os.mergePathsUnix(getRunDir(), appName))); commands.add("nohup " + appCommandLine + " > console.out 2>&1 &"); newScript(MutableMap.of(USE_PID_FILE, true), LAUNCHING) .body.append(commands) .execute(); }
Source:
<code>private List<HRegionLocation> getRegionBoundaries(ParallelScanGrouper scanGrouper) throws SQLException{ <START> if (scanGrouper instanceof DefaultParallelScanGrouper) { <END> ((DefaultParallelScanGrouper) scanGrouper).init(context,physicalTableName); } else if (scanGrouper instanceof TableMRParallelScanGrouper) { ((TableMRParallelScanGrouper) scanGrouper).init(context,physicalTableName); } return scanGrouper.getRegionBoundaries(); }</code><technical_language>casts necessary. add init method ParallelScanGrouper call init implementing class in getRegionBoundaries</technical_language>

Target:
private List<HRegionLocation> getRegionBoundaries(ParallelScanGrouper scanGrouper) throws SQLException{ return scanGrouper.getRegionBoundaries(context, physicalTableName); }
Source:
<code>public void dump(TopologyAPI.Component.Builder bldr) { bldr.setName(name); bldr.setSpec(TopologyAPI.ComponentObjectSpec.JAVA_SERIALIZED_OBJECT); bldr.setSerializedObject(ByteString.copyFrom(Utils.serialize(component))); TopologyAPI.Config.Builder cBldr = TopologyAPI.Config.newBuilder(); for (Map.Entry<String, Object> entry : componentConfiguration.entrySet()) { TopologyAPI.Config.KeyValue.Builder kvBldr = TopologyAPI.Config.KeyValue.newBuilder(); kvBldr.setKey(entry.getKey()); <START> kvBldr.setValue(entry.getValue() == null ? "null" : entry.getValue().toString()); <END> kvBldr.setType(TopologyAPI.ConfigValueType.STRING_VALUE); cBldr.addKvs(kvBldr); } bldr.setConfig(cBldr); }</code><technical_language>put null in instead of "null"</technical_language>

Target:
public void dump(TopologyAPI.Component.Builder bldr) { bldr.setName(name); bldr.setSpec(TopologyAPI.ComponentObjectSpec.JAVA_SERIALIZED_OBJECT); bldr.setSerializedObject(ByteString.copyFrom(Utils.serialize(component))); TopologyAPI.Config.Builder cBldr = TopologyAPI.Config.newBuilder(); for (Map.Entry<String, Object> entry : componentConfiguration.entrySet()) { if (entry.getKey() == null) { LOG.warning("ignore: config key is null"); continue; } if (entry.getValue() == null) { LOG.warning("ignore: config key " + entry.getKey() + " has null value"); continue; } TopologyAPI.Config.KeyValue.Builder kvBldr = TopologyAPI.Config.KeyValue.newBuilder(); kvBldr.setKey(entry.getKey()); kvBldr.setValue(entry.getValue().toString()); kvBldr.setType(TopologyAPI.ConfigValueType.STRING_VALUE); cBldr.addKvs(kvBldr); } bldr.setConfig(cBldr); }
Source:
<code>public boolean onSetSurface(Surface surface) { <START> mSurface = surface; <END> return true; }</code><technical_language>call draw() here</technical_language>

Target:
public boolean onSetSurface(Surface surface) { mSurface = surface; if (surface != null) { draw(); } return true; }
Source:
<code>private String trimNameAndAddID(String query) { String trimmedNamed = query.replaceAll(":", "="); <START> trimmedNamed = trimmedNamed.replaceAll("[^A-Za-z0-9_.\\s=-]", ""); <END> if (query.length() > 240) { trimmedNamed = query.substring(0, 240); } String id = findQueryIDByQueryString(query); return id + " - " + trimmedNamed; }</code><technical_language>Extract regex a private final static string Pattern = Pattern.compile(regex) pattern.matcher(query).replaceAll("")</technical_language>

Target:
private String trimNameAndAddID(String query) { String trimmedNamed = MATCHCOLON.matcher(query).replaceAll("="); trimmedNamed = MATCHILLEGALCHARACTERS.matcher(trimmedNamed).replaceAll(""); if (query.length() > 240) { trimmedNamed = query.substring(0, 240); } String id = findQueryIDByQueryString(query); return id + " - " + trimmedNamed; }
Source:
<code>private String getDetails(String key, Map<String, Set<String>> info) { if (info.isEmpty() || !info.containsKey(key)) { return ""; } StringBuilder sb = new StringBuilder(); for (String item : info.get(key)) { <START> sb.append(item + "\n"); <END> } return sb.toString(); }</code><technical_language>sb.append(item).append('\n');</technical_language>

Target:
private String getDetails(String key, Map<String, Set<String>> info) { if (info.isEmpty() || !info.containsKey(key)) { return ""; } StringBuilder sb = new StringBuilder(); for (String item : info.get(key)) { sb.append(item).append('\n'); } return sb.toString(); }
Source:
<code>public void transformOffset(){ final ITmfTimestampTransform offset = TimestampTransformFactory.create(100); final ITmfTimestampTransform offset1 = TimestampTransformFactory.create(BigDecimal.ONE, new BigDecimal(100)); final ITmfTimestampTransform offset2 = TimestampTransformFactory.create(1.0, 100); final ITmfTimestampTransform compositeTransform = offset.composeWith(TimestampTransformFactory.create(new TmfNanoTimestamp(-100))); assertEquals(tn100, offset.transform(t0)); assertEquals(tn100, offset.transform(tn0)); assertEquals(tn0, compositeTransform.transform(t0)); <START> assertEquals(t0, compositeTransform.transform(t0)); <END> assertEquals(offset1.toString(), offset.toString()); assertEquals(offset1.toString(), offset2.toString()); }</code><technical_language>together, tests verify equality of timestamps t0 tn0</technical_language>

Target:
public void transformOffset(){ final ITmfTimestampTransform offset = TimestampTransformFactory.create(100); final ITmfTimestampTransform compositeTransform = offset.composeWith(TimestampTransformFactory.create(new TmfNanoTimestamp(-100))); assertEquals(tn100, offset.transform(t0)); assertEquals(tn100, offset.transform(tn0)); assertEquals(tn0, compositeTransform.transform(t0)); assertEquals(t0, compositeTransform.transform(t0)); }
Source:
<code>private void updateEditLicenseText() { editLicenseText = (TextView) findViewById(R.id.edit_section_license_text); editLicenseText.setText(Html.fromHtml(getString(R.string.edit_save_action_license))); if (!app.getUserInfoStorage().isLoggedIn()) { <START> editLicenseText.append(Html.fromHtml(getString(R.string.edit_save_action_ip_edit))); <END> } editLicenseText.setMovementMethod(new LinkMovementMethodExt(new LinkMovementMethodExt.UrlHandler() { @Override public void onUrlClick(String url) { if (url.equals("https://#login")) { funnel.logLoginAttempt(); Intent loginIntent = new Intent(EditSectionActivity.this, LoginActivity.class); loginIntent.putExtra(LoginActivity.LOGIN_REQUEST_SOURCE, LoginFunnel.SOURCE_EDIT); loginIntent.putExtra(LoginActivity.EDIT_SESSION_TOKEN, funnel.getEditSessionToken()); startActivityForResult(loginIntent, LoginActivity.REQUEST_LOGIN); } else { Utils.handleExternalLink(EditSectionActivity.this, Uri.parse(url)); } } })); }</code><technical_language>Ah. solution is *two* strings - for logged in users for logged out users, do appending</technical_language>

Target:
private void updateEditLicenseText() { editLicenseText = (TextView) findViewById(R.id.edit_section_license_text); if (app.getUserInfoStorage().isLoggedIn()) { editLicenseText.setText(Html.fromHtml(getString(R.string.edit_save_action_license_logged_in))); } else { editLicenseText.append(Html.fromHtml(getString(R.string.edit_save_action_license_anon))); } editLicenseText.setMovementMethod(new LinkMovementMethodExt(new LinkMovementMethodExt.UrlHandler() { @Override public void onUrlClick(String url) { if (url.equals("https://#login")) { funnel.logLoginAttempt(); Intent loginIntent = new Intent(EditSectionActivity.this, LoginActivity.class); loginIntent.putExtra(LoginActivity.LOGIN_REQUEST_SOURCE, LoginFunnel.SOURCE_EDIT); loginIntent.putExtra(LoginActivity.EDIT_SESSION_TOKEN, funnel.getEditSessionToken()); startActivityForResult(loginIntent, LoginActivity.REQUEST_LOGIN); } else { Utils.handleExternalLink(EditSectionActivity.this, Uri.parse(url)); } } })); }
Source:
<code>public HazelcastServerCacheManager(HazelcastServerCachingProvider cachingProvider, HazelcastInstance hazelcastInstance, URI uri, ClassLoader classLoader, Properties properties) { super(cachingProvider, hazelcastInstance, uri, classLoader, properties); if (hazelcastInstance instanceof HazelcastInstanceProxy) { instance = ((HazelcastInstanceProxy) hazelcastInstance).getOriginal(); } else { instance = (HazelcastInstanceImpl) hazelcastInstance; } nodeEngine = instance.node.getNodeEngine(); cacheService = nodeEngine.getService(ICacheService.SERVICE_NAME); <START> logger = nodeEngine.getLogger(HazelcastCacheManager.class); <END> }</code><technical_language>Minor: unused</technical_language>

Target:
public HazelcastServerCacheManager(HazelcastServerCachingProvider cachingProvider, HazelcastInstance hazelcastInstance, URI uri, ClassLoader classLoader, Properties properties) { super(cachingProvider, hazelcastInstance, uri, classLoader, properties); if (hazelcastInstance instanceof HazelcastInstanceProxy) { instance = ((HazelcastInstanceProxy) hazelcastInstance).getOriginal(); } else { instance = (HazelcastInstanceImpl) hazelcastInstance; } nodeEngine = instance.node.getNodeEngine(); cacheService = nodeEngine.getService(ICacheService.SERVICE_NAME); }
Source:
<code>public static void initialize(java.util.List<AnimationFrame> frames) { <START> isRunning = true; <END> selectedFrameIndex = 0; animationContext = new AnimationContextSWT(PlatformUI.getWorkbench() .getDisplay()); AnimationView.frames = new ArrayList<AnimationFrame>(frames); if (isInitialized()) initializeFrames(); ExecutionMode currentMode = SimulationModeDispatcher.getMode(); disableAnimation(currentMode == ExecutionMode.NO_ANIMATION ? true : false); }</code><technical_language>isRunning -> isInitialized</technical_language>

Target:
public static void initialize(java.util.List<AnimationFrame> frames) { isInitialized = true; selectedFrameIndex = 0; animationContext = new AnimationContextSWT(PlatformUI.getWorkbench() .getDisplay()); AnimationView.frames = new ArrayList<AnimationFrame>(frames); if (isInitialized()) initializeFrames(); ExecutionMode currentMode = SimulationModeDispatcher.getMode(); setAnimationEnabled(currentMode != ExecutionMode.NO_ANIMATION); }
Source:
<code>public PageTitle titleForInternalLink(String internalLink) { <START> return new PageTitle(RbSwitch.INSTANCE.isRestBaseEnabled() <END> ? internalLink.replaceFirst("./", "") : internalLink.replaceFirst("/wiki/", ""), this); }</code><technical_language>do replacements unconditionally? worried pages cached service while other is enabled</technical_language>

Target:
public PageTitle titleForInternalLink(String internalLink) { return new PageTitle(internalLink.replaceFirst("./", "").replaceFirst("/wiki/", ""), this); }
Source:
<code>public Void call() throws Exception { final RDFFormat rdfFormat = props.getProperty("format") == null ? null : Rio.getParserFormatForMIMEType(props.getProperty("format")); final String baseURI = props.getProperty("baseURI"); final String defaultGraph = props.getProperty("defaultGraph"); final String fileOrDirs = props.getProperty("fileOrDirs"); if (log.isInfoEnabled()) { log.info("ParallelDataLoader called ( rdfFormat = ; baseURI = ; defaultGraph = ; " + "namespace = ; fileOrDirs = )", rdfFormat, baseURI, defaultGraph, namespace, fileOrDirs); } final long begin = System.currentTimeMillis(); BigdataSailConnection conn = null; boolean success = false; try { conn = getUnisolatedSailConnection(); final AtomicLong nmodified = new AtomicLong(0L); FilenameFilter filter = DataLoader.getFilenameFilter(); final String[] fileToLoad = fileOrDirs.split(","); List<File> files = collectFiles(fileToLoad, filter); log.trace("Collected {}", files); runParallelLoad(rdfFormat, baseURI, defaultGraph, conn, files); final long elapsed = System.currentTimeMillis() - begin; reportModifiedCount(nmodified.get(), elapsed); return (Void) null; } finally { if (conn != null) { <START> if (!success) { <END> conn.rollback(); } conn.close(); } } }</code><technical_language>success is false</technical_language>

Target:
public Void call() throws Exception { final RDFFormat rdfFormat = props.getProperty("format") == null ? null : Rio.getParserFormatForMIMEType(props.getProperty("format")); final String baseURI = props.getProperty("baseURI"); final String defaultGraph = props.getProperty("defaultGraph"); final String fileOrDirs = props.getProperty("fileOrDirs"); if (log.isInfoEnabled()) { log.info("ParallelDataLoader called ( rdfFormat = ; baseURI = ; defaultGraph = ; " + "namespace = ; fileOrDirs = )", rdfFormat, baseURI, defaultGraph, namespace, fileOrDirs); } final long begin = System.currentTimeMillis(); BigdataSailConnection conn = null; boolean success = false; try { conn = getUnisolatedSailConnection(); final AtomicLong nmodified = new AtomicLong(0L); FilenameFilter filter = DataLoader.getFilenameFilter(); final String[] fileToLoad = fileOrDirs.split(","); List<File> files = collectFiles(fileToLoad, filter); log.trace("Collected {}", files); runParallelLoad(rdfFormat, baseURI, defaultGraph, conn, files); success = true; final long elapsed = System.currentTimeMillis() - begin; reportModifiedCount(nmodified.get(), elapsed); return (Void) null; } finally { if (conn != null) { if (!success) { conn.rollback(); } conn.close(); } } }
Source:
<code>private void doFocusChanged(Widget control) { for (StructuredViewer <START> fViewer : <END> fViewers) { if (fViewer.getControl() == control) { propagateFocusChanged(fViewer); return; } } }</code><technical_language>rename viewer</technical_language>

Target:
private void doFocusChanged(Widget control) { for (StructuredViewer viewer : fViewers) { if (viewer.getControl() == control) { propagateFocusChanged(viewer); return; } } }