auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Void read() { Table table = null; TableDescriptor tableDesc = null; boolean regionTaskReadAllCF = connection.getConfiguration().getBoolean(HConstants.HBASE_CANARY_READ_ALL_CF, true); try { LOG.debug("Reading table descriptor for table {}", region.getTable()); table = connection.getTable(region.getTable()); tableDesc = table.getDescriptor(); } catch (IOException e) { LOG.debug("sniffRegion of failed", region.getEncodedName(), e); sink.publishReadFailure(serverName, region, e); if (table != null) { try { table.close(); } catch (IOException ioe) { LOG.error("Close table failed", e); } } return null; } if (regionTaskReadAllCF) { for (ColumnFamilyDescriptor column : tableDesc.getColumnFamilies()) { readColumnFamily(table, column); } } else { readColumnFamily(table, randomPickOneColumnFamily(tableDesc.getColumnFamilies())); } try { table.close(); } catch (IOException e) { LOG.error("Close table failed", e); } return null; }

Target:
public Void read() { Table table = null; TableDescriptor tableDesc = null; try { LOG.debug("Reading table descriptor for table {}", region.getTable()); table = connection.getTable(region.getTable()); tableDesc = table.getDescriptor(); } catch (IOException e) { LOG.debug("sniffRegion of failed", region.getEncodedName(), e); sink.publishReadFailure(serverName, region, e); if (table != null) { try { table.close(); } catch (IOException ioe) { LOG.error("Close table failed", e); } } return null; } if (readAllCF) { for (ColumnFamilyDescriptor column : tableDesc.getColumnFamilies()) { readColumnFamily(table, column); } } else { readColumnFamily(table, randomPickOneColumnFamily(tableDesc.getColumnFamilies())); } try { table.close(); } catch (IOException e) { LOG.error("Close table failed", e); } return null; }
Source:
public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); if (m_limit != null) { pw.item("limit", m_limit); } if (m_offset != null) { pw.item("offset", m_offset); } return pw; }

Target:
public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .itemIf("limit", m_limit, m_limit != null) .itemIf("offset", m_offset, m_offset != null); }
Source:
private ExecutorService getBatchPool() { if (batchPool == null) { synchronized (this) { if (batchPool == null) { int minThreads = getMinThreads(); int maxThreads = getMaxThreads(); long keepAliveTime = conf.getLong( "hbase.hconnection.threads.keepalivetime", 60); LinkedBlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<Runnable>(128 * conf.getInt("hbase.client.max.total.tasks", 200)); this.batchPool = new ThreadPoolExecutor( minThreads, maxThreads, keepAliveTime, TimeUnit.SECONDS, workQueue, Threads.newDaemonThreadFactory("bigtable-connection-shared-executor")); } this.cleanupPool = true; } } return this.batchPool; }

Target:
private ExecutorService getBatchPool() { if (batchPool == null) { synchronized (this) { if (batchPool == null) { int maxThreads = getMaxThreads(); int minThreads = Math.min(getCoreThreads(), maxThreads); long keepAliveTime = conf.getLong("hbase.hconnection.threads.keepalivetime", 60); LinkedBlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<Runnable>(128 * conf.getInt("hbase.client.max.total.tasks", 200)); this.batchPool = new ThreadPoolExecutor( minThreads, maxThreads, keepAliveTime, TimeUnit.SECONDS, workQueue, Threads.newDaemonThreadFactory("bigtable-connection-shared-executor")); } this.cleanupPool = true; } } return this.batchPool; }
Source:
private static void sendResponse(Channel channel, int device, long id, int crc) { if (channel != null) { ChannelBuffer response = ChannelBuffers.dynamicBuffer(ByteOrder.LITTLE_ENDIAN, 0); response.writeByte(device); response.writeByte(MSG_ACK); response.writeInt((int) id); response.writeShort(crc); response.writeShort(Checksum.crc16( Checksum.CRC16_XMODEM, response.toByteBuffer(0, response.readableBytes()))); ChannelBuffer encoded = ChannelBuffers.dynamicBuffer(); encoded.writeByte(0x01); while (response.readable()) { int b = response.readByte(); if (b == 0x01 || b == 0x04 || b == 0x10 || b == 0x11 || b == 0x13) { encoded.writeByte(0x10); b += 0x20; } encoded.writeByte(b); } encoded.writeByte(0x04); channel.write(encoded); } }

Target:
private static void sendResponse(Channel channel, int device, long id, int crc) { if (channel != null) { ChannelBuffer response = ChannelBuffers.dynamicBuffer(ByteOrder.LITTLE_ENDIAN, 0); response.writeByte(device); response.writeByte(MSG_ACK); response.writeInt((int) id); response.writeShort(crc); response.writeShort(Checksum.crc16( Checksum.CRC16_XMODEM, response.toByteBuffer())); ChannelBuffer encoded = ChannelBuffers.dynamicBuffer(); encoded.writeByte(0x01); while (response.readable()) { int b = response.readByte(); if (b == 0x01 || b == 0x04 || b == 0x10 || b == 0x11 || b == 0x13) { encoded.writeByte(0x10); b += 0x20; } encoded.writeByte(b); } encoded.writeByte(0x04); channel.write(encoded); } }
Source:
public void testHierarchyView() { DockerImagesTab imageTab = openDockerImagesTab(); buildImage(IMAGE_TEST_BUILD, DOCKERFILE_FOLDER, imageTab); if (mockitoIsUsed()) { setupDataForMockito(); } DockerImageHierarchyTab hierarchyTab = openDockerImageHierarchyTab(); List<TreeItem> treeItems = hierarchyTab.getTreeItems(); compareTextInFirstNode(treeItems, "alpine:3.3"); List<TreeItem> treeItems2 = treeItems.get(0).getItems(); compareTextInFirstNode(treeItems2, IMAGE_TEST_BUILD + NAME_TAG_SEPARATOR + IMAGE_TAG_LATEST); }

Target:
public void testHierarchyView() { DockerImagesTab imageTab = openDockerImagesTab(); buildImage(IMAGE_TEST_BUILD, DOCKERFILE_FOLDER, imageTab); if (mockitoIsUsed()) { buildImage(); } DockerImageHierarchyTab hierarchyTab = openDockerImageHierarchyTab(); List<TreeItem> treeItems = hierarchyTab.getTreeItems(); compareTextInFirstNode(treeItems, "alpine:3.3"); List<TreeItem> treeItems2 = treeItems.get(0).getItems(); compareTextInFirstNode(treeItems2, IMAGE_TEST_BUILD + NAME_TAG_SEPARATOR + IMAGE_TAG_LATEST); }
Source:
private long copyPackBypassCache(PackOutputStream out, ReadableChannel rc) throws IOException { ByteBuffer buf = newCopyBuffer(out, rc); long position = 12; long remaining = length - (12 + 20); boolean packHeadSkipped = false; while (0 < remaining) { DfsBlock b = cache.get(key, alignToBlock(position)); if (b != null) { int ptr = (int) (position - b.start); int n = (int) Math.min(b.size() - ptr, remaining); b.write(out, position, n); position += n; remaining -= n; rc.position(position); packHeadSkipped = true; continue; } buf.position(0); int bufLen = read(rc, buf); if (bufLen <= 0) { throw packfileIsTruncated(); } int ptr = packHeadSkipped ? 0 : 12; int n = (int) Math.min(bufLen - ptr, remaining); out.write(buf.array(), ptr, n); position += n; remaining -= n; packHeadSkipped = true; } return position; }

Target:
private long copyPackBypassCache(PackOutputStream out, ReadableChannel rc) throws IOException { ByteBuffer buf = newCopyBuffer(out, rc); long position = 12; long remaining = length - (12 + 20); boolean packHeadSkipped = false; while (0 < remaining) { DfsBlock b = cache.get(key, alignToBlock(position)); if (b != null) { int ptr = (int) (position - b.start); int n = (int) Math.min(b.size() - ptr, remaining); if (n <= 0) { throw packfileIsTruncated(); } b.write(out, position, n); position += n; remaining -= n; rc.position(position); packHeadSkipped = true; continue; } int ptr = packHeadSkipped ? 0 : 12; buf.position(0); int bufLen = read(rc, buf); if (bufLen <= ptr) { throw packfileIsTruncated(); } int n = (int) Math.min(bufLen - ptr, remaining); out.write(buf.array(), ptr, n); position += n; remaining -= n; packHeadSkipped = true; } return position; }
Source:
private Map<String, List<String>> getServicesParameters(Collection<CheFeature> features) { Map<String, List<String>> parameters = new HashMap<>(); for (CheFeature feature : features) { for (CheServiceReference serviceReference : feature.getSpec().getServices()) { if (serviceReference.getParameters().isEmpty()) { continue; } String serviceName = serviceReference.getName(); String serviceVersion = serviceReference.getVersion(); for (CheServiceParameter cheServiceParameter : serviceReference.getParameters()) { String parameterKey = serviceName + "/" + serviceVersion + "/${" + cheServiceParameter.getName() + "}"; parameters.putIfAbsent(parameterKey, new ArrayList<>()); List<String> cheServiceParameters = parameters.get(parameterKey); cheServiceParameters.add(cheServiceParameter.getValue()); } } } return parameters; }

Target:
private Map<String, List<String>> getServicesParameters(Collection<CheFeature> features) { Map<String, List<String>> parameters = new HashMap<>(); for (CheFeature feature : features) { for (CheServiceReference serviceReference : feature.getSpec().getServices()) { if (serviceReference.getParameters().isEmpty()) { continue; } String serviceName = serviceReference.getName(); String serviceVersion = serviceReference.getVersion(); for (CheServiceParameter cheServiceParameter : serviceReference.getParameters()) { String parameterKey = serviceName + "/" + serviceVersion + "/${" + cheServiceParameter.getName() + "}"; List<String> cheServiceParameters = parameters.computeIfAbsent(parameterKey, key -> new ArrayList<>()); cheServiceParameters.add(cheServiceParameter.getValue()); } } } return parameters; }
Source:
private static Optional<TupleDomainFilter> getFilter(Type type) { if (type == BOOLEAN) { return Optional.of(BooleanValue.of(true, true)); } if (type == TINYINT || type == BIGINT || type == INTEGER || type == SMALLINT || type == DATE) { return Optional.of(BigintRange.of(0, Long.MAX_VALUE, true)); } if (type == DOUBLE) { return Optional.of(DoubleRange.of(Double.MIN_VALUE, false, false, Double.MAX_VALUE, false, false, false)); } throw new UnsupportedOperationException("Unsupported type: " + type); }

Target:
private static Optional<TupleDomainFilter> getFilter(Type type) { if (type == BOOLEAN) { return Optional.of(BooleanValue.of(true, true)); } if (type == TINYINT || type == BIGINT || type == INTEGER || type == SMALLINT || type == DATE || type == TIMESTAMP) { return Optional.of(BigintRange.of(0, Long.MAX_VALUE, true)); } if (type == REAL) { return Optional.of(FloatRange.of(0, true, true, Integer.MAX_VALUE, true, true, true)); } if (type == DOUBLE) { return Optional.of(DoubleRange.of(.5, false, false, 2, false, false, false)); } throw new UnsupportedOperationException("Unsupported type: " + type); }
Source:
public void testNameFinderWithTypes() throws Exception { InputStream in = getClass().getClassLoader().getResourceAsStream( "opennlp/tools/namefind/AnnotatedSentencesWithTypes.txt"); String encoding = "ISO-8859-1"; ObjectStream<NameSample> sampleStream = new NameSampleDataStream( new PlainTextByLineStream(new MockInputStreamFactory(in), encoding)); TrainingParameters params = new TrainingParameters(); params.put(TrainingParameters.ITERATIONS_PARAM, Integer.toString(70)); params.put(TrainingParameters.CUTOFF_PARAM, Integer.toString(1)); TokenNameFinderModel nameFinderModel = NameFinderME.train("en", TYPE, sampleStream, params, TokenNameFinderFactory.create(null, null, Collections.emptyMap(), TokenNameFinderFactory.instantiateSequenceCodec(null))); NameFinderME nameFinder = new NameFinderME(nameFinderModel); String[] sentence2 = new String[] { "Hi", "Mike", ",", "it's", "Stefanie", "Schmidt", "." }; Span[] names2 = nameFinder.find(sentence2); assertEquals(2, names2.length); assertEquals(new Span(1, 2, "person"), names2[0]); assertEquals(new Span(4, 6, "person"), names2[1]); assertEquals("person", names2[0].getType()); assertEquals("person", names2[1].getType()); String sentence[] = { "Alisa", "appreciated", "the", "hint", "and", "enjoyed", "a", "delicious", "traditional", "meal." }; Span names[] = nameFinder.find(sentence); assertEquals(1, names.length); assertEquals(new Span(0, 1, "person"), names[0]); assertTrue(hasOtherAsOutcome(nameFinderModel)); }

Target:
public void testNameFinderWithTypes() throws Exception { InputStream in = getClass().getClassLoader().getResourceAsStream( "opennlp/tools/namefind/AnnotatedSentencesWithTypes.txt"); String encoding = "ISO-8859-1"; ObjectStream<NameSample> sampleStream = new NameSampleDataStream( new PlainTextByLineStream(new MockInputStreamFactory(in), encoding)); TrainingParameters params = new TrainingParameters(); params.put(TrainingParameters.ITERATIONS_PARAM, Integer.toString(70)); params.put(TrainingParameters.CUTOFF_PARAM, Integer.toString(1)); TokenNameFinderModel nameFinderModel = NameFinderME.train("en", TYPE, sampleStream, params, TokenNameFinderFactory.create(null, null, Collections.emptyMap(), new BioCodec())); NameFinderME nameFinder = new NameFinderME(nameFinderModel); String[] sentence2 = new String[] { "Hi", "Mike", ",", "it's", "Stefanie", "Schmidt", "." }; Span[] names2 = nameFinder.find(sentence2); assertEquals(2, names2.length); assertEquals(new Span(1, 2, "person"), names2[0]); assertEquals(new Span(4, 6, "person"), names2[1]); assertEquals("person", names2[0].getType()); assertEquals("person", names2[1].getType()); String sentence[] = { "Alisa", "appreciated", "the", "hint", "and", "enjoyed", "a", "delicious", "traditional", "meal." }; Span names[] = nameFinder.find(sentence); assertEquals(1, names.length); assertEquals(new Span(0, 1, "person"), names[0]); assertTrue(hasOtherAsOutcome(nameFinderModel)); }
Source:
public AbstractComment() { this.date = ZonedDateTime.now(UTC).toLocalDate(); }

Target:
public AbstractComment() { this.date = LocalDate.now(UTC); }
Source:
public void shouldNotPutIfSameValuesAndGreaterTimestamp() { inner.put(eq(keyBytes), aryEq(valueAndTimestampBytes)); expectLastCall(); init(); metered.put(key, valueAndTimestamp); final ValueAndTimestampSerde<String> stringSerde = new ValueAndTimestampSerde<>(Serdes.String()); final byte[] encodedOldValue = stringSerde.serializer().serialize("TOPIC", valueAndTimestamp); final ValueAndTimestamp<String> newValueAndTimestamp = ValueAndTimestamp.make("value", 98L); assertFalse(metered.putIfDifferentValues(key, newValueAndTimestamp, encodedOldValue)); }

Target:
public void shouldNotPutIfSameValuesAndGreaterTimestamp() { init(); metered.put(key, valueAndTimestamp); final ValueAndTimestampSerde<String> stringSerde = new ValueAndTimestampSerde<>(Serdes.String()); final byte[] encodedOldValue = stringSerde.serializer().serialize("TOPIC", valueAndTimestamp); final ValueAndTimestamp<String> newValueAndTimestamp = ValueAndTimestamp.make("value", 98L); assertFalse(metered.putIfDifferentValues(key, newValueAndTimestamp, encodedOldValue)); verify(inner); }
Source:
protected File createFile(String fileName, String content) throws FileNotFoundException, UnsupportedEncodingException { String filePath = repositoryPath + "/" + fileName; PrintWriter writer = new PrintWriter(filePath, "UTF-8"); writer.println(content); writer.close(); return new File(filePath); }

Target:
protected File createFile(String fileName, String content) throws FileNotFoundException, UnsupportedEncodingException { String filePath = repositoryPath + System.getProperty("file.separator") + fileName; PrintWriter writer = new PrintWriter(filePath, "UTF-8"); writer.println(content); writer.close(); return new File(filePath); }
Source:
public Map<String, String> getShellEnvironment() { Map<String, String> orig = super.getShellEnvironment(); String kafkaJmxOpts = orig.remove("JAVA_OPTS"); if (Strings.isBlank(kafkaJmxOpts)) kafkaJmxOpts = " "; return MutableMap.<String, String>builder() .putAll(orig) .putIfNotNull("KAFKA_JMX_OPTS", kafkaJmxOpts) .build(); }

Target:
public Map<String, String> getShellEnvironment() { Map<String, String> orig = super.getShellEnvironment(); String kafkaJmxOpts = orig.remove("JAVA_OPTS"); return MutableMap.<String, String>builder() .putAll(orig) .putIfNotNull("KAFKA_JMX_OPTS", kafkaJmxOpts) .build(); }
Source:
public List<UserFromView> getTableFromView() { List<UserFromView> usersList = new LinkedList<>(); int pagination = 0; do { if (driver.findElements(AdministrationPageLocators.TABLE_ROWS.getBy()).size() <= 1) { } else { List<WebElement> rowsList = driver.findElements(AdministrationPageLocators.TABLE_ROWS.getBy()); for (int j = 1; j < rowsList.size(); j++) { List<WebElement> cellsList = rowsList.get(j).findElements(AdministrationPageLocators.ROW_CELLS.getBy()); usersList.add(new UserFromView.Builder() .withFirstName(cellsList.get(0).getText()) .withLastName(cellsList.get(1).getText()) .withLogin(cellsList.get(2).getText()) .withRole(cellsList.get(3).getText()) .withRegion(cellsList.get(4).getText()) .build()); } } pagination++; clickNextButton(); } while (pagination < getQuantityOfTablePages()); clickFirstButton(); Reporter.log(String.format("<br>INFO&nbsp;&nbsp; - <b>We got a table.</b>")); return usersList; }

Target:
public List<UserFromView> getTableFromView() { List<UserFromView> usersList = new LinkedList<>(); int pagination = 0; do { if (driver.findElements(AdministrationPageLocators.TABLE_ROWS.getBy()).size() <= 1) { } else { List<WebElement> rowsList = driver.findElements(AdministrationPageLocators.TABLE_ROWS.getBy()); for (int j = 1; j < rowsList.size(); j++) { List<WebElement> cellsList = rowsList.get(j).findElements(AdministrationPageLocators.ROW_CELLS.getBy()); usersList.add(UserFromView.newBuilder() .firstName(cellsList.get(0).getText()) .lastName(cellsList.get(1).getText()) .login(cellsList.get(2).getText()) .role(cellsList.get(3).getText()) .region(cellsList.get(4).getText()) .build()); } } pagination++; clickNextButton(); } while (pagination < getQuantityOfTablePages()); clickFirstButton(); return usersList; }
Source:
public void processStream(InputStream input) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(input)); int linenum = 0; while (linenum < numlines) { String line = reader.readLine(); if (line == null) { return; } lines.add(line); linenum++; } while (reader.read() != -1) { ; } }

Target:
public void processStream(InputStream input) throws IOException { try (BufferedInputStream bufStream = new BufferedInputStream(input); BufferedReader reader = new BufferedReader(new InputStreamReader(bufStream, this.charset), bufferedReaderSize)) { int lineNum = 0; while (lineNum < maxLines) { String line = reader.readLine(); if (line == null) { return; } lines.add(line); lineNum++; } byte[] buf = new byte[1024]; while ((bufStream.read(buf)) != -1) { ; } } }
Source:
public void processLeftData(final MistDataEvent input) { applyStatefulFunction.initialize(); try { final Collection<IN> value = ((WindowData<IN>) input.getValue()).getDataCollection(); for (final IN data : value) { applyStatefulFunction.update(data); } final OUT operationResult = applyStatefulFunction.produceResult(); LOG.log(Level.FINE, "{0} initializes and updates the operator state with input {1} using {2}, and generates {3}", new Object[]{getOperatorIdentifier(), input, applyStatefulFunction, operationResult}); input.setValue(operationResult); outputEmitter.emitData(input); } catch (final ClassCastException e) { throw e; } }

Target:
public void processLeftData(final MistDataEvent input) { applyStatefulFunction.initialize(); try { final WindowData<IN> windowData = (WindowData<IN>) input.getValue(); final Collection<IN> value = windowData.getDataCollection(); for (final IN data : value) { applyStatefulFunction.update(data); } final OUT operationResult = applyStatefulFunction.produceResult(); LOG.log(Level.FINE, "{0} initializes and updates the operator state to {1} with input window {2} " + "which started at {3} and ended at {4}, and generates {5}", new Object[]{getOperatorIdentifier(), applyStatefulFunction.getCurrentState(), input, windowData.getStart(), windowData.getEnd(), operationResult}); input.setValue(operationResult); outputEmitter.emitData(input); } catch (final ClassCastException e) { throw e; } }
Source:
public Map<Path, Set<Integer>> branchChangedLines(String targetBranchName, Path rootBaseDir, Set<Path> changedFiles) { try (Repository repo = buildRepo(rootBaseDir)) { Ref targetRef = resolveTargetRef(targetBranchName, repo); if (targetRef == null) { return null; } Map<Path, Set<Integer>> changedLines = new HashMap<>(); try (Git git = newGit(repo)) { for (Path path : changedFiles) { ChangedLinesComputer computer = new ChangedLinesComputer(); git.diff() .setOutputStream(computer.receiver()) .setOldTree(prepareTreeParser(repo, targetRef)) .setNewTree(prepareNewTree(repo)) .setPathFilter(PathFilter.create(rootBaseDir.relativize(path).toString())) .call() .stream() .filter(diffEntry -> diffEntry.getChangeType() == DiffEntry.ChangeType.ADD || diffEntry.getChangeType() == DiffEntry.ChangeType.MODIFY) .forEach(diffEntry -> changedLines.put(path, computer.changedLines())); } } return changedLines; } catch (IOException | GitAPIException e) { LOG.warn(e.getMessage(), e); } return null; }

Target:
public Map<Path, Set<Integer>> branchChangedLines(String targetBranchName, Path rootBaseDir, Set<Path> changedFiles) { try (Repository repo = buildRepo(rootBaseDir)) { Ref targetRef = resolveTargetRef(targetBranchName, repo); if (targetRef == null) { return null; } Map<Path, Set<Integer>> changedLines = new HashMap<>(); try (Git git = newGit(repo)) { for (Path path : changedFiles) { ChangedLinesComputer computer = new ChangedLinesComputer(); try { List<DiffEntry> diffEntries = git.diff() .setOutputStream(computer.receiver()) .setOldTree(prepareTreeParser(repo, targetRef)) .setPathFilter(PathFilter.create(rootBaseDir.relativize(path).toString())) .call(); diffEntries .stream() .filter(diffEntry -> diffEntry.getChangeType() == DiffEntry.ChangeType.ADD || diffEntry.getChangeType() == DiffEntry.ChangeType.MODIFY) .forEach(diffEntry -> changedLines.put(path, computer.changedLines())); } catch (Exception e) { LOG.warn("Failed to get changed lines from git for file " + path, e); } } } return changedLines; } catch (Exception e) { LOG.warn("Failed to get changed lines from git", e); } return null; }
Source:
public static <T extends AccountingDocument> T buildMockAccountingDocument(Class<T> documentClass) { T document = buildMockDocument(documentClass); Class<? extends SourceAccountingLine> sourceAccountingLineClass = AccountingDocumentClassMappingUtils .getSourceAccountingLineClassByDocumentClass(documentClass); Class<? extends TargetAccountingLine> targetAccountingLineClass = AccountingDocumentClassMappingUtils .getTargetAccountingLineClassByDocumentClass(documentClass); try { PowerMockito.doReturn(sourceAccountingLineClass).when(document, "getSourceAccountingLineClass"); PowerMockito.doReturn(targetAccountingLineClass).when(document, "getTargetAccountingLineClass"); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } return document; }

Target:
public static <T extends AccountingDocument> T buildMockAccountingDocument(Class<T> documentClass) { T document = buildMockDocument(documentClass); Class<? extends SourceAccountingLine> sourceAccountingLineClass = AccountingDocumentClassMappingUtils .getSourceAccountingLineClassByDocumentClass(documentClass); Class<? extends TargetAccountingLine> targetAccountingLineClass = AccountingDocumentClassMappingUtils .getTargetAccountingLineClassByDocumentClass(documentClass); try { PowerMockito.doReturn(sourceAccountingLineClass).when(document, "getSourceAccountingLineClass"); PowerMockito.doReturn(targetAccountingLineClass).when(document, "getTargetAccountingLineClass"); } catch (Exception e) { throw new RuntimeException(e); } return document; }
Source:
protected void update(float delta) { List<Sprite> spriteList = ProjectManager.getInstance().getCurrentProject().getSpriteListWithClones(); sprite.look.setZIndex(spriteList.size()); }

Target:
protected void update(float delta) { List<Sprite> spriteList = ProjectManager.getInstance().getCurrentProject().getSpriteListWithClones(); sprite.look.setZIndex(spriteList.size() + Constants.Z_INDEX_NUMBER_VIRTUAL_LAYERS - 1); }
Source:
public void tick(Level level) { Random random = TurnSynchronizer.synchedRandom; int width = level.width; int height = level.height; for (int i = 0; i < 1; i++) { double x = (random.nextInt(width - 16) + 8) * Tile.WIDTH + Tile.WIDTH / 2; double y = (random.nextInt(height - 16) + 8) * Tile.HEIGHT + Tile.HEIGHT / 2 - 4; final Tile tile = level.getTile((int) (x / Tile.WIDTH), (int) (y / Tile.HEIGHT)); if (tile instanceof FloorTile) { double r = 32 * 8; if (level.getEntities(new BB(null, x - r, y - r, x + r, y + r), Player.class).size() == 0) { r = 32 * 8; if (level.getEntities(new BB(null, x - r, y - r, x + r, y + r), SpawnerEntity.class).size() == 0) { r = 32 * 4; if (level.getEntities( new BB(null, x - r, y - r, x + r, y + r), Turret.class).size() == 0) { level.addEntity(new SpawnerEntity(x, y, Team.Neutral, random.nextInt(3))); } } } } } }

Target:
public void tick(Level level) { Random random = TurnSynchronizer.synchedRandom; int width = level.width; int height = level.height; double x = (random.nextInt(width - 16) + 8) * Tile.WIDTH + Tile.WIDTH / 2; double y = (random.nextInt(height - 16) + 8) * Tile.HEIGHT + Tile.HEIGHT / 2 - 4; final Tile tile = level.getTile((int) (x / Tile.WIDTH), (int) (y / Tile.HEIGHT)); if (tile instanceof FloorTile) { double r = 32 * 8; if (level.getEntities(new BB(null, x - r, y - r, x + r, y + r), Player.class).size() == 0) { r = 32 * 8; if (level.getEntities(new BB(null, x - r, y - r, x + r, y + r), SpawnerEntity.class).size() == 0) { r = 32 * 4; if (level.getEntities( new BB(null, x - r, y - r, x + r, y + r), Turret.class).size() == 0) { level.addEntity(new SpawnerEntity(x, y, Team.Neutral, random.nextInt(3))); } } } } }
Source:
public static final int hashCode(char[][] matrix) { int hash = 0; for (int i = 0; i < matrix.length; i++) { hash ^= hashCode(matrix[i]); } return hash & 0x7FFFFFFF; }

Target:
public static final int hashCode(char[][] matrix) { return Arrays.deepHashCode(matrix) & 0x7FFFFFFF; }
Source:
public static BooleanExpression isAnyFieldSetForSelectedEntry(List<Field> fields, StateManager stateManager) { BibEntry entry = stateManager.getSelectedEntries().get(0); return Bindings.createBooleanBinding( () -> !Collections.disjoint(fields, entry.getFields()), entry.getFieldsObservable(), stateManager.getSelectedEntries()); }

Target:
public static BooleanExpression isAnyFieldSetForSelectedEntry(List<Field> fields, StateManager stateManager) { BibEntry entry = stateManager.getSelectedEntries().get(0); return Bindings.createBooleanBinding( () -> entry.getFields().stream().anyMatch(fields::contains), entry.getFieldsObservable(), stateManager.getSelectedEntries()); }
Source:
private void setUpEditorAccordingToDimensions(ZoomLevel zoomLevel, boolean horizontalScrollbar, boolean verticalScrollBar) { editor.zoom(zoomLevel); SWTBotGefEditPart editPartToMoveForCreatingScroll = editor.getEditPart("CanvasPackageToDrop2", IAbstractDiagramNodeEditPart.class); editor.select(editPartToMoveForCreatingScroll); Point initialLocation = editor.getAbsoluteBounds(editPartToMoveForCreatingScroll).getCenter(); int horizontalShift = 0; int verticalShift = 0; if (horizontalScrollbar) { horizontalShift = 1000; } if (verticalScrollBar) { verticalShift = 1000; } editor.drag(initialLocation, new Point(initialLocation.x + horizontalShift, initialLocation.y + verticalShift)); SWTBotUtils.waitAllUiEvents(); }

Target:
private void setUpEditorAccordingToDimensions(ZoomLevel zoomLevel, boolean horizontalScrollbar, boolean verticalScrollBar) { editor.zoom(zoomLevel); SWTBotGefEditPart editPartToMoveForCreatingScroll = editor.getEditPart("CanvasPackageToDrop2", IAbstractDiagramNodeEditPart.class); editor.select(editPartToMoveForCreatingScroll); Point initialLocation = editor.getBounds(editPartToMoveForCreatingScroll).getCenter(); int horizontalShift = 0; int verticalShift = 0; if (horizontalScrollbar) { horizontalShift = 1000; } if (verticalScrollBar) { verticalShift = 1000; } editor.drag(initialLocation, new Point(initialLocation.x + horizontalShift, initialLocation.y + verticalShift)); }
Source:
public Map<String, List<String>> getRequestHeaderMap() { HttpServletRequest request = RequestContext.getCurrentContext().getRequest(); Map<String,List<String>> headers = new HashMap<String,List<String>>(); Enumeration<String> headerNames = request.getHeaderNames(); if(headerNames != null) { while (headerNames.hasMoreElements()) { String name = headerNames.nextElement(); if (name != null && !name.isEmpty()){ Enumeration values = request.getHeaders(name); if (values == null){ continue; } if (headers.get(name) != null){ while (values.hasMoreElements()){ Object value = values.nextElement(); if (value == null){ continue; } headers.get(name).add(String.valueOf(value)); } }else{ List<String> list = new ArrayList<>(); while (values.hasMoreElements()){ Object value = values.nextElement(); if (value == null){ continue; } list.add(String.valueOf(value)); } headers.put(name, list); } } } } return Collections.unmodifiableMap(headers); }

Target:
public Map<String, List<String>> getRequestHeaderMap() { HttpServletRequest request = RequestContext.getCurrentContext().getRequest(); Map<String,List<String>> headers = new HashMap<String,List<String>>(); Enumeration<String> headerNames = request.getHeaderNames(); if(headerNames != null) { while (headerNames.hasMoreElements()) { String name = headerNames.nextElement(); if (name != null && !name.isEmpty()){ Enumeration values = request.getHeaders(name); if (values != null){ if (headers.get(name) != null){ while (values.hasMoreElements()){ Object value = values.nextElement(); if (value != null){ headers.get(name).add(String.valueOf(value)); } } }else{ List<String> list = new ArrayList<>(); while (values.hasMoreElements()){ Object value = values.nextElement(); if (value != null){ list.add(String.valueOf(value)); } } headers.put(name, list); } } } } } return Collections.unmodifiableMap(headers); }
Source:
private void releaseAndOfferChannel(final Channel channel, final Promise<Void> promise) { this.ensureInEventLoop(); try { this.acquiredChannels.remove(channel); if (this.offerChannel(channel)) { this.poolHandler.channelReleased(channel); promise.setSuccess(null); } else { final IllegalStateException error = new StacklessIllegalStateException(lenientFormat( "cannot offer channel back to pool because the pool is at capacity (%s)\n %s\n %s", this.maxChannels, this, channel)); this.closeChannelAndFail(channel, error, promise); } } catch (Throwable error) { this.closeChannelAndFail(channel, error, promise); } }

Target:
private void releaseAndOfferChannel(final Channel channel, final Promise<Void> promise) { this.ensureInEventLoop(); try { if (this.acquiredChannels.remove(channel) == null) { logger.warn( "Unexpected race condition - releaseChannel called twice for the same channel [{} -> {}]", channel.id(), this.remoteAddress()); promise.setSuccess(null); return; } if (this.offerChannel(channel)) { this.poolHandler.channelReleased(channel); promise.setSuccess(null); } else { final IllegalStateException error = new StacklessIllegalStateException(lenientFormat( "cannot offer channel back to pool because the pool is at capacity (%s)\n %s\n %s", this.maxChannels, this, channel)); this.closeChannelAndFail(channel, error, promise); } } catch (Throwable error) { this.closeChannelAndFail(channel, error, promise); } }
Source:
public void usage() { String username = generateUsername(); String password = "password"; UserContext context = PeergosNetworkUtils.ensureSignedUp(username, password, network, crypto); byte[] signedTime = TimeLimited.signNow(context.signer.secret); long quota = network.spaceUsage.getQuota(context.signer.publicKeyHash, signedTime).join(); long usage = network.spaceUsage.getUsage(context.signer.publicKeyHash).join(); Assert.assertTrue(quota > 0); Assert.assertTrue(usage > 0); }

Target:
public void usage() { String username = generateUsername(); String password = "password"; UserContext context = PeergosNetworkUtils.ensureSignedUp(username, password, network, crypto); byte[] signedTime = TimeLimitedClient.signNow(context.signer.secret); long quota = network.spaceUsage.getQuota(context.signer.publicKeyHash, signedTime).join(); long usage = network.spaceUsage.getUsage(context.signer.publicKeyHash).join(); Assert.assertTrue("non zero quota", quota > 0); Assert.assertTrue("non zero space usage", usage > 0); }
Source:
public synchronized void add(byte[] data, int offset, int count) throws IOException { nonNull(data, "buffer"); if ((offset | count) < 0 || count > data.length - offset) { throw new IndexOutOfBoundsException(); } if (count > maxElementSize) { String message = config.label + ": Adding element that is " + count + " to queue with max" + " element size " + maxElementSize + ". Current queue file size is " + fileLength + "."; if (config.onAddLargeElement == THROW) { throw new IllegalArgumentException(message); } else if (config.onAddLargeElement == LOG) { config.logger.log(message); } else if (config.onAddLargeElement == IGNORE) { } } expandIfNecessary(count); boolean wasEmpty = isEmpty(); int position = wasEmpty ? HEADER_LENGTH : wrapPosition(last.position + Element.HEADER_LENGTH + last.length); Element newLast = new Element(position, count); writeInt(buffer, 0, count); ringWrite(newLast.position, buffer, 0, Element.HEADER_LENGTH); ringWrite(newLast.position + Element.HEADER_LENGTH, data, offset, count); int firstPosition = wasEmpty ? newLast.position : first.position; writeHeader(fileLength, elementCount + 1, firstPosition, newLast.position); last = newLast; elementCount++; if (wasEmpty) first = last; }

Target:
public synchronized void add(byte[] data, int offset, int count) throws IOException { nonNull(data, "buffer"); if ((offset | count) < 0 || count > data.length - offset) { throw new IndexOutOfBoundsException(); } queueElementObserver.observeElement( new QueueElementObserver.QueueElementObservation( count, maxElementSize, fileLength - HEADER_LENGTH, true, false)); expandIfNecessary(count); boolean wasEmpty = isEmpty(); int position = wasEmpty ? HEADER_LENGTH : wrapPosition(last.position + Element.HEADER_LENGTH + last.length); Element newLast = new Element(position, count); writeInt(buffer, 0, count); ringWrite(newLast.position, buffer, 0, Element.HEADER_LENGTH); ringWrite(newLast.position + Element.HEADER_LENGTH, data, offset, count); int firstPosition = wasEmpty ? newLast.position : first.position; writeHeader(fileLength, elementCount + 1, firstPosition, newLast.position); last = newLast; elementCount++; if (wasEmpty) first = last; }
Source:
@Test public void withRunCommand() { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { assumeDocker(); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj"); p.setDefinition(new CpsFlowDefinition( " semaphore 'wait'\n" + " docker.image('maven:3.3.9-jdk-8').withRun(\"--entrypoint mvn\", \"-version\") {c ->\n" + " sh \"docker logs ${c.id}\"" + "}", true)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait/1", b); } }); story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SemaphoreStep.success("wait/1", null); WorkflowJob p = story.j.jenkins.getItemByFullName("prj", WorkflowJob.class); WorkflowRun b = p.getLastBuild(); story.j.assertLogContains("Maven home: /usr/share/maven", story.j.assertBuildStatusSuccess(story.j.waitForCompletion(b))); story.j.assertLogContains("Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre", b); DockerClient client = new DockerClient(new Launcher.LocalLauncher(StreamTaskListener.NULL), null, null); String httpdIID = client.inspect(new EnvVars(), "maven:3.3.9-jdk-8", ".Id"); Fingerprint f = DockerFingerprints.of(httpdIID); assertNotNull(f); DockerRunFingerprintFacet facet = f.getFacet(DockerRunFingerprintFacet.class); assertNotNull(facet); assertEquals(1, facet.records.size()); assertNotNull(facet.records.get(0).getContainerName()); assertEquals(Fingerprint.RangeSet.fromString("1", false), facet.getRangeSet(p)); assertEquals(Collections.singleton("maven"), DockerImageExtractor.getDockerImagesUsedByJobFromAll(p)); } }); }

Target:
@Test public void withRunCommand() { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { assumeDocker(); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj"); p.setDefinition(new CpsFlowDefinition( " docker.image('maven:3.3.9-jdk-8').withRun(\"--entrypoint mvn\", \"-version\") {c ->\n" + " sh \"docker logs ${c.id}\"" + "}", true)); story.j.assertBuildStatusSuccess(p.scheduleBuild2(0)); DockerClient client = new DockerClient(new Launcher.LocalLauncher(StreamTaskListener.NULL), null, null); String mavenIID = client.inspect(new EnvVars(), "maven:3.3.9-jdk-8", ".Id"); Fingerprint f = DockerFingerprints.of(mavenIID); assertNotNull(f); DockerRunFingerprintFacet facet = f.getFacet(DockerRunFingerprintFacet.class); assertNotNull(facet); } }); }
Source:
public String ensureIndexed(List<FieldSort> fieldNames) throws QueryException { List<Index> indexes = this.listIndexes(); Collections.sort(fieldNames); for(Index index: indexes){ Collections.sort(index.fieldNames); if (fieldNames.equals(filterMeta(index.fieldNames))){ return index.indexName; } } return this.ensureIndexed(fieldNames, null); }

Target:
public String ensureIndexed(List<FieldSort> fieldNames) throws QueryException { return this.ensureIndexed(fieldNames, null); }
Source:
private boolean isRemoveLeaseNeeded(Guid srcLeaseDomainId, Guid dstLeaseDomainId) { if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return (srcLeaseDomainId != null && dstLeaseDomainId != null && !srcLeaseDomainId.equals(dstLeaseDomainId)) || (srcLeaseDomainId == null && dstLeaseDomainId != null); } else if (getParameters().getSnapshotAction() == SnapshotActionEnum.COMMIT) { return (srcLeaseDomainId != null && dstLeaseDomainId != null && !srcLeaseDomainId.equals(dstLeaseDomainId)) || (srcLeaseDomainId != null && dstLeaseDomainId == null); } return false; }

Target:
private boolean isRemoveLeaseNeeded(Guid srcLeaseDomainId, Guid dstLeaseDomainId) { if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return isLeaseStorageDomainsEquals(srcLeaseDomainId, dstLeaseDomainId) || (srcLeaseDomainId == null && dstLeaseDomainId != null); } else if (getParameters().getSnapshotAction() == SnapshotActionEnum.COMMIT) { return isLeaseStorageDomainsEquals(srcLeaseDomainId, dstLeaseDomainId) || (srcLeaseDomainId != null && dstLeaseDomainId == null); } return false; }
Source:
public void onReceive(Context context, Intent intent) { boolean interceptedIntent = false; if("com.google.android.c2dm.intent.RECEIVE".equals(intent.getAction())) { Bundle extras = intent.getExtras(); if (extras != null) { Object rawId = extras.get("_p"); String msgId = (rawId != null) ? rawId.toString() : null; if (!SwrveHelper.isNullOrEmpty(msgId)) { interceptedIntent = true; ComponentName comp = new ComponentName(context.getPackageName(), "com.swrve.sdk.gcm.SwrveGcmIntentService"); intent = intent.setComponent(comp); context.startService(intent); } } } if (!interceptedIntent) { super.onReceive(context, intent); } }

Target:
public void onReceive(Context context, Intent intent) { boolean interceptedIntent = false; if("com.google.android.c2dm.intent.RECEIVE".equals(intent.getAction())) { Bundle extras = intent.getExtras(); if (extras != null) { Object rawId = extras.get(SwrveGcmConstants.SWRVE_TRACKING_KEY); String msgId = (rawId != null) ? rawId.toString() : null; if (!SwrveHelper.isNullOrEmpty(msgId)) { SwrveLogger.d("Received Swrve push, starting " + SwrveGcmConstants.SWRVE_DEFAULT_INTENT_SERVICE + " instead"); interceptedIntent = true; ComponentName comp = new ComponentName(context.getPackageName(), SwrveGcmConstants.SWRVE_DEFAULT_INTENT_SERVICE); intent = intent.setComponent(comp); context.startService(intent); } } } if (!interceptedIntent) { super.onReceive(context, intent); } }
Source:
public String getHashString(RowMap r, List<String> partitionColumns, String partitionKeyFallback) { String t = r.getTable(); if ( t == null && partitionKeyFallback.equals("database") ) return r.getDatabase(); else return r.getTable(); }

Target:
public String getHashString(RowMap r, List<String> partitionColumns, String partitionKeyFallback) { String t = r.getTable(); if ( t == null && "database".equals(partitionKeyFallback) ) return r.getDatabase(); else return t; }
Source:
public boolean shouldVdsBeFenced() { boolean result = false; switch (vds.getStatus()) { case Down: case InstallFailed: case Maintenance: case NonOperational: case NonResponsive: result = true; break; default: break; } return result; }

Target:
public boolean shouldVdsBeFenced() { boolean result = false; if (vds == null) { return false; } switch (vds.getStatus()) { case Down: case InstallFailed: case Maintenance: case NonOperational: case NonResponsive: result = true; break; default: break; } return result; }
Source:
private String getAttribute(PlexusConfiguration dom, String attrName) throws PlexusConfigurationException { String attr = dom.getAttribute(attrName); if (attr == null) { return null; } attr = attr.trim(); if (attr.length() == 0) { return null; } return attr; }

Target:
private String getAttribute(PlexusConfiguration dom, String attrName) { String attr = dom.getAttribute(attrName); if (attr == null) { return null; } attr = attr.trim(); if (attr.length() == 0) { return null; } return attr; }
Source:
public String getCategoryID() { return "org.eclipse.papyrus.sysml14.diagram.parametric.dnd.ParameterDropStrategy"; }

Target:
public String getCategoryID() { return "org.eclipse.papyrus.sysml14.diagram.parametric"; }
Source:
private String format(String message) { SocketAddress local = context.channel().localAddress(); SocketAddress remote = context.channel().remoteAddress(); String localhost ; if (local != null && local instanceof InetSocketAddress) { InetSocketAddress inetlocal = (InetSocketAddress)local; localhost = inetlocal.getAddress().getHostAddress() + ":" + inetlocal.getPort(); } else { localhost = "undefined"; } String remotehost; if (remote != null && remote instanceof InetSocketAddress) { InetSocketAddress inetremote = (InetSocketAddress)local; remotehost = inetremote.getAddress().getHostAddress() + ":" + inetremote.getPort(); } else { remotehost = "undefined"; } return "[local: " + localhost + ", remote: " + remotehost + "] " + message; }

Target:
private String format(String message) { SocketAddress local = context.channel().localAddress(); SocketAddress remote = context.channel().remoteAddress(); String localhost = addressToString(local); String remotehost = addressToString(remote); return "[local: " + localhost + ", remote: " + remotehost + "] " + message; }
Source:
public void testHttpUriVariables() { Message<?> message = MessageBuilder.withPayload("<spring/>") .setHeader("x", "integration") .setHeader("param", "test1 & test2") .build(); try { this.inputHttp.send(message); } catch (MessageHandlingException e) { Class<?> causeType = e.getCause().getClass(); assertTrue(WebServiceIOException.class.equals(causeType) || SoapMessageCreationException.class.equals(causeType)); } assertEquals("<LINK_0>", this.interceptor.getLastUri().toString()); }

Target:
public void testHttpUriVariables() { Message<?> message = MessageBuilder.withPayload("<spring/>") .setHeader("x", "integration") .setHeader("param", "test1 & test2") .build(); try { this.inputHttp.send(message); } catch (MessageHandlingException e) { Class<?> causeType = e.getCause().getClass(); assertTrue(WebServiceIOException.class.equals(causeType) || SoapMessageCreationException.class.equals(causeType)); } assertEquals("<LINK_1>", this.interceptor.getLastUri().toString()); }
Source:
private boolean processWebSocket(final Exchange camelExchange, final AsyncCallback camelCallback) { final Message in = camelExchange.getIn(); try { Object message = in.getBody(); if (!(message instanceof String || message instanceof byte[] || message instanceof Reader || message instanceof InputStream)) { message = in.getBody(String.class); } if (message != null) { final int timeout = endpoint.getSendTimeout(); if (isSendToAll(in)) { return webSocketHandler.send(peer -> true, message, timeout, camelExchange, camelCallback); } final List<String> connectionKeys = in.getHeader(UndertowConstants.CONNECTION_KEY_LIST, List.class); if (connectionKeys != null) { return webSocketHandler.send( peer -> connectionKeys.contains(peer.getAttribute(UndertowConstants.CONNECTION_KEY)), message, timeout, camelExchange, camelCallback); } final String connectionKey = in.getHeader(UndertowConstants.CONNECTION_KEY, String.class); if (connectionKey != null) { return webSocketHandler.send( peer -> connectionKey.equals(peer.getAttribute(UndertowConstants.CONNECTION_KEY)), message, timeout, camelExchange, camelCallback); } throw new IllegalStateException( String.format("Cannot process message which has none of the headers %s, %s or %s set: %s", UndertowConstants.SEND_TO_ALL, UndertowConstants.CONNECTION_KEY_LIST, UndertowConstants.CONNECTION_KEY, in)); } else { camelCallback.done(true); return true; } } catch (IOException e) { camelExchange.setException(e); camelCallback.done(true); return true; } }

Target:
private boolean processWebSocket(final Exchange camelExchange, final AsyncCallback camelCallback) { final Message in = camelExchange.getIn(); try { Object message = in.getBody(); if (!(message instanceof String || message instanceof byte[] || message instanceof Reader || message instanceof InputStream)) { message = in.getBody(String.class); } if (message != null) { final int timeout = endpoint.getSendTimeout(); if (isSendToAll(in)) { return webSocketHandler.send(peer -> true, message, timeout, camelExchange, camelCallback); } final List<String> connectionKeys = in.getHeader(UndertowConstants.CONNECTION_KEY_LIST, List.class); if (connectionKeys != null) { return webSocketHandler.send( peer -> connectionKeys.contains(peer.getAttribute(UndertowConstants.CONNECTION_KEY)), message, timeout, camelExchange, camelCallback); } final String connectionKey = in.getHeader(UndertowConstants.CONNECTION_KEY, String.class); if (connectionKey != null) { return webSocketHandler.send( peer -> connectionKey.equals(peer.getAttribute(UndertowConstants.CONNECTION_KEY)), message, timeout, camelExchange, camelCallback); } throw new IllegalStateException( String.format("Cannot process message which has none of the headers %s, %s or %s set: %s", UndertowConstants.SEND_TO_ALL, UndertowConstants.CONNECTION_KEY_LIST, UndertowConstants.CONNECTION_KEY, in)); } else { camelCallback.done(true); return true; } } catch (Exception e) { camelExchange.setException(e); camelCallback.done(true); return true; } }
Source:
private void waitPeriodBeforeRetry() { try { Thread.sleep(waitBetweenDeploymentFailures); } catch (InterruptedException e1) { } }

Target:
private void waitPeriodBeforeRetry() { try { Thread.sleep(waitBetweenDeploymentFailures); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); } }
Source:
private static void writeVersionStatement(XMLStreamWriter xmlw, DatasetVersionDTO datasetVersionDTO) throws XMLStreamException{ xmlw.writeStartElement("verStmt"); writeAttribute(xmlw,"source","producer"); xmlw.writeStartElement("version"); writeAttribute(xmlw,"date", datasetVersionDTO.getReleaseTime().substring(0, 10)); writeAttribute(xmlw,"type", datasetVersionDTO.getVersionState().toString()); xmlw.writeCharacters(datasetVersionDTO.getVersionNumber().toString()); xmlw.writeEndElement(); xmlw.writeEndElement(); }

Target:
private static void writeVersionStatement(XMLStreamWriter xmlw, DatasetVersionDTO datasetVersionDTO) throws XMLStreamException{ xmlw.writeStartElement("verStmt"); writeAttribute(xmlw,"source","archive"); xmlw.writeStartElement("version"); writeAttribute(xmlw,"date", datasetVersionDTO.getReleaseTime().substring(0, 10)); writeAttribute(xmlw,"type", datasetVersionDTO.getVersionState().toString()); xmlw.writeCharacters(datasetVersionDTO.getVersionNumber().toString()); xmlw.writeEndElement(); xmlw.writeEndElement(); }