auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ActionButton(EEFWidgetAction action, Composite parent, EEFWidgetFactory widgetFactory, IInterpreter interpreter, IVariableManager variableManager) { this.action = action; this.button = widgetFactory.createButton(parent, "", SWT.NONE); String expression = action.getLabelExpression(); EAttribute eAttribute = EefPackage.Literals.EEF_WIDGET_ACTION__LABEL_EXPRESSION; String buttonLabel = new Eval(interpreter, variableManager).get(eAttribute, expression, String.class); button.setText(buttonLabel); }

Target:
public ActionButton(EEFWidgetAction action, Composite parent, EEFWidgetFactory widgetFactory, IInterpreter interpreter, IVariableManager variableManager) { this.action = action; this.button = widgetFactory.createButton(parent, "", SWT.NONE); String expression = action.getLabelExpression(); EAttribute eAttribute = EefPackage.Literals.EEF_WIDGET_ACTION__LABEL_EXPRESSION; String buttonLabel = Objects.firstNonNull(new Eval(interpreter, variableManager).get(eAttribute, expression, String.class), "..."); button.setText(buttonLabel); }
Source:
protected void onPostResume() { super.onPostResume(); if (map != null) map.clear(); getMapPreferences(); getCurrentAssignment(); }

Target:
protected void onPostResume() { super.onPostResume(); Log.i(TAG, "Resuming"); if (map != null) map.clear(); getMapPreferences(); getCurrentAssignment(); setUpMap(); }
Source:
public static void tearDown() throws IOException, OperationException, TimeoutException, InterruptedException { operations.removeIfExists(FILE_HANDLER_ADDRESS); administration.reloadIfRequired(); operations.removeIfExists(FILE_HANDLER_TB_REMOVED_ADDRESS); administration.reloadIfRequired(); }

Target:
public static void tearDown() throws IOException, OperationException, TimeoutException, InterruptedException { operations.removeIfExists(FILE_HANDLER_ADDRESS); operations.removeIfExists(FILE_HANDLER_TB_REMOVED_ADDRESS); administration.reloadIfRequired(); }
Source:
public int compareTo(DocumentWriteOperation o) { if(o == null) throw new NullPointerException("DocumentWriteOperation cannot be null"); if(this.getUri() instanceof String && o.getUri() instanceof String) return getUri().compareTo(o.getUri()); if(this.getUri() == null && o.getUri() instanceof String) return -1; if(this.getUri() instanceof String && o.getUri()==null) return 1; if(this.getUri() == null && o.getUri() == null) super.hashCode(); return 0; }

Target:
public int compareTo(DocumentWriteOperation o) { if(o == null) throw new NullPointerException("DocumentWriteOperation cannot be null"); if(this.getUri() != null && o.getUri() != null) return getUri().compareTo(o.getUri()); if(this.getUri() == null && o.getUri() != null) return -1; if(this.getUri() != null && o.getUri()==null) return 1; if(this.getUri() == null && o.getUri() == null) { if(this.hashCode() > o.hashCode()) return 1; else if (this.hashCode() < o.hashCode()) return -1; return 0; } return 0; }
Source:
private int rebuildIndexes(Connection conn, String dataTable, IndexTool indexingTool) { for(Map.Entry<String, IndexInfo> indexMap : rebuildMap.get(dataTable).entrySet()) { String index = indexMap.getKey(); IndexInfo indexInfo = indexMap.getValue(); String indexName = SchemaUtil.getTableNameFromFullName(index); String tenantId = indexInfo.getTenantId(); String baseTable = indexInfo.getBaseTable(); String schema = indexInfo.getSchemaName(); String outFile = "/tmp/index_rebuild_" +schema+"_"+ indexName + (GLOBAL_INDEX_ID.equals(tenantId)?"":"_"+tenantId) +"_" + UUID.randomUUID().toString(); String[] args = getIndexToolArgValues(schema, baseTable, indexName, outFile, tenantId); try { LOGGER.info("Rebuilding index: " + String.join(",", args)); if (!dryRun) { String stmt = String.format("ALTER INDEX %s ON %s REBUILD ASYNC", indexName, SchemaUtil.getTableName(schema, baseTable)); try { conn.createStatement().execute(stmt); } catch (SQLException ex) { LOGGER.warning("Something went wrong while running ALTER REBUILD ASYNC the index " + index + " " + ex); } indexingTool.run(args); } } catch (Exception e) { LOGGER.severe("Something went wrong while building the index " + index + " " + e); return -1; } } return 0; }

Target:
private int rebuildIndexes(Connection conn, String dataTable, IndexTool indexingTool) { for(Map.Entry<String, IndexInfo> indexMap : rebuildMap.get(dataTable).entrySet()) { String index = indexMap.getKey(); IndexInfo indexInfo = indexMap.getValue(); String indexName = SchemaUtil.getTableNameFromFullName(index); String tenantId = indexInfo.getTenantId(); String baseTable = indexInfo.getBaseTable(); String schema = indexInfo.getSchemaName(); String outFile = "/tmp/index_rebuild_" +schema+"_"+ indexName + (GLOBAL_INDEX_ID.equals(tenantId)?"":"_"+tenantId) +"_" + UUID.randomUUID().toString(); String[] args = getIndexToolArgValues(schema, baseTable, indexName, outFile, tenantId); Connection newConnection = conn; Connection tenantConnection = null; try { LOGGER.info("Rebuilding index: " + String.join(",", args)); if (!dryRun) { if (!Strings.isNullOrEmpty(tenantId) && !GLOBAL_INDEX_ID.equals(tenantId)) { Configuration conf = HBaseConfiguration.addHbaseResources(getConf()); conf.set(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); newConnection = ConnectionUtil.getInputConnection(conf); tenantConnection = newConnection; } PTable indexPTable = PhoenixRuntime.getTable(newConnection, indexInfo.getPhysicalIndexTableName()); if (indexPTable.getIndexState() == PIndexState.DISABLE) { String dataTableFullName = dataTable; if (!dataTableFullName.contains(":") && !dataTableFullName.contains(".")) { dataTableFullName = SchemaUtil.getTableName(schema, dataTable); } String stmt = String.format("ALTER INDEX %s ON %s REBUILD ASYNC", indexName, dataTableFullName); newConnection.createStatement().execute(stmt); } indexingTool.run(args); } } catch (Exception e) { LOGGER.severe("Something went wrong while building the index " + index + " " + e); return -1; } finally { try { if (tenantConnection != null) { tenantConnection.close(); } } catch (SQLException e) { LOGGER.warning("Couldn't close tenant connection. Ignoring"); } } } return 0; }
Source:
public void removeCache(final String alias) { statusTransitioner.checkAvailable(); MDC.put("alias", alias); final CacheHolder cacheHolder = caches.remove(alias); if(cacheHolder != null) { final Ehcache<?, ?> ehcache = cacheHolder.retrieve(cacheHolder.keyType, cacheHolder.valueType); if(!statusTransitioner.isTransitioning()) { for (CacheManagerListener listener : listeners) { listener.cacheRemoved(alias, ehcache); } } closeEhcache(alias, ehcache); LOGGER.info("Cache '{}' is removed from EhcacheManager.", alias); } MDC.remove("alias"); }

Target:
public void removeCache(final String alias) { statusTransitioner.checkAvailable(); final CacheHolder cacheHolder = caches.remove(alias); if(cacheHolder != null) { final Ehcache<?, ?> ehcache = cacheHolder.retrieve(cacheHolder.keyType, cacheHolder.valueType); if(!statusTransitioner.isTransitioning()) { for (CacheManagerListener listener : listeners) { listener.cacheRemoved(alias, ehcache); } } closeEhcache(alias, ehcache, cacheHolder.toBeReleased); LOGGER.info("Cache '{}' is removed from EhcacheManager.", alias); } }
Source:
private void fileChangedWatchService(File file) { while (file.isFile()) { file = file.getParentFile(); } try { if (watcher != null) { watcher.close(); } watcher = FileSystems.getDefault().newWatchService(); final Path path = FileSystems.getDefault().getPath(file.getAbsolutePath()); path.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY); new Thread(() -> { try { WatchKey key = watcher.take(); while (key != null) { for (WatchEvent<?> event : key.pollEvents()) { final Path changedPath = (Path) event.context(); Display.getDefault().asyncExec(() -> { if (browser.getUrl().endsWith(changedPath.toString())) { browser.refresh(); } }); } key.reset(); key = watcher.take(); } } catch (InterruptedException e) { e.printStackTrace(); } catch (ClosedWatchServiceException e) { } }).start(); } catch (IOException e) { e.printStackTrace(); } }

Target:
private void fileChangedWatchService(File file) { while (file.isFile()) { file = file.getParentFile(); } try { if (watcher != null) { watcher.close(); } watcher = FileSystems.getDefault().newWatchService(); final Path path = FileSystems.getDefault().getPath(file.getAbsolutePath()); path.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY); new Thread(() -> { try { WatchKey key = watcher.take(); while (key != null) { for (WatchEvent<?> event : key.pollEvents()) { final Path changedPath = (Path) event.context(); Display.getDefault().asyncExec(() -> { if (browser.getUrl().endsWith(changedPath.toString())) { browser.refresh(); } }); } key.reset(); key = watcher.take(); } } catch (InterruptedException | ClosedWatchServiceException e) { } }).start(); } catch (IOException e) { e.printStackTrace(); } }
Source:
public void testMatch() { H2ResourceGroupsDao dao = setup("db-exact-match-selector"); dao.createExactMatchSelectorsTable(); ResourceGroupId resourceGroupId = new ResourceGroupId(ImmutableList.of("global", "test", "user")); JsonCodec<ResourceGroupId> codec = JsonCodec.jsonCodec(ResourceGroupId.class); dao.insertExactMatchSelector("test", "@test@test_pipeline", codec.toJson(resourceGroupId)); DbSourceExactMatchSelector selector = new DbSourceExactMatchSelector("test", dao); assertEquals( selector.match(new SelectionContext(true, "testuser", Optional.of("@test@test_pipeline"), ImmutableSet.of("tag"), 1, Optional.empty())), Optional.of(resourceGroupId)); assertEquals( selector.match(new SelectionContext(true, "testuser", Optional.of("@test@test_new"), ImmutableSet.of(), 1, Optional.empty())), Optional.empty()); }

Target:
public void testMatch() { ResourceGroupId resourceGroupId = new ResourceGroupId(ImmutableList.of("global", "test", "user")); dao.insertExactMatchSelector("test", "@test@test_pipeline", CODEC.toJson(resourceGroupId)); DbSourceExactMatchSelector selector = new DbSourceExactMatchSelector("test", dao); assertEquals( selector.match(new SelectionContext(true, "testuser", Optional.of("@test@test_pipeline"), ImmutableSet.of("tag"), 1, Optional.empty())), Optional.of(resourceGroupId)); assertEquals( selector.match(new SelectionContext(true, "testuser", Optional.of("@test@test_new"), ImmutableSet.of(), 1, Optional.empty())), Optional.empty()); }
Source:
private static List<CassandraRawCellValue> keySlicesToCells(List<KeySlice> slices) { List<CassandraRawCellValue> ret = new ArrayList<>(); for (KeySlice slice : slices) { for (ColumnOrSuperColumn col : slice.getColumns()) { ret.add(new CassandraRawCellValue(slice.getKey(), col.getColumn())); } } return ret; }

Target:
private static List<CassandraRawCellValue> keySlicesToCells(List<KeySlice> slices) { List<CassandraRawCellValue> ret = new ArrayList<>(); for (KeySlice slice : slices) { for (ColumnOrSuperColumn col : slice.getColumns()) { ret.add(ImmutableCassandraRawCellValue.builder() .rowKey(slice.getKey()) .column(col.getColumn()) .build()); } } return ret; }
Source:
private void iterate(Object key, ReadWriteMap<Object, Integer> rw, int expectedValue) throws InterruptedException { rw.eval(key, (Function<ReadWriteEntryView<Object, Integer>, Void> & Serializable) entry -> { try { Thread.sleep(10); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } return entry.set(entry.find().orElse(0) + 1); }).join(); Thread.sleep(100); Assert.assertEquals( (Object) cacheManagers.stream() .map(cm -> cm.<Object, Integer> getCache(DIST).getAdvancedCache()) .filter(cache -> cache.getDistributionManager().getLocality(key).isLocal()) .map(cache -> cache.getDataContainer().get(key).getValue()) .collect(Collectors.toList()), Collections.nCopies(numDistOwners, expectedValue)); }

Target:
private void iterate(Object key, ReadWriteMap<Object, Integer> rw, int expectedValue) throws InterruptedException { rw.eval(key, (Function<ReadWriteEntryView<Object, Integer>, Void> & Serializable) entry -> { TestingUtil.sleepThread(10); return entry.set(entry.find().orElse(0) + 1); }).join(); Thread.sleep(100); Assert.assertEquals( (Object) cacheManagers.stream() .map(cm -> cm.<Object, Integer> getCache(DIST).getAdvancedCache()) .filter(cache -> cache.getDistributionManager().getLocality(key).isLocal()) .map(cache -> cache.getDataContainer().get(key).getValue()) .collect(Collectors.toList()), Collections.nCopies(numDistOwners, expectedValue)); }
Source:
public void testDRepresentationElementUpdate() { final IEditorPart editor = DialectUIManager.INSTANCE.openEditor(session, diagram, new NullProgressMonitor()); TestsUtil.synchronizationWithUIThread(); final EPackage ePackage = (EPackage) semanticModel; final EClass eClass = createEClass(ePackage); final Layer layer = diagram.getDescription().getDefaultLayer(); ContainerMapping classMapping = getContainerMapping(layer, "EC EClass"); String changeIdBeforeModification = SiriusHelper.getChangeId(diagram); RecordingCommand cmd = new CreateDDiagramElementCommand(session.getTransactionalEditingDomain(), eClass, classMapping, diagram); session.getTransactionalEditingDomain().getCommandStack().execute(cmd); String changeIdAfterModification = SiriusHelper.getChangeId(diagram); assertNotEquals("Change id has not been updated.", changeIdBeforeModification, changeIdAfterModification); DialectUIManager.INSTANCE.closeEditor(editor, false); TestsUtil.synchronizationWithUIThread(); }

Target:
public void testDRepresentationElementUpdate() { final IEditorPart editor = DialectUIManager.INSTANCE.openEditor(session, diagram, new NullProgressMonitor()); TestsUtil.synchronizationWithUIThread(); final EPackage ePackage = (EPackage) semanticModel; final EClass eClass = createEClass(ePackage); final Layer layer = diagram.getDescription().getDefaultLayer(); ContainerMapping classMapping = getContainerMapping(layer, "EC EClass"); String changeIdBeforeModification = new DRepresentationQuery(diagram).getRepresentationDescriptor().getChangeId(); RecordingCommand cmd = new CreateDDiagramElementCommand(session.getTransactionalEditingDomain(), eClass, classMapping, diagram); session.getTransactionalEditingDomain().getCommandStack().execute(cmd); String changeIdAfterModification = new DRepresentationQuery(diagram).getRepresentationDescriptor().getChangeId(); assertNotEquals("Change id has not been updated.", changeIdBeforeModification, changeIdAfterModification); DialectUIManager.INSTANCE.closeEditor(editor, false); TestsUtil.synchronizationWithUIThread(); }
Source:
private static int computeChecksumIndex(String contents, int maxWeight) { int weight = 1; int total = 0; for (int i = contents.length()-1; i >= 0; i--) { int indexInString = Code93Reader.ALPHABET_STRING.indexOf(contents.charAt(i)); total += indexInString * weight; if (++weight > maxWeight) { weight = 1; } } int checksum = total % 47; return checksum; }

Target:
private static int computeChecksumIndex(String contents, int maxWeight) { int weight = 1; int total = 0; for (int i = contents.length() - 1; i >= 0; i--) { int indexInString = Code93Reader.ALPHABET_STRING.indexOf(contents.charAt(i)); total += indexInString * weight; if (++weight > maxWeight) { weight = 1; } } return total % 47; }
Source:
public Long sumMetric(final Task task, final DimFilter filter, final String metric) throws Exception { TimeseriesQuery query = Druids.newTimeseriesQueryBuilder() .dataSource("test_ds") .filters(filter) .aggregators( ImmutableList.<AggregatorFactory>of( new LongSumAggregatorFactory(metric, metric) ) ).granularity(Granularities.ALL) .intervals("2000/3000") .build(); ArrayList<Result<TimeseriesResultValue>> results = Sequences.toList( task.getQueryRunner(query).run(QueryPlus.wrap(query), ImmutableMap.<String, Object>of()), Lists.<Result<TimeseriesResultValue>>newArrayList() ); if (results.isEmpty()) { return NullHandlingHelper.nullToZeroIfNeeded((Long) null); } return results.get(0).getValue().getLongMetric(metric); }

Target:
public Long sumMetric(final Task task, final DimFilter filter, final String metric) throws Exception { TimeseriesQuery query = Druids.newTimeseriesQueryBuilder() .dataSource("test_ds") .filters(filter) .aggregators( ImmutableList.<AggregatorFactory>of( new LongSumAggregatorFactory(metric, metric) ) ).granularity(Granularities.ALL) .intervals("2000/3000") .build(); List<Result<TimeseriesResultValue>> results = task.getQueryRunner(query).run(QueryPlus.wrap(query), ImmutableMap.of()).toList(); return results.isEmpty() ? NullHandling.defaultLongValue() : results.get(0).getValue().getLongMetric(metric); }
Source:
public void testUnicastSerialDataReceiveSubscribedRx16() throws Exception { dataReader.addSerialDatatReceiveListener(receiveSerialDataListener); Whitebox.invokeMethod(dataReader, PACKET_RECEIVED_METHOD, rx16Packet); PowerMockito.verifyPrivate(dataReader, Mockito.times(1)).invoke(NOTIFY_SERIAL_DATA_RECEIVED_METHOD, XBEE_16BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES, IS_NOT_BROADCAST_DATA); Mockito.verify(receiveSerialDataListener, Mockito.times(1)).serialDataReceived(XBEE_16BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES); assertEquals(XBEE_16BIT_ADDRESS.toString(), receiveSerialDataListener.getAddress()); assertArrayEquals(RECEIVED_DATA_BYTES, receiveSerialDataListener.getSerialData()); }

Target:
public void testUnicastSerialDataReceiveSubscribedRx16() throws Exception { dataReader.addSerialDatatReceiveListener(receiveSerialDataListener); Whitebox.invokeMethod(dataReader, PACKET_RECEIVED_METHOD, rx16Packet); PowerMockito.verifyPrivate(dataReader, Mockito.times(1)).invoke(NOTIFY_SERIAL_DATA_RECEIVED_METHOD, XBEE_16BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES, IS_NOT_BROADCAST_DATA); Mockito.verify(receiveSerialDataListener, Mockito.times(1)).serialDataReceived(XBEE_16BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES); Mockito.verify(receiveSerialDataListener, Mockito.never()).broadcastSerialDataReceived(Mockito.anyString(), (byte[])Mockito.any()); assertEquals(XBEE_16BIT_ADDRESS.toString(), receiveSerialDataListener.getAddress()); assertArrayEquals(RECEIVED_DATA_BYTES, receiveSerialDataListener.getSerialData()); }
Source:
public void confirmMessage() { if (!isAcknowledgementSent) { try { channel.basicAck(deliveryTag, false); isAcknowledgementSent = true; } catch (Exception e) { LOG.error(String.format("[consumer tag: %s] Got exception when trying to confirm a message:", consumerTag), e); } } else { LOG.warn(ACK_WAS_ALREADY_SENT); } }

Target:
public void confirmMessage() { executeAck("confirm", () -> { channel.basicAck(deliveryTag, false); LOG.debug(String.format("[consumer tag: %s] A message was confirmed", consumerTag)); }); }
Source:
public String toString() { return this.getClass().getSimpleName() + " { " + getPayloadId() + " }"; }

Target:
public String toString() { return new ToStringBuilder(this) .append("mySubscription", mySubscription) .append("myPayloadString", myPayloadString) .append("myPayload", myPayload) .append("myPayloadId", myPayloadId) .append("myOperationType", myOperationType) .toString(); }
Source:
public Pair<ListenableFuture, Boolean> streamMore(SystemProcedureExecutionContext context, List<DBBPool.BBContainer> outputBuffers, int[] rowCountAccumulator) { ListenableFuture writeFuture = null; prepareBuffers(outputBuffers); Pair<Long, int[]> serializeResult = context.tableStreamSerializeMore(m_tableId, m_type, outputBuffers); if (serializeResult.getFirst() == SERIALIZATION_ERROR) { for (DBBPool.BBContainer container : outputBuffers) { container.discard(); } StreamSnapshotFailedException ex = new StreamSnapshotFailedException("Snapshot of table " + m_tableId + " failed to complete."); m_tableTasks.get(m_tableId).m_target.reportSerializationFailure(ex); return Pair.of(null, false); } if (serializeResult.getSecond()[0] > 0) { if (rowCountAccumulator != null && rowCountAccumulator.length == 1) { rowCountAccumulator[0] += getTupleDataRowCount(outputBuffers); } writeFuture = writeBlocksToTargets(outputBuffers, serializeResult.getSecond()); } else { for (DBBPool.BBContainer container : outputBuffers) { container.discard(); } } return Pair.of(writeFuture, serializeResult.getFirst() > 0); }

Target:
public Pair<ListenableFuture, Boolean> streamMore(SystemProcedureExecutionContext context, List<DBBPool.BBContainer> outputBuffers, int[] rowCountAccumulator) { ListenableFuture writeFuture = null; prepareBuffers(outputBuffers); Pair<Long, int[]> serializeResult = context.tableStreamSerializeMore(m_tableId, m_type, outputBuffers); if (serializeResult.getFirst() == SERIALIZATION_ERROR) { for (DBBPool.BBContainer container : outputBuffers) { container.discard(); } SnapshotSerializationException ex = new SnapshotSerializationException("Snapshot of table " + m_tableId + " failed to complete."); for (SnapshotTableTask task : m_tableTasks) { task.m_target.reportSerializationFailure(ex); } return Pair.of(null, false); } if (serializeResult.getSecond()[0] > 0) { if (rowCountAccumulator != null && rowCountAccumulator.length == 1) { rowCountAccumulator[0] += getTupleDataRowCount(outputBuffers); } writeFuture = writeBlocksToTargets(outputBuffers, serializeResult.getSecond()); } else { for (DBBPool.BBContainer container : outputBuffers) { container.discard(); } } return Pair.of(writeFuture, serializeResult.getFirst() > 0); }
Source:
public void testDAGImportSyntax() throws IOException, TimeoutException, ApiException { final ApiClient webClient = WorkflowET.getWebClient(); WorkflowsApi workflowApi = new WorkflowsApi(webClient); UsersApi usersApi = new UsersApi(webClient); final Long userId = usersApi.getUser().getId(); final PublishRequest publishRequest = new PublishRequest(); publishRequest.setPublish(true); usersApi.refreshWorkflows(userId); Workflow githubWorkflow = workflowApi.manualRegister("github", "DockstoreTestUser2/dockstore-whalesay-imports", "/Dockstore.cwl", "test-workflow", "cwl"); Workflow refresh = workflowApi.refresh(githubWorkflow.getId()); Optional<WorkflowVersion> master = refresh.getWorkflowVersions().stream().filter(workflow -> workflow.getName().equals("master")).findFirst(); final String basePath = webClient.getBasePath(); URL url = new URL(basePath + "/workflows/" +githubWorkflow.getId()+"/dag/" + master.get().getId() ); final List<String> strings = Resources.readLines(url, Charset.forName("UTF-8")); int countNode = 0; int last = 0; String node = "tool"; while(last !=-1){ last = strings.get(0).indexOf(node,last); if(last !=-1){ countNode++; last += node.length(); } } Assert.assertTrue("JSON should not be blank", strings.size() > 0); Assert.assertEquals("JSON should have two nodes", countNode, 2); Assert.assertTrue("node data should have rev as tool", strings.get(0).contains("rev")); Assert.assertTrue("node data should have sorted as tool", strings.get(0).contains("sorted")); Assert.assertTrue("edge should connect rev and sorted", strings.get(0).contains("\"source\":\"0\",\"target\":\"1\"")); }

Target:
public void testDAGImportSyntax() throws IOException, TimeoutException, ApiException { final List<String> strings = getJSON("DockstoreTestUser2/dockstore-whalesay-imports", "/Dockstore.cwl", "cwl", "master"); int countNode = countNodeInJSON(strings); Assert.assertTrue("JSON should not be blank", strings.size() > 0); Assert.assertEquals("JSON should have two nodes", countNode, 2); Assert.assertTrue("node data should have rev as tool", strings.get(0).contains("rev")); Assert.assertTrue("node data should have sorted as tool", strings.get(0).contains("sorted")); Assert.assertTrue("edge should connect rev and sorted", strings.get(0).contains("\"source\":\"0\",\"target\":\"1\"")); }
Source:
public Expr apply(final List<Expr> args) { if (args.size() < 3 || args.size() > 4) { throw new IAE("'%s' must have 3 to 4 arguments", name()); } final Expr arg = args.get(0); if (args.get(1).isLiteral()) { final PeriodGranularity granularity = getGranularity(args, ExprUtils.nilBindings()); final Period period = granularity.getPeriod(); final Chronology chronology = ISOChronology.getInstance(granularity.getTimeZone()); final int step = getStep(args, ExprUtils.nilBindings()); class TimestampShiftExpr implements Expr { @Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { return ExprEval.of(chronology.add(period, arg.eval(bindings).asLong(), step)); } @Override public void visit(final Visitor visitor) { arg.visit(visitor); visitor.visit(this); } } return new TimestampShiftExpr(); } else { class TimestampShiftDynamicExpr implements Expr { @Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { final PeriodGranularity granularity = getGranularity(args, bindings); final Period period = granularity.getPeriod(); final Chronology chronology = ISOChronology.getInstance(granularity.getTimeZone()); final int step = getStep(args, bindings); return ExprEval.of(chronology.add(period, arg.eval(bindings).asLong(), step)); } @Override public void visit(final Visitor visitor) { arg.visit(visitor); visitor.visit(this); } } return new TimestampShiftDynamicExpr(); } }

Target:
public Expr apply(final List<Expr> args) { if (args.size() < 3 || args.size() > 4) { throw new IAE("Function[%s] must have 3 to 4 arguments", name()); } if (args.stream().skip(1).allMatch(Expr::isLiteral)) { return new TimestampShiftExpr(args); } else { return new TimestampShiftDynamicExpr(args); } }
Source:
void adaptTypedFilterTo(SingleColumnValueFilter filter, OutputStream outputStream) throws IOException { if (filter.getFilterIfMissing()) { writerIfIncludeMissingRowFilterExpression(filter, outputStream); } else { try (ReaderExpressionScope rowHasOuter = new ReaderExpressionScope(outputStream, "(", ")")) { try (ReaderExpressionScope rowHas = new ReaderExpressionScope(outputStream, "row_has(", ")")) { try (ReaderExpressionScope condWrapper = new ReaderExpressionScope(outputStream, '(', ')')) { writeFilterColumnSpec(filter, outputStream); } } outputStream.write(Bytes.toBytes(" ? ")); try (ReaderExpressionScope trueWrapper = new ReaderExpressionScope(outputStream, '(', ')')) { writerIfIncludeMissingRowFilterExpression(filter, outputStream); } outputStream.write(Bytes.toBytes(" : ")); try (ReaderExpressionScope falseWrapper = new ReaderExpressionScope(outputStream, '(', ')')) { writeAllColumnsSpec(filter, outputStream); } } } }

Target:
void adaptTypedFilterTo(SingleColumnValueFilter filter, OutputStream outputStream) throws IOException { if (filter.getFilterIfMissing()) { writeRowHasWithValueMatch(filter, outputStream); } else { try (ReaderExpressionScope rowHasOuter = new ReaderExpressionScope(outputStream, '(', ')')) { try (ReaderExpressionScope rowHas = new ReaderExpressionScope(outputStream, "row_has((", "))")) { writeFilterColumnSpec(filter, outputStream); } outputStream.write(Bytes.toBytes(" ? ")); try (ReaderExpressionScope trueWrapper = new ReaderExpressionScope(outputStream, '(', ')')) { writeRowHasWithValueMatch(filter, outputStream); } outputStream.write(Bytes.toBytes(" : ")); try (ReaderExpressionScope falseWrapper = new ReaderExpressionScope(outputStream, '(', ')')) { writeAllColumnsSpec(outputStream); } } } }
Source:
public void shouldValidateProject() throws Exception { final String validateUri = "/gdc/md/PROJECT_ID/validate"; final String task1Uri = validateUri + "/task/TASK_ID"; final String task2Uri = validateUri + "/task/TASK_ID2"; final String resultUri = validateUri + "/result/RESULT_ID"; onRequest() .havingPathEqualTo(validateUri) .respond() .withBody(readResource("/project/project-validationAvail.json")); onRequest() .havingPathEqualTo(validateUri) .havingMethodEqualTo("POST") .respond() .withBody(MAPPER.writeValueAsString(new AsyncTask(task1Uri))) .withStatus(201); onRequest() .havingPathEqualTo(task1Uri) .respond() .withBody(MAPPER.writeValueAsString(new UriResponse(task2Uri))) .withHeader("Location", task2Uri) .withStatus(303); onRequest() .havingPathEqualTo(task2Uri) .respond() .withBody(MAPPER.writeValueAsString(new AsyncTask(task2Uri))) .withStatus(202) .thenRespond() .withBody(MAPPER.writeValueAsString(new UriResponse(resultUri))) .withHeader("Location", resultUri) .withStatus(303); onRequest() .havingPathEqualTo(resultUri) .respond() .withBody(readResource("/project/project-validationResults.json")) .withStatus(200); final ProjectValidationResults validateResult = gd.getProjectService().validateProject(enabled).get(); assertThat(validateResult, notNullValue()); assertThat(validateResult.getResults(), notNullValue()); verifyThatRequest() .havingPathEqualTo(validateUri) .havingMethodEqualTo("POST") .havingBody(isJsonString("/project/project-validate.json")) .receivedOnce(); }

Target:
public void shouldValidateProject() throws Exception { final String validateUri = "/gdc/md/PROJECT_ID/validate"; final String task1Uri = validateUri + "/task/TASK_ID"; final String task2Uri = validateUri + "/task/TASK_ID2"; final String resultUri = validateUri + "/result/RESULT_ID"; onRequest() .havingPathEqualTo(validateUri) .respond() .withBody(readResource("/project/project-validationAvail.json")); onRequest() .havingPathEqualTo(validateUri) .havingMethodEqualTo("POST") .havingBody(isJsonString("/project/project-validate.json")) .respond() .withBody(MAPPER.writeValueAsString(new AsyncTask(task1Uri))) .withStatus(201); onRequest() .havingPathEqualTo(task1Uri) .respond() .withBody(MAPPER.writeValueAsString(new UriResponse(task2Uri))) .withHeader("Location", task2Uri) .withStatus(303); onRequest() .havingPathEqualTo(task2Uri) .respond() .withBody(MAPPER.writeValueAsString(new AsyncTask(task2Uri))) .withStatus(202) .thenRespond() .withBody(MAPPER.writeValueAsString(new UriResponse(resultUri))) .withHeader("Location", resultUri) .withStatus(303); onRequest() .havingPathEqualTo(resultUri) .respond() .withBody(readResource("/project/project-validationResults.json")) .withStatus(200); final ProjectValidationResults validateResult = gd.getProjectService().validateProject(enabled).get(); assertThat(validateResult, notNullValue()); }
Source:
public static List<String> getAvailableProfilesSupportingPasswdChange(SSOExtensionsManager extensionsManager) { List<String> profiles = new ArrayList<>(); for (ExtensionProxy authnExtension : extensionsManager.getExtensionsByService(Authn.class.getName())) { if ((authnExtension.getContext().<Long>get(Authn.ContextKeys.CAPABILITIES, 0L) & Authn.Capabilities.CREDENTIALS_CHANGE) != 0) { Properties config = authnExtension.getContext().get(Base.ContextKeys.CONFIGURATION); profiles.add(config.getProperty(Authn.ConfigKeys.PROFILE_NAME)); } } return profiles; }

Target:
public static List<String> getAvailableProfilesSupportingPasswdChange(SSOExtensionsManager extensionsManager) { return getAvailableProfilesImpl(extensionsManager, Authn.Capabilities.CREDENTIALS_CHANGE); }
Source:
public boolean isLoadedOnMercury() { boolean result = isTagLoadedOnMercury(); Assertion.assertTrue(result, MercuryMessages.INVISIBLE_MSG); PageObjectLogging.log(getTagName(), MercuryMessages.VISIBLE_MSG, result); return result; }

Target:
public boolean isLoadedOnMercury() { boolean result = isTagLoadedOnMercury(); PageObjectLogging.log(getTagName(), MercuryMessages.VISIBLE_MSG, result); return result; }
Source:
private boolean doesNotMatch(String responseBody, List<String> notContentStrings) { boolean matches = true; if (!notContentStrings.isEmpty()) { for (String notContentStr : notContentStrings) { matches = !responseBody.contains(notContentStr); if (!matches) { return matches; } } } return matches; }

Target:
private static boolean doesNotMatch(String responseBody, List<String> notContentStrings) { if (notContentStrings.isEmpty()) { return true; } return !doesMatch(responseBody, notContentStrings); }
Source:
public int hashCode() { return new HashCodeBuilder() .append(group) .append(name) .append(value) .toHashCode(); }

Target:
public int hashCode() { int result = group != null ? group.hashCode() : 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (value != null ? value.hashCode() : 0); return result; }
Source:
public List<StreamsDatum> process(StreamsDatum streamsDatum) { StreamsDatum result = null; try { Object item = streamsDatum.getDocument(); LOGGER.debug("{} processing {}", STREAMS_ID, item.getClass()); Activity activity = null; if(item instanceof String) { item = deserializeItem(item); } if(item instanceof Video) { activity = new Activity(); youtubeActivityUtil.updateActivity((Video)item, activity, streamsDatum.getId()); } if(activity != null) { result = new StreamsDatum(activity); count++; } } catch (Exception e) { e.printStackTrace(); LOGGER.error("Exception while converting Video to Activity: {}", e.getMessage()); } if( result != null ) return Lists.newArrayList(result); else return Lists.newArrayList(); }

Target:
public List<StreamsDatum> process(StreamsDatum streamsDatum) { StreamsDatum result = null; try { Object item = streamsDatum.getDocument(); LOGGER.debug("{} processing {}", STREAMS_ID, item.getClass()); Activity activity = null; if(item instanceof String) { item = deserializeItem(item); } if(item instanceof Video) { activity = new Activity(); youtubeActivityUtil.updateActivity((Video)item, activity, streamsDatum.getId()); } if(activity != null) { result = new StreamsDatum(activity); count++; } } catch (Exception e) { LOGGER.error("Exception while converting Video to Activity: {}", e); } if( result != null ) return Lists.newArrayList(result); else return Lists.newArrayList(); }
Source:
List<GlyphPair> scriptOneToScriptTwoList() { return homoglyphPairs.stream() .sorted(sortByLength.reversed().thenComparing(sortByNaturalOrder)) .collect(Collectors.toList()); }

Target:
final List<GlyphPair> scriptOneToScriptTwoList() { return homoglyphPairs.stream() .sorted(sortByLength.reversed().thenComparing(sortByNaturalOrder)) .collect(Collectors.toList()); }
Source:
public void testCorsPreflightNegative() throws Exception { HttpOptions request = new HttpOptions(presignedGET); CloseableHttpResponse response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); request.reset(); request.setHeader(HttpHeaders.ORIGIN, "<LINK_0>"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"); response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); request.reset(); request.setHeader(HttpHeaders.ORIGIN, "<LINK_1>"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "PATCH"); response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); request.reset(); request.setHeader(HttpHeaders.ORIGIN, "<LINK_1>"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Accept-Encoding"); response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); request.reset(); request.setHeader(HttpHeaders.ORIGIN, "<LINK_1>"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Accept, Accept-Encoding"); response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); }

Target:
public void testCorsPreflightNegative() throws Exception { HttpOptions request = new HttpOptions(presignedGET); HttpResponse response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); request.reset(); request.setHeader(HttpHeaders.ORIGIN, "<LINK_0>"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"); response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); request.reset(); request.setHeader(HttpHeaders.ORIGIN, "<LINK_1>"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "PATCH"); response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); request.reset(); request.setHeader(HttpHeaders.ORIGIN, "<LINK_1>"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Accept-Encoding"); response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); request.reset(); request.setHeader(HttpHeaders.ORIGIN, "<LINK_1>"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"); request.setHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Accept, Accept-Encoding"); response = httpClient.execute(request); assertThat(response.getStatusLine().getStatusCode()) .isEqualTo(HttpStatus.SC_FORBIDDEN); }
Source:
public long extractTimestampMillis(final Message message) { return 0; }

Target:
abstract protected long extractTimestampMillis(final Message message) throws Exception; protected static long toMillis(final long timestamp) { final long nanosecondDivider = (long) Math.pow(10, 9 + 9); final long millisecondDivider = (long) Math.pow(10, 9 + 3); long timestampMillis; if (timestamp / nanosecondDivider > 0L) { timestampMillis = timestamp / (long) Math.pow(10, 6); } else if (timestamp / millisecondDivider > 0L) { timestampMillis = timestamp; } else { timestampMillis = timestamp * 1000L; } return timestampMillis; }
Source:
public void visit(final ElkGraphElement element) { if (element instanceof ElkNode) { if (applyToFullGraphFirst) { ElkUtil.applyVisitors((ElkNode) element, graphVisitors.toArray(new IGraphElementVisitor[graphVisitors.size()])); } else { for (IGraphElementVisitor graphVisitor : graphVisitors) { graphVisitor.visit(element); } } } }

Target:
public void visit(final ElkGraphElement element) { if (applyToFullGraphFirst) { if (element.eContainer() == null && element instanceof ElkNode) { ElkUtil.applyVisitors((ElkNode) element, graphVisitors.toArray(new IGraphElementVisitor[graphVisitors.size()])); } } else { for (IGraphElementVisitor graphVisitor : graphVisitors) { graphVisitor.visit(element); } } }
Source:
public void reportCompleted() { vmPoolMonitor.startingVmCompleted(getVmId(), "reportCompleted"); super.reportCompleted(); }

Target:
public void reportCompleted() { super.reportCompleted(); if (getVm().getVmPoolId() != null) { vmPoolMonitor.startingVmCompleted(getVmId(), "reportCompleted"); } }
Source:
public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException { String deribitInstrumentName = DeribitAdapters.adaptInstrumentName(currencyPair, args); DeribitTicker deribitTicker; try { deribitTicker = super.getDeribitTicker(deribitInstrumentName); } catch (DeribitException ex) { throw new ExchangeException(ex); } return DeribitAdapters.adaptTicker(deribitTicker); }

Target:
public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException { String deribitInstrumentName = DeribitAdapters.adaptInstrumentName(currencyPair, args); DeribitTicker deribitTicker; try { deribitTicker = super.getDeribitTicker(deribitInstrumentName); } catch (DeribitException ex) { throw DeribitAdapters.adapt(ex); } return DeribitAdapters.adaptTicker(deribitTicker); }
Source:
public List<Double> sample(final RandomGenerator rng, final Function<Double, Double> logPDF, final int numSamples, final int numBurnIn) { Utils.nonNull(rng); Utils.nonNull(logPDF); ParamUtils.isPositive(numSamples, "Number of samples must be positive."); ParamUtils.isPositive(numBurnIn, "Number of burn-in samples must be positive."); if (numSamples < numBurnIn) { throw new IllegalArgumentException("Number of examples must be greater than number of burn-in samples."); } final List<Double> samples = new ArrayList<>(numSamples); for (int i = 0; i < numSamples; i++) { xCurrent = sample(rng, logPDF); if (i > numBurnIn) { samples.add(xCurrent); } } return samples; }

Target:
public List<Double> sample(final RandomGenerator rng, final Function<Double, Double> logPDF, final int numSamples, final int numBurnIn) { Utils.nonNull(rng); Utils.nonNull(logPDF); ParamUtils.isPositive(numSamples, "Number of samples must be positive."); ParamUtils.isPositiveOrZero(numBurnIn, "Number of burn-in samples must be non-negative."); Utils.validateArg(numBurnIn < numSamples, "Number of samples must be greater than number of burn-in samples."); final List<Double> samples = new ArrayList<>(numSamples); for (int i = 0; i < numSamples; i++) { xCurrent = sample(rng, logPDF); if (i > numBurnIn) { samples.add(xCurrent); } } return samples; }
Source:
private List<String> deserializeMixins(JsonObject configJson) { List<String> mixins = new ArrayList<>(); JsonArray mixinsFromJson = configJson.get("mixinTypes") == null ? null : configJson.get("mixinTypes").getAsJsonArray(); if (mixinsFromJson != null) { for (JsonElement jsonElement : mixinsFromJson) { mixins.add(jsonElement.getAsString()); } } return mixins; }

Target:
private List<String> deserializeMixins(JsonObject configJson) { JsonArray mixinsFromJson = configJson.get("mixins") == null ? null : configJson.get("mixins").getAsJsonArray(); if (mixinsFromJson == null) { return Collections.emptyList(); } List<String> mixins = new ArrayList<>(mixinsFromJson.size()); for (JsonElement jsonElement : mixinsFromJson) { mixins.add(jsonElement.getAsString()); } return mixins; }
Source:
public ArrayList<String> getMpTermIds() { return mpTermIds; }

Target:
public List<String> getMpTermIds() { return mpTermIds; }
Source:
private List<ParserResult> parseFiles(final AbstractBuild<?, ?> build, final PluginLogger logger) throws IOException, InterruptedException { List<ParserResult> results = Lists.newArrayList(); for (ParserConfiguration configuration : getParserConfigurations()) { String filePattern = configuration.getPattern(); String parserName = configuration.getParserName(); final int resolveDepth = 10; final Map<String,String> buildParameterMap = build.getBuildVariables(); for(int i = 0; i < resolveDepth ; i++) { String old = filePattern; filePattern = Util.replaceMacro(filePattern, buildParameterMap); if (old == filePattern) { break; } } logger.log("Parsing warnings in files '" + filePattern + "' with parser " + parserName); FilesParser parser = new FilesParser(PLUGIN_NAME, filePattern, new FileWarningsParser(ParserRegistry.getParsers(parserName), getDefaultEncoding(), getIncludePattern(), getExcludePattern()), shouldDetectModules(), isMavenBuild(build), canResolveRelativePaths()); ParserResult project = build.getWorkspace().act(parser); logger.logLines(project.getLogMessages()); returnIfCanceled(); results.add(annotate(build, project, configuration.getParserName())); } return results; }

Target:
private List<ParserResult> parseFiles(final AbstractBuild<?, ?> build, final PluginLogger logger) throws IOException, InterruptedException { List<ParserResult> results = Lists.newArrayList(); for (ParserConfiguration configuration : getParserConfigurations()) { String filePattern = configuration.getPattern(); String parserName = configuration.getParserName(); final int resolveDepth = 10; final Map<String,String> buildParameterMap = build.getBuildVariables(); for(int i = 0; i < resolveDepth ; i++) { String old = filePattern; filePattern = Util.replaceMacro(filePattern, buildParameterMap); if (old.equals(filePattern)) { break; } } logger.log("Parsing warnings in files '" + filePattern + "' with parser " + parserName); FilesParser parser = new FilesParser(PLUGIN_NAME, filePattern, new FileWarningsParser(ParserRegistry.getParsers(parserName), getDefaultEncoding(), getIncludePattern(), getExcludePattern()), shouldDetectModules(), isMavenBuild(build), canResolveRelativePaths()); ParserResult project = build.getWorkspace().act(parser); logger.logLines(project.getLogMessages()); returnIfCanceled(); results.add(annotate(build, project, configuration.getParserName())); } return results; }
Source:
protected void allowAccess(long secretId, long groupId) { dslContext .insertInto(ACCESSGRANTS) .set(ACCESSGRANTS.SECRETID, (int) secretId) .set(ACCESSGRANTS.GROUPID, (int) groupId) .execute(); }

Target:
protected void allowAccess(long secretId, long groupId) { dslContext .insertInto(ACCESSGRANTS) .set(ACCESSGRANTS.SECRETID, Math.toIntExact(secretId)) .set(ACCESSGRANTS.GROUPID, Math.toIntExact(groupId)) .execute(); }
Source:
default Seq<Tuple2<T, T>> innerSelfJoin(BiPredicate<? super T, ? super T> predicate) { List<? extends T> list = toList(); return seq(list).flatMap(t -> seq(list) .filter(u -> predicate.test(t, u)) .map(u -> tuple(t, u))); }

Target:
default Seq<Tuple2<T, T>> innerSelfJoin(BiPredicate<? super T, ? super T> predicate) { List<? extends T> list = toList(); return seq(list).innerJoin(seq(list), predicate); }
Source:
protected String[][] formatTableContents() { final String [][] formatArray = new String[this.tapeList.size()][]; int i = 0; for (final Tape tape : this.tapeList) { final String bucketArray = new String[this.columnCount]; bucketArray[0] = nullGuard(tape.getBarCode()); bucketArray[1] = nullGuardToString(tape.getId()); bucketArray[2] = nullGuardToString(tape.getState()); final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); bucketArray[3] = nullGuardToDate(tape.getLastModified(),DATE_FORMAT); bucketArray[4] = nullGuardToString(tape.getAvailableRawCapacity()); bucketArray[5] = nullGuardToString(tape.getBucketId()); bucketArray[6] = nullGuardToString(tape.getAssignedToStorageDomain()); formatArray[i++] = (bucketArray); } return formatArray; }

Target:
protected String[][] formatTableContents() { final String [][] formatArray = new String[this.tapeList.size()][]; int i = 0; for (final Tape tape : this.tapeList) { final String bucketArray = new String[this.columnCount]; bucketArray[0] = nullGuard(tape.getBarCode()); bucketArray[1] = nullGuardToString(tape.getId()); bucketArray[2] = nullGuardToString(tape.getState()); bucketArray[3] = nullGuardToDate(tape.getLastModified(),DATE_FORMAT); bucketArray[4] = nullGuardToString(tape.getAvailableRawCapacity()); bucketArray[5] = nullGuardToString(tape.getBucketId()); bucketArray[6] = nullGuardToString(tape.getAssignedToStorageDomain()); formatArray[i++] = (bucketArray); } return formatArray; }
Source:
public RegionNormalizerWorkQueue() { delegate = new LinkedHashSet<>(); takeLock = new ReentrantLock(); notEmpty = takeLock.newCondition(); putLock = new ReentrantLock(); }

Target:
RegionNormalizerWorkQueue() { delegate = new LinkedHashSet<>(); takeLock = new ReentrantLock(); notEmpty = takeLock.newCondition(); putLock = new ReentrantLock(); }
Source:
protected void setQcowCompatForSnapshot(DiskImage snapshot, DiskImage volInfo) { if (snapshot.getVolumeFormat().equals(VolumeFormat.COW)) { try { if (volInfo == null) { volInfo = getVolumeInfo(snapshot.getStoragePoolId(), getParameters().getStorageDomainId(), snapshot.getId(), snapshot.getImageId()); } if (volInfo != null) { setQcowCompatByQemuImageInfo(snapshot.getStoragePoolId(), snapshot.getId(), snapshot.getImageId(), getParameters().getStorageDomainId(), snapshot); } imageDao.update(snapshot.getImage()); } catch (EngineException e) { log.error("Unable to update the image info for image '{}' (image group: '{}') on domain '{}'", snapshot.getImageId(), snapshot.getId(), getParameters().getStorageDomainId()); } } }

Target:
protected void setQcowCompatForSnapshot(DiskImage snapshot, DiskImage volInfo) { DiskImage info = volInfo; if (snapshot.getVolumeFormat().equals(VolumeFormat.COW)) { try { if (info == null) { info = getVolumeInfo(snapshot.getStoragePoolId(), getParameters().getStorageDomainId(), snapshot.getId(), snapshot.getImageId()); } if (info != null) { setQcowCompatByQemuImageInfo(snapshot.getStoragePoolId(), snapshot.getId(), snapshot.getImageId(), getParameters().getStorageDomainId(), snapshot); } imageDao.update(snapshot.getImage()); } catch (EngineException e) { log.error("Unable to update the image info for image '{}' (image group: '{}') on domain '{}'", snapshot.getImageId(), snapshot.getId(), getParameters().getStorageDomainId()); } } }