auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin, ":"); String exchangeType = st.nextToken(); if ("coinmarketcap".equalsIgnoreCase(exchangeType)) { String preferredFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferredFiatCurrency = st.nextToken().toUpperCase(); } return new CoinexchangeRateSource(preferredFiatCurrency); }else if ("zcoinfix".equalsIgnoreCase(exchangeType)) { BigDecimal rate = BigDecimal.ZERO; if (st.hasMoreTokens()) { try { rate = new BigDecimal(st.nextToken()); }catch (Throwable e) { } } String preferredFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferredFiatCurrency = st.nextToken().toUpperCase(); } return new FixPriceRateSource(rate, preferredFiatCurrency); } } return null; }

Target:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin, ":"); String exchangeType = st.nextToken(); if ("coinmarketcap".equalsIgnoreCase(exchangeType)) { String preferredFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferredFiatCurrency = st.nextToken().toUpperCase(); } return new CoinmarketcapRateSource(preferredFiatCurrency); }else if ("zcoinfix".equalsIgnoreCase(exchangeType)) { BigDecimal rate = BigDecimal.ZERO; if (st.hasMoreTokens()) { try { rate = new BigDecimal(st.nextToken()); }catch (Throwable e) { } } String preferredFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferredFiatCurrency = st.nextToken().toUpperCase(); } return new FixPriceRateSource(rate, preferredFiatCurrency); } } return null; }
Source:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { if (buf.readableBytes() < FRAME_MIN_SIZE) { return null; } int indexStart = buf.indexOf(buf.readerIndex(), buf.writerIndex(), FRAME_START_SYMBOL); if (indexStart == -1) { buf.clear(); return null; } indexStart++; int index, cnt; for (index = indexStart, cnt = 0;; index++) { int i = index; index = buf.indexOf(index, buf.writerIndex(), FRAME_END_SYMBOL); if (index == -1) { break; } for (;; i++, cnt++) { i = buf.indexOf(i, index, FRAME_FREE_TEXT_BLOCK_SYMBOL); if (i == -1 || i >= index) { break; } } if (cnt % 2 == 0) { break; } } if (index == -1) { while (buf.readableBytes() > FRAME_MAX_SIZE) { int i = buf.indexOf(buf.readerIndex() + 1, buf.writerIndex(), FRAME_START_SYMBOL); if (i == -1) { buf.clear(); } else { buf.readerIndex(i); } } return null; } buf.readerIndex(indexStart); ChannelBuffer result = buf.readBytes(index - indexStart); buf.readerIndex(buf.readerIndex() + 1); return result; }

Target:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { if (buf.readableBytes() < 2) { return null; } int frameStartIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) '('); if (frameStartIndex == -1) { buf.clear(); return null; } int frameEndIndex, freeTextSymbolCounter; for (frameEndIndex = frameStartIndex, freeTextSymbolCounter = 0;; frameEndIndex++) { int freeTextIndex = frameEndIndex; frameEndIndex = buf.indexOf(frameEndIndex, buf.writerIndex(), (byte) ')'); if (frameEndIndex == -1) { break; } for (;; freeTextIndex++, freeTextSymbolCounter++) { freeTextIndex = buf.indexOf(freeTextIndex, frameEndIndex, (byte) '$'); if (freeTextIndex == -1 || freeTextIndex >= frameEndIndex) { break; } } if (freeTextSymbolCounter % 2 == 0) { break; } } if (frameEndIndex == -1) { while (buf.readableBytes() > 1024) { int discardUntilIndex = buf.indexOf(buf.readerIndex() + 1, buf.writerIndex(), (byte) '('); if (discardUntilIndex == -1) { buf.clear(); } else { buf.readerIndex(discardUntilIndex); } } return null; } buf.readerIndex(frameStartIndex); ChannelBuffer result = buf.readBytes(frameEndIndex + 1 - frameStartIndex); return result; }
Source:
public void correctlyMapsPathString() throws Exception { final Take take = new Take() { @Override public Response act(final Request req) throws IOException { return new RsText(new RqHref.Base(req).href().toString()); } }; for (final String method:TkProxyTest.METHODS) { new FtRemote(take).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { MatcherAssert.assertThat( new RsPrint( new TkProxy(home).act( new RqFake(method, "/a/b/c") ) ).printBody(), Matchers.equalTo( String.format( "http://%s:%d/a/b/c", home.getHost(), home.getPort() ) ) ); } } ); } }

Target:
public void correctlyMapsPathString() throws Exception { final Take take = new Take() { @Override public Response act(final Request req) throws IOException { return new RsText(new RqHref.Base(req).href().toString()); } }; new FtRemote(take).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { MatcherAssert.assertThat( new RsPrint( new TkProxy(home).act(new RqFake("GET", "/a/b/c")) ).printBody(), Matchers.equalTo( String.format( "http://%s:%d/a/b/c", home.getHost(), home.getPort() ) ) ); } } ); }
Source:
public List<SqlNode> getOperandList() { return Collections.unmodifiableList(Arrays.asList(operands)); }

Target:
public List<SqlNode> getOperandList() { return Util.unmodifiableList(operands); }
Source:
public String getDistribute() { return String.valueOf("true".equals(distribute)); }

Target:
public String getDistribute() { return Boolean.toString(Boolean.parseBoolean(distribute)); }
Source:
public void testRemoveNonExistant() throws Exception { setUpEntityQueryExpectations(VdcQueryType.GetMacPoolById, IdQueryParameters.class, new String[] { "Id" }, new Object[] { NON_EXISTANT_GUID }, null); control.replay(); try { resource.guid = NON_EXISTANT_GUID; resource.remove(); fail("expected WebApplicationException"); } catch (WebApplicationException wae) { assertNotNull(wae.getResponse()); assertEquals(404, wae.getResponse().getStatus()); } }

Target:
public void testRemoveNonExistant() throws Exception { setUpEntityQueryExpectations(VdcQueryType.GetMacPoolById, IdQueryParameters.class, new String[] { "Id" }, new Object[] { MAC_POOL_ID }, null); control.replay(); try { resource.remove(); fail("expected WebApplicationException"); } catch (WebApplicationException wae) { assertNotNull(wae.getResponse()); assertEquals(404, wae.getResponse().getStatus()); } }
Source:
public WmdPassageScorer(String index, Integer k) throws IOException { this.wmdDictionary = new WordEmbeddingDictionary(index); wmdDictionary.getEmbeddingVector("newton"); this.topPassages = k; scoredPassageHeap = MinMaxPriorityQueue.maximumSize(topPassages).create(); stopWords = new ArrayList<>(); InputStream is = getClass().getResourceAsStream("/io/anserini/qa/english-stoplist.txt"); BufferedReader bRdr = new BufferedReader(new InputStreamReader(is)); String line; while ((line = bRdr.readLine()) != null) { if (!line.contains("#")) { stopWords.add(line); } } }

Target:
public WmdPassageScorer(String index, Integer k) throws IOException { this.wmdDictionary = new WordEmbeddingDictionary(index); this.topPassages = k; scoredPassageHeap = MinMaxPriorityQueue.maximumSize(topPassages).create(); stopWords = new ArrayList<>(); InputStream is = getClass().getResourceAsStream("/io/anserini/qa/english-stoplist.txt"); BufferedReader bRdr = new BufferedReader(new InputStreamReader(is)); String line; while ((line = bRdr.readLine()) != null) { if (!line.startsWith("#")) { stopWords.add(line); } } }
Source:
public void run() { try { int requestCount = 0; while (requestCount < numberOfRequests) { int size = new Random().nextInt(5000); BlobProperties properties = new BlobProperties(size, "service1", "owner id check", "image/jpeg", false); byte[] metadata = new byte[new Random().nextInt(1000)]; byte[] blob = new byte[size]; new Random().nextBytes(metadata); new Random().nextBytes(blob); try { String blobId = coordinator.putBlob(properties, ByteBuffer.wrap(metadata), new ByteArrayInputStream(blob)); blockingQueue.put(new Payload(properties, metadata, blob, blobId)); requestCount++; } catch (CoordinatorException e) { if (e.getErrorCode() != CoordinatorError.UnexpectedInternalError) { throw e; } else { System.err.println("Ignoring unexpected putBlob exception to avoid hanging test."); e.printStackTrace(); } } } } catch (Exception e) { e.printStackTrace(); } finally { completedLatch.countDown(); } }

Target:
public void run() { try { for (int i = 0; i < numberOfRequests; i++) { int size = new Random().nextInt(5000); BlobProperties properties = new BlobProperties(size, "service1", "owner id check", "image/jpeg", false); byte[] metadata = new byte[new Random().nextInt(1000)]; byte[] blob = new byte[size]; new Random().nextBytes(metadata); new Random().nextBytes(blob); String blobId = coordinator.putBlob(properties, ByteBuffer.wrap(metadata), new ByteArrayInputStream(blob)); blockingQueue.put(new Payload(properties, metadata, blob, blobId)); } } catch (Exception e) { e.printStackTrace(); } finally { completedLatch.countDown(); } }
Source:
public static String getMessageFromValue(final int value) { switch (value) { case INVALID_DATE: return "Can only access during valid times: "; case INVALID_PERMISSION: return "Can only perform task with valid permission: "; case NO_AUTH_SENT: return "No Authentication Information was received: "; case INSUFFICIENT_HASH: return "A problem occurred so a hash of sufficient strength could not be created: "; default: return null; } }

Target:
public static String getMessageFromValue(final int value) { switch (value) { case INVALID_DATE: return "Can only access during valid times: "; case INVALID_PERMISSION: return "Can only perform task with valid permission: "; case NO_AUTH_SENT: return "No Authentication Information was received: "; case INSUFFICIENT_HASH: return "A problem occurred and a hash of sufficient strength could not be created: "; default: return null; } }
Source:
public void base64EncodedPasswordAfterAlgorithmShouldWork() { UserDetails ldapUser = ldapUserDetailsService.loadUserByUsername("base64encoded-issue-1840"); assertThat(ldapUser).isInstanceOf(LdapUserDetailsImpl.class); LdapUserDetails ldapUserDetails = (LdapUserDetailsImpl) ldapUser; assertThat(ldapUserDetails.getDn()).isEqualTo("uid=base64encoded-issue-1840,ou=Users,dc=carlspring,dc=com"); assertThat(ldapUserDetails.getUsername()).isEqualTo("base64encoded-issue-1840"); assertThat(ldapUserDetails.getPassword()).isEqualTo("{MD5}5f4dcc3b5aa765d61d8327deb882cf99"); assertThat(passwordEncoder.matches("password", ldapUserDetails.getPassword())).isEqualTo(true); assertThat(((List<SimpleGrantedAuthority>) ldapUser.getAuthorities())) .contains( new SimpleGrantedAuthority(SystemRole.REPOSITORY_MANAGER.name()), new SimpleGrantedAuthority("USER_ROLE") ); }

Target:
public void base64EncodedPasswordAfterAlgorithmShouldWork() { UserDetails ldapUser = ldapUserDetailsService.loadUserByUsername("issue1840-type-1"); assertThat(ldapUser).isInstanceOf(LdapUserDetailsImpl.class); LdapUserDetails ldapUserDetails = (LdapUserDetailsImpl) ldapUser; assertThat(ldapUserDetails.getDn()).isEqualTo("uid=issue1840-type-1,ou=Users,dc=carlspring,dc=com"); assertThat(ldapUserDetails.getUsername()).isEqualTo("issue1840-type-1"); assertThat(ldapUserDetails.getPassword()).isEqualTo("{MD5}5f4dcc3b5aa765d61d8327deb882cf99"); assertThat(passwordEncoder.matches("password", ldapUserDetails.getPassword())).isEqualTo(true); assertThat(((List<SimpleGrantedAuthority>) ldapUser.getAuthorities())) .contains(new SimpleGrantedAuthority(SystemRole.REPOSITORY_MANAGER.name()), new SimpleGrantedAuthority("USER_ROLE")); }
Source:
public void aggregate(StructuredRecord groupKey, Iterator<StructuredRecord> iterator, Emitter<StructuredRecord> emitter) throws Exception { if (!iterator.hasNext()) { return; } SelectionFunction selectionFunction; if (filterFunction == null) { emitter.emit(iterator.next()); } else { StructuredRecord firstRecord = iterator.next(); Schema.Field firstField = firstRecord.getSchema().getField(filterFunction.getField()); selectionFunction = filterFunction.getSelectionFunction(firstField.getSchema()); selectionFunction.beginFunction(); selectionFunction.operateOn(firstRecord); while (iterator.hasNext()) { selectionFunction.operateOn(iterator.next()); } selectionFunction.finishFunction(); List<StructuredRecord> outputRecords = selectionFunction.getSelectedRecords(); for (StructuredRecord outputRecord : outputRecords) { Schema outputSchema = getOutputSchema(outputRecord.getSchema()); validateSchema(outputSchema, uniqueFields, filterFunction); StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); for (Schema.Field field : outputRecord.getSchema().getFields()) { builder.set(field.getName(), outputRecord.get(field.getName())); } emitter.emit(builder.build()); } } }

Target:
public void aggregate(StructuredRecord groupKey, Iterator<StructuredRecord> iterator, Emitter<StructuredRecord> emitter) throws Exception { if (!iterator.hasNext()) { return; } SelectionFunction selectionFunction; if (filterFunction == null) { emitter.emit(iterator.next()); } else { StructuredRecord firstRecord = iterator.next(); Schema.Field firstField = firstRecord.getSchema().getField(filterFunction.getField()); selectionFunction = filterFunction.getSelectionFunction(firstField.getSchema()); selectionFunction.beginFunction(); selectionFunction.operateOn(firstRecord); while (iterator.hasNext()) { selectionFunction.operateOn(iterator.next()); } List<StructuredRecord> outputRecords = selectionFunction.getSelectedRecords(); for (StructuredRecord outputRecord : outputRecords) { Schema outputSchema = getOutputSchema(outputRecord.getSchema()); StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); for (Schema.Field field : outputRecord.getSchema().getFields()) { builder.set(field.getName(), outputRecord.get(field.getName())); } emitter.emit(builder.build()); } } }
Source:
public void add(Storable storable) throws StorageException { Preconditions.checkNotNull(storable, "Storable argument can not be null"); final Storable existing = get(storable.getStorableKey()); if (existing == null) { try { atlasMetadataService.createEntity(referenceOf(storable)); } catch (EntityExistsException e) { LOG.error("Another instance exists with the same primary key [{}]", storable.getPrimaryKey(), e); throw new AlreadyExistsException("Another instance exists with the same primary key: " + storable.getPrimaryKey()); } catch (Exception e) { throw new StorageException(e); } } else if (existing.equals(storable)) { return; } else { throw new AlreadyExistsException("Another instance with same id = " + storable.getPrimaryKey() + " exists with different value in namespace " + storable.getNameSpace() + " Consider using addOrUpdate method if you always want to overwrite."); } }

Target:
public void add(Storable storable) throws StorageException { Preconditions.checkNotNull(storable, "Storable argument can not be null"); final Storable existing = get(storable.getStorableKey()); if (existing == null) { try { atlasMetadataService.createEntity(referenceOf(storable)); } catch (EntityExistsException e) { LOG.error("Another instance exists with the same primary key [{}]", storable.getPrimaryKey(), e); throw new AlreadyExistsException("Another instance exists with the same primary key: " + storable.getPrimaryKey()); } catch (Exception e) { throw new StorageException(e); } } else if (!existing.equals(storable)) { throw new AlreadyExistsException("Another instance with same id = " + storable.getPrimaryKey() + " exists with different value in namespace " + storable.getNameSpace() + " Consider using addOrUpdate method if you always want to overwrite."); } }
Source:
public static IStatus setTraceType(IResource resource, TraceTypeHelper traceType) throws CoreException { String traceBundle = null, traceTypeId = traceType.getCanonicalName(), traceIcon = null; if (isCustomTraceId(traceTypeId)) { traceBundle = Activator.getDefault().getBundle().getSymbolicName(); traceIcon = DEFAULT_TRACE_ICON_PATH; } else { IConfigurationElement ce = TmfTraceType.getInstance().getTraceAttributes(traceTypeId); traceBundle = ce.getContributor().getName(); traceIcon = ce.getAttribute(TmfTraceType.ICON_ATTR); } resource.setPersistentProperty(TmfCommonConstants.TRACEBUNDLE, traceBundle); resource.setPersistentProperty(TmfCommonConstants.TRACETYPE, traceTypeId); resource.setPersistentProperty(TmfCommonConstants.TRACEICON, traceIcon); TmfProjectElement tmfProject = TmfProjectRegistry.getProject(resource.getProject(), true); if (resource.getParent().equals(tmfProject.getTracesFolder().getResource())) { for (TmfTraceElement traceElement : tmfProject.getTracesFolder().getTraces()) { if (traceElement.getName().equals(resource.getName())) { traceElement.refreshTraceType(); break; } } } else { for (TmfExperimentElement experimentElement : tmfProject.getExperimentsFolder().getExperiments()) { if (resource.getParent().equals(experimentElement.getResource())) { for (TmfTraceElement traceElement : experimentElement.getTraces()) { if (traceElement.getName().equals(resource.getName())) { traceElement.refreshTraceType(); break; } } break; } } } tmfProject.refresh(); return Status.OK_STATUS; }

Target:
public static IStatus setTraceType(IResource resource, TraceTypeHelper traceType) throws CoreException { String traceBundle = null, traceTypeId = traceType.getCanonicalName(), traceIcon = null; if (isCustomTraceId(traceTypeId)) { traceBundle = Activator.getDefault().getBundle().getSymbolicName(); traceIcon = DEFAULT_TRACE_ICON_PATH; } else { IConfigurationElement ce = TmfTraceType.getInstance().getTraceAttributes(traceTypeId); traceBundle = ce.getContributor().getName(); traceIcon = ce.getAttribute(TmfTraceType.ICON_ATTR); } resource.setPersistentProperty(TmfCommonConstants.TRACEBUNDLE, traceBundle); resource.setPersistentProperty(TmfCommonConstants.TRACETYPE, traceTypeId); resource.setPersistentProperty(TmfCommonConstants.TRACEICON, traceIcon); TmfProjectElement tmfProject = TmfProjectRegistry.getProject(resource.getProject(), true); if (resource.getParent().equals(tmfProject.getTracesFolder().getResource())) { refreshTraceElement(tmfProject.getTracesFolder().getTraces(), resource.getName()); } else { for (TmfExperimentElement experimentElement : tmfProject.getExperimentsFolder().getExperiments()) { if (resource.getParent().equals(experimentElement.getResource())) { refreshTraceElement(experimentElement.getTraces(), resource.getName()); break; } } } tmfProject.refresh(); return Status.OK_STATUS; }
Source:
public void testMoveNodeConnectWithAnotherNode() { aDiagram.addNode(aClassNode, new Point2D.Double(5, 5)); aDiagram.addNode(aInterfaceNode, new Point2D.Double(44, 44)); aDiagram.addNode(aPackageNode, new Point2D.Double(87, 87)); aDiagram.addEdge(aAggregationEdge, new Point2D.Double(8, 10), new Point2D.Double(45, 48)); aDiagram.addEdge(aAssociationEdge, new Point2D.Double(47, 49), new Point2D.Double(9, 17)); aDiagram.addEdge(aDependencyEdge, new Point2D.Double(90, 93), new Point2D.Double(44, 49)); Rectangle2D edge1Bond = aAggregationEdge.getBounds(); Rectangle2D edge3Bond = aDependencyEdge.getBounds(); Rectangle2D packageNodeBonds = aPackageNode.getBounds(); Rectangle2D interFaceNodeBonds = aInterfaceNode.getBounds(); aClassNode.translate(20, 20); assertEquals(aClassNode, aAggregationEdge.getStart()); assertEquals(aInterfaceNode, aAggregationEdge.getEnd()); assertFalse(edge1Bond == aAggregationEdge.getBounds()); assertEquals(interFaceNodeBonds, aInterfaceNode.getBounds()); aInterfaceNode.translate(-19, 45); assertEquals(aPackageNode, aDependencyEdge.getStart()); assertEquals(aInterfaceNode, aDependencyEdge.getEnd()); assertFalse(edge3Bond == aDependencyEdge.getBounds()); assertEquals(packageNodeBonds, aPackageNode.getBounds()); }

Target:
public void testMoveNodeConnectWithAnotherNode() { aDiagram.addNode(aClassNode, new Point2D.Double(5, 5)); aDiagram.addNode(aInterfaceNode, new Point2D.Double(44, 44)); aDiagram.addNode(aPackageNode, new Point2D.Double(87, 87)); aDiagram.addEdge(aAggregationEdge, new Point2D.Double(8, 10), new Point2D.Double(45, 48)); aDiagram.addEdge(aAssociationEdge, new Point2D.Double(47, 49), new Point2D.Double(9, 17)); aDiagram.addEdge(aDependencyEdge, new Point2D.Double(90, 93), new Point2D.Double(44, 49)); Rectangle2D edge1Bounds = aAggregationEdge.getBounds(); Rectangle2D edge3Bounds = aDependencyEdge.getBounds(); Rectangle2D packageNodeBounds = aPackageNode.getBounds(); Rectangle2D interFaceNodeBounds = aInterfaceNode.getBounds(); aClassNode.translate(20, 20); assertEquals(aClassNode, aAggregationEdge.getStart()); assertEquals(aInterfaceNode, aAggregationEdge.getEnd()); assertFalse(edge1Bounds == aAggregationEdge.getBounds()); assertEquals(interFaceNodeBounds, aInterfaceNode.getBounds()); aInterfaceNode.translate(-19, 45); assertEquals(aPackageNode, aDependencyEdge.getStart()); assertEquals(aInterfaceNode, aDependencyEdge.getEnd()); assertFalse(edge3Bounds == aDependencyEdge.getBounds()); assertEquals(packageNodeBounds, aPackageNode.getBounds()); }
Source:
public boolean handle(TreeNode treeNode) { EObject data = treeNode.getData(); boolean handles = data instanceof Match && data.eContainer() instanceof Comparison; return handles; }

Target:
public boolean handle(TreeNode treeNode) { EObject data = treeNode.getData(); return data instanceof Match && data.eContainer() instanceof Comparison; }
Source:
public void field_inNestedObject() { Assume.assumeTrue( "Projections on fields within nested object fields are not supported yet", false ); StubMappingSearchTarget searchTarget = indexManager.createSearchTarget(); for ( FieldModel<?> fieldModel : indexMapping.nestedObject.supportedFieldModels ) { SubTest.expectSuccess( fieldModel, model -> { String fieldPath = indexMapping.nestedObject.relativeFieldName + "." + model.relativeFieldName; assertThat( searchTarget.query() .asProjections( searchTarget.projection().field( fieldPath, model.type ).toProjection() ) .predicate( f -> f.matchAll().toPredicate() ) .build() ).hasHitsAnyOrder( model.document1Value.indexedValue, model.document2Value.indexedValue, model.document3Value.indexedValue, null ); } ); } }

Target:
public void field_inNestedObject() { Assume.assumeTrue( "Projections on fields within nested object fields are not supported yet", false ); StubMappingSearchTarget searchTarget = indexManager.createSearchTarget(); for ( FieldModel<?> fieldModel : indexMapping.nestedObject.supportedFieldModels ) { SubTest.expectSuccess( fieldModel, model -> { String fieldPath = indexMapping.nestedObject.relativeFieldName + "." + model.relativeFieldName; assertThat( searchTarget.query() .asProjection( searchTarget.projection().field( fieldPath, model.type ).toProjection() ) .predicate( f -> f.matchAll().toPredicate() ) .build() ).hasHitsAnyOrder( model.document1Value.indexedValue, model.document2Value.indexedValue, model.document3Value.indexedValue, null ); } ); } }
Source:
private static void tryCleanupTempFiles(Path masterLogFile) { try { for (Path file : MoreFiles.listFiles(masterLogFile.getParent())) { String fileName = file.getFileName().toString(); String fileNameWithoutPrefix; if (fileName.startsWith(TEMP_PREFIX)) { fileNameWithoutPrefix = fileName.substring(TEMP_PREFIX.length()); } else if (fileName.startsWith(DELETED_PREFIX)) { fileNameWithoutPrefix = fileName.substring(DELETED_PREFIX.length()); } else { continue; } if (LogFileName.forName(masterLogFile.getFileName().toString(), fileNameWithoutPrefix).isPresent()) { try { Files.deleteIfExists(file); } catch (IOException ignored) { } } } } catch (IOException ignored) { } }

Target:
private static void tryCleanupTempFiles(Path masterLogFile) { try { for (Path file : MoreFiles.listFiles(masterLogFile.getParent())) { String fileName = file.getFileName().toString(); String fileNameWithoutPrefix; if (fileName.startsWith(TEMP_PREFIX)) { fileNameWithoutPrefix = fileName.substring(TEMP_PREFIX.length()); } else if (fileName.startsWith(DELETED_PREFIX)) { fileNameWithoutPrefix = fileName.substring(DELETED_PREFIX.length()); } else { continue; } if (LogFileName.parseHistoryLogFileName(masterLogFile.getFileName().toString(), fileNameWithoutPrefix).isPresent()) { try { Files.deleteIfExists(file); } catch (IOException ignored) { } } } } catch (IOException ignored) { } }
Source:
protected ProcessStatusStore buildStore() { Properties props = new Properties(); String home = System.getenv("HOME"); File f = new File(home, ".geotools/postgis.properties"); FileInputStream is = null; try { is = new FileInputStream(f); props.load(is); } catch (FileNotFoundException e1) { e1.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (is != null) is.close(); } catch (IOException e) { e.printStackTrace(); } } Map<Object, Object> params = props; params.put(PostgisNGDataStoreFactory.ENCODE_FUNCTIONS.key, true); try { datastore = DataStoreFinder.getDataStore(params); } catch (IOException e) { e.printStackTrace(); } statusStore = new JDBCStatusStore(datastore); return statusStore; }

Target:
protected ProcessStatusStore buildStore() { Properties props = GSFixtureUtilitiesDelegate.loadFixture(fixtureID); Map<String, Serializable> params = new HashMap<>(); for(Entry<Object, Object> entry:props.entrySet()) { params.put((String)entry.getKey(), (Serializable)entry.getValue()); } params.put(PostgisNGDataStoreFactory.ENCODE_FUNCTIONS.key, true); try { datastore = DataStoreFinder.getDataStore(params); } catch (IOException e) { e.printStackTrace(); } if(datastore == null) { throw new RuntimeException("failed to create StatusStore with \n"+props); } statusStore = new JDBCStatusStore(datastore); if(statusStore == null) { throw new RuntimeException("failed to create StatusStore with \n"+props); } return statusStore; }
Source:
public Supplier<IntIterator> makeDimensionProcessor(DimensionSelector selector) { return () -> { final IndexedInts row = selector.getRow(); if (row.size() == 1) { int dimensionId = row.get(0); return dimensionCaches.get(selector).get(dimensionId).iterator(); } else { return IntIterators.EMPTY_ITERATOR; } }; }

Target:
public Supplier<IntIterator> makeDimensionProcessor(DimensionSelector selector) { if (selector.getValueCardinality() == DimensionDictionarySelector.CARDINALITY_UNKNOWN) { return () -> { final IndexedInts row = selector.getRow(); if (row.size() == 1) { int dimensionId = row.get(0); IntList rowNumbers = getRowNumbers(selector, dimensionId); return rowNumbers.iterator(); } else { return IntIterators.EMPTY_ITERATOR; } }; } else { return () -> { final IndexedInts row = selector.getRow(); if (row.size() == 1) { int dimensionId = row.get(0); IntList rowNumbers = getAndCacheRowNumbers(selector, dimensionId); return rowNumbers.iterator(); } else { return IntIterators.EMPTY_ITERATOR; } }; } }
Source:
private void openGitCreateProjectViaWizardWizard(ExecutionEvent event, RepositoryTreeNode node, String path, List<String> pPaths) { if (pPaths.size() == 1) path = pPaths.get(0); GitCreateProjectViaWizardWizard wizard = new GitCreateProjectViaWizardWizard( node.getRepository(), path); if (pPaths.size() > 1) wizard.setFilter(pPaths); WizardDialog dlg = new WizardDialog(getShell(event), wizard) { @Override protected IDialogSettings getDialogBoundsSettings() { return Activator.getDefault().getDialogSettings(); } }; dlg.setHelpAvailable(false); dlg.open(); }

Target:
private void openGitCreateProjectViaWizardWizard(ExecutionEvent event, RepositoryTreeNode node, String path, List<String> pPaths) { if (pPaths.size() == 1) { path = pPaths.get(0); } GitCreateProjectViaWizardWizard wizard = new GitCreateProjectViaWizardWizard( node.getRepository(), path); if (pPaths.size() > 1) { wizard.setFilter(pPaths); } WizardDialog dlg = new WizardDialog(getShell(event), wizard) { @Override protected IDialogSettings getDialogBoundsSettings() { return Activator.getDefault().getDialogSettings(); } }; dlg.setHelpAvailable(false); dlg.open(); }
Source:
private void visit(QuestionNode nextNode){ if(isALoop(nextNode)){ Log.d(TAG,String.format("visit(%s) -> Not advancing",nextNode.getQuestion().getCode())); return; } if(!nextNode.isVisibleInReview()){ if(Session.getSurvey()!=null && !Session.getSurvey().isInProgress()) for (QuestionRelation questionRelation : nextNode.getQuestion().getQuestionRelations()) { if (questionRelation.isAReminder()) { nonVisibleNode = nextNode; if(nextNode==null){ return; } next(null); return; } } Log.d(TAG,String.format("visit(%s) -> In position %d",nextNode.getQuestion().getCode(),currentPosition)); rewindVisited(nextNode); nonVisibleNode = nextNode; return; } nonVisibleNode=null; currentPosition++; Log.d(TAG,String.format("visit(%s) -> In position %d",nextNode.getQuestion().getCode(),currentPosition)); visited.add(nextNode); }

Target:
private void visit(QuestionNode nextNode){ if(isALoop(nextNode)){ Log.d(TAG,String.format("visit(%s) -> Not advancing",nextNode.getQuestion().getCode())); return; } if(!nextNode.isVisibleInReview()){ if(Session.getSurvey()!=null && !Session.getSurvey().isInProgress()) { for (QuestionRelation questionRelation : nextNode.getQuestion().getQuestionRelations()) { if (questionRelation.isAReminder()) { nonVisibleNode = nextNode; if (nextNode == null) { return; } next(null); return; } } } Log.d(TAG,String.format("visit(%s) -> In position %d",nextNode.getQuestion().getCode(),currentPosition)); rewindVisited(nextNode); nonVisibleNode = nextNode; return; } nonVisibleNode=null; currentPosition++; Log.d(TAG,String.format("visit(%s) -> In position %d",nextNode.getQuestion().getCode(),currentPosition)); visited.add(nextNode); }
Source:
public boolean isNull() { return doubles[index] == null; }

Target:
public boolean isNull() { return !NullHandling.replaceWithDefault() && doubles[index] == null; }
Source:
public void onEvent(AppendColumnEvent event) { context.getStatus().setColumnId(String.valueOf(new Date().getTime())); context.getStatus().setColumnGroup(event.getColumnGroup()); commonExecution(context, new AppendColumnCommand()); context.getScenarioGridPanel().setFocus(true); }

Target:
public void onEvent(AppendColumnEvent event) { context.getStatus().setColumnId(String.valueOf(new Date().getTime())); context.getStatus().setColumnGroup(event.getColumnGroup()); commonExecution(context, new AppendColumnCommand(), true); }
Source:
public void untrackView(View view) { nativeVideo.unregisterInteractionViews(); super.untrackView(view); }

Target:
public void untrackView(View view) { if (nativeVideo != null) { nativeVideo.unregisterInteractionViews(); } super.untrackView(view); }
Source:
protected boolean saveBaseMessageToCacheDir( boolean overrideIfExists ) throws CpfException { String baseMsgPath = Util.joinPath( getDashboardFolderPath(), ( BASE_MESSAGES_FILENAME + MESSAGES_EXTENSION ) ); IBasicFile basePropertiesFile = null; if ( getDashboardAccess().fileExists( baseMsgPath ) ) { basePropertiesFile = getDashboardAccess().fetchFile( baseMsgPath ); String basePropertiesCachePath = Util.joinPath( getBaseTempCacheFolder(), ( BASE_MESSAGES_FILENAME + MESSAGES_EXTENSION ) ); if ( !getPluginAccess().fileExists( basePropertiesCachePath ) || overrideIfExists ) { try { getPluginAccess().saveFile( basePropertiesCachePath, basePropertiesFile.getContents() ); } catch ( IOException e ) { throw new CpfException( e ); } } } return true; }

Target:
protected boolean saveBaseMessageToCacheDir( boolean overrideIfExists ) throws IOException { String baseMsgPath = Util.joinPath( getDashboardFolderPath(), ( BASE_MESSAGES_FILENAME + MESSAGES_EXTENSION ) ); IBasicFile basePropertiesFile = null; if ( getDashboardAccess().fileExists( baseMsgPath ) ) { basePropertiesFile = getDashboardAccess().fetchFile( baseMsgPath ); String basePropertiesCachePath = Util.joinPath( getBaseTempCacheFolder(), ( BASE_MESSAGES_FILENAME + MESSAGES_EXTENSION ) ); if ( !getPluginAccess().fileExists( basePropertiesCachePath ) || overrideIfExists ) { getPluginAccess().saveFile( basePropertiesCachePath, basePropertiesFile.getContents() ); } } return true; }
Source:
public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException { StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName); ICommandResult result = executeCommand(command.toString(), monitor); Document doc = getDocumentFromStrings(result.getOutput()); NodeList rawSnapshotsOutputs = doc.getElementsByTagName(MIStrings.SNAPSHOT_OUTPUTS); ISnapshotInfo snapshotInfo = new SnapshotInfo(""); for (int i = 0; i < rawSnapshotsOutputs.getLength(); i++) { NodeList rawSnapshotOutput = rawSnapshotsOutputs.item(i).getChildNodes(); for (int j = 0; j < rawSnapshotOutput.getLength(); j++) { Node rawInfo = rawSnapshotOutput.item(j); switch (rawInfo.getNodeName()) { case MIStrings.ID: snapshotInfo.setId(Integer.parseInt(rawInfo.getTextContent())); break; case MIStrings.NAME: snapshotInfo.setName(rawInfo.getTextContent()); break; case MIStrings.SNAPSHOT_CTRL_URL: snapshotInfo.setSnapshotPath(rawInfo.getTextContent()); break; case MIStrings.SNAPSHOT_DATA_URL: break; default: break; } } } Matcher matcher2 = LTTngControlServiceConstants.TRACE_NETWORK_PATTERN.matcher(snapshotInfo.getSnapshotPath()); if (matcher2.matches()) { snapshotInfo.setStreamedSnapshot(true); } return snapshotInfo; }

Target:
public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException { StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName); ICommandResult result = executeCommand(command.toString(), monitor); Document doc = getDocumentFromStrings(result.getOutput()); NodeList rawSnapshotsOutputs = doc.getElementsByTagName(MIStrings.SNAPSHOT_OUTPUTS); ISnapshotInfo snapshotInfo = new SnapshotInfo(""); for (int i = 0; i < rawSnapshotsOutputs.getLength(); i++) { NodeList rawSnapshotOutput = rawSnapshotsOutputs.item(i).getChildNodes(); for (int j = 0; j < rawSnapshotOutput.getLength(); j++) { Node rawInfo = rawSnapshotOutput.item(j); switch (rawInfo.getNodeName()) { case MIStrings.ID: snapshotInfo.setId(Integer.parseInt(rawInfo.getTextContent())); break; case MIStrings.NAME: snapshotInfo.setName(rawInfo.getTextContent()); break; case MIStrings.SNAPSHOT_CTRL_URL: snapshotInfo.setSnapshotPath(rawInfo.getTextContent()); break; default: break; } } } Matcher matcher2 = LTTngControlServiceConstants.TRACE_NETWORK_PATTERN.matcher(snapshotInfo.getSnapshotPath()); if (matcher2.matches()) { snapshotInfo.setStreamedSnapshot(true); } return snapshotInfo; }
Source:
public void testBackwardsCompatibility() throws IOException { byte[] bytes = readHllBytes("hllp_small.bin"); HyperLogLogPlus hll = HyperLogLogPlus.Builder.build(bytes); Assert.assertEquals(17815, hll.cardinality()); byte[] bytes2 = readHllBytes("hllp_large.bin"); HyperLogLogPlus hll2 = HyperLogLogPlus.Builder.build(bytes2); Assert.assertEquals(34144234, hll2.cardinality()); }

Target:
public void testBackwardsCompatibility() throws IOException, CardinalityMergeException { byte[] bytes = readHllBytes("hllp_small.bin"); HyperLogLogPlus hll = HyperLogLogPlus.Builder.build(bytes); Assert.assertEquals(17815, hll.cardinality()); byte[] bytes2 = readHllBytes("hllp_large.bin"); HyperLogLogPlus hll2 = HyperLogLogPlus.Builder.build(bytes2); Assert.assertEquals(34144234, hll2.cardinality()); Assert.assertEquals(34174200, hll.merge(hll2).cardinality()); }
Source:
public void testAllDomainsHaveSpaceForAllDisksFailure() { setUpGeneralValidations(); setUpDiskValidations(); doReturn(Collections.EMPTY_LIST).when(cmd).getDisksList(); doReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)).when(multipleStorageDomainsValidator) .allDomainsHaveSpaceForAllDisks(anyList(), anyList()); CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd, VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN); verify(multipleStorageDomainsValidator).allDomainsHaveSpaceForAllDisks(anyList(), anyList()); }

Target:
public void testAllDomainsHaveSpaceForAllDisksFailure() { setUpGeneralValidations(); setUpDiskValidations(); doReturn(Collections.emptyList()).when(cmd).getDisksList(); doReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)).when(multipleStorageDomainsValidator) .allDomainsHaveSpaceForAllDisks(eq(Collections.<DiskImage>emptyList()), anyList()); CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd, VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN); verify(multipleStorageDomainsValidator).allDomainsHaveSpaceForAllDisks(eq(Collections.<DiskImage>emptyList()), anyList()); }
Source:
private void makeResourceWritable() throws CoreException { final IFile file = (IFile) model.getResource(); final Shell shell = this.getSite().getWorkbenchWindow().getShell(); final boolean[] ok = new boolean[] { false }; shell.getDisplay().syncExec(new Runnable() { private final String dialogTitle = "Read-only File Encountered"; private final String dialogMessage = "File ''{0}'' is read-only. Do you wish to make it writable?"; public void run() { ok[0] = MessageDialog.openQuestion(shell, dialogTitle, NLS.bind(dialogMessage, new String[] { file.getFullPath().toString() })); } }); if (ok[0]) { setWritable(file); } if (file.getResourceAttributes().isReadOnly()) { throw new CoreException(new Status(IStatus.ERROR, Q7UIPlugin.PLUGIN_ID.toString(), "is read-only")); } }

Target:
private void makeResourceWritable() throws CoreException { final IFile file = (IFile) model.getResource(); final Shell shell = this.getSite().getWorkbenchWindow().getShell(); final boolean[] ok = new boolean[] { false }; final String dialogTitle = "Read-only File Encountered"; final String dialogMessage = "File ''{0}'' is read-only. Do you wish to make it writable?"; ok[0] = MessageDialog.openQuestion(shell, dialogTitle, NLS.bind(dialogMessage, new String[] { file.getFullPath().toString() })); if (ok[0]) { setWritable(file); } if (file.getResourceAttributes().isReadOnly()) { throw new CoreException(new Status(IStatus.ERROR, Q7UIPlugin.PLUGIN_ID.toString(), "is read-only")); } }
Source:
public void ok() { new OkButton().click(); new WaitWhile(new ShellIsActive("Open CDI Named Bean")); }

Target:
public void ok() { new OkButton().click(); new WaitWhile(new ShellIsAvailable("Open CDI Named Bean")); }
Source:
public void setInbox(Inbox inbox) { this.inbox = inbox; }

Target:
protected void setInbox(Inbox inbox) { this.inbox = inbox; }
Source:
public void run() { try { if (httpClient != null) { close(); } } catch (Exception e) { e.printStackTrace(); } }

Target:
public void run() { try { if (httpClient != null) { close(); } } catch (Exception e) { logError(e) .addMessage("Caught exception closing HTTP client") .log(); } }
Source:
public ChannelInboundHandlerAdapter createHttpRequestHandler() { return new ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { HttpRequest httpRequest = (HttpRequest) msg; httpRequest = (HttpRequest) msg; HttpHeaders headers = httpRequest.headers(); Span span = tracer.nextSpan(extractor, headers); HttpNettyAdapter.parseClientAddress(httpRequest, span); handler.handleReceive(httpRequest, span); try (Tracer.SpanInScope ws = tracer.withSpanInScope(span)) { super.channelRead(ctx, httpRequest); } catch (Exception e) { throw e; } } }; }

Target:
public ChannelInboundHandlerAdapter createHttpRequestHandler() { return new ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { HttpRequest httpRequest = (HttpRequest) msg; HttpHeaders httpHeaders = httpRequest.headers(); Span span = handler.handleReceive(extractor, httpHeaders, httpRequest); ctx.channel().attr(AttributeKey.valueOf(Span.class.getName())).set(span); try (Tracer.SpanInScope ws = tracer.withSpanInScope(span)) { ctx.channel().attr(AttributeKey.valueOf(Tracer.SpanInScope.class.getName())).set(ws); super.channelRead(ctx, httpRequest); } catch (Exception | Error e) { throw e; } } }; }
Source:
public void testFiveRegionSplit() throws IOException { Admin admin = getConnection().getAdmin(); TableName tableName = TableName.valueOf("TestTableWithFiveSplits"); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); byte[] startKey = Bytes.toBytes("AAA"); byte[] endKey = Bytes.toBytes("ZZZ"); byte[][] splitKeys = Bytes.split(startKey, endKey, 2); try { if (admin.tableExists(tableName)) { LOG.warn("Not creating the table since it exists: %s", tableName); } else { admin.createTable(descriptor, startKey, endKey, 5); List<HRegionLocation> regions = null; try (RegionLocator locator = getConnection().getRegionLocator(tableName)) { regions = locator.getAllRegionLocations(); } Assert.assertEquals(5, regions.size()); for (int i = 0; i < regions.size(); i++) { HRegionLocation region = regions.get(i); String start_key = Bytes.toString( region.getRegionInfo().getStartKey()); String end_key = Bytes.toString(region.getRegionInfo().getEndKey()); if (i == 0) { Assert.assertEquals(Bytes.toString(startKey), end_key); } else if (i == regions.size() - 1) { Assert.assertEquals(Bytes.toString(endKey), start_key); } else { Assert.assertEquals(Bytes.toString(splitKeys[i-1]), start_key); Assert.assertEquals(Bytes.toString(splitKeys[i]), end_key); } } } } finally { try { admin.disableTable(tableName); admin.deleteTable(tableName); } catch (Throwable t) { LOG.warn("Error cleaning up the table", t); } } }

Target:
public void testFiveRegionSplit() throws IOException { Admin admin = getConnection().getAdmin(); TableName tableName = TableName.valueOf("TestTable" + UUID.randomUUID().toString()); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); byte[] startKey = Bytes.toBytes("AAA"); byte[] endKey = Bytes.toBytes("ZZZ"); byte[][] splitKeys = Bytes.split(startKey, endKey, 2); try { admin.createTable(descriptor, startKey, endKey, 5); List<HRegionLocation> regions = null; try (RegionLocator locator = getConnection().getRegionLocator(tableName)) { regions = locator.getAllRegionLocations(); } Assert.assertEquals(5, regions.size()); for (int i = 0; i < regions.size(); i++) { HRegionLocation region = regions.get(i); String start_key = Bytes.toString( region.getRegionInfo().getStartKey()); String end_key = Bytes.toString(region.getRegionInfo().getEndKey()); if (i == 0) { Assert.assertEquals(Bytes.toString(startKey), end_key); } else if (i == regions.size() - 1) { Assert.assertEquals(Bytes.toString(endKey), start_key); } else { Assert.assertEquals(Bytes.toString(splitKeys[i-1]), start_key); Assert.assertEquals(Bytes.toString(splitKeys[i]), end_key); } } } finally { try { admin.disableTable(tableName); admin.deleteTable(tableName); } catch (Throwable t) { LOG.warn("Error cleaning up the table", t); } } }
Source:
public void onTestStart(ITestResult iTestResult) { int percentage = iTestResult.getMethod().getSuccessPercentage(); int curCount = iTestResult.getMethod().getCurrentInvocationCount() + 1; int iCount = iTestResult.getMethod().getInvocationCount(); String invoc = ""; if(iCount>1) { invoc = ":" + curCount + "/" + iCount; if (percentage > 0) { invoc = invoc + " " + percentage + "%"; } } Description description = new Description().withValue(iTestResult.getMethod().getDescription()); TestCaseStartedEvent event = new TestCaseStartedEvent(getSuiteUid(iTestResult.getTestContext()), getName(iTestResult) + invoc); if (description.getValue() != null) { event.setDescription(description); } AnnotationManager am = new AnnotationManager(getMethodAnnotations(iTestResult)); am.setDefaults(getClassAnnotations(iTestResult)); am.update(event); getLifecycle().fire(event); fireAddParameterEvents(iTestResult); }

Target:
public void onTestStart(ITestResult iTestResult) { ITestNGMethod method = iTestResult.getMethod(); String suitePrefix = getCurrentSuitePrefix(iTestResult); String testName = getName(iTestResult); startedTestNames.add(testName); testName = testName.replace(suitePrefix, ""); String invoc = getMethodInvocationsAndSuccessPercentage(iTestResult); Description description = new Description().withValue(method.getDescription()); String suiteUid = getSuiteUid(iTestResult.getTestContext()); TestCaseStartedEvent event = new TestCaseStartedEvent(suiteUid, testName + invoc); if (description.getValue() != null) { event.setDescription(description); } AnnotationManager am = new AnnotationManager(getMethodAnnotations(iTestResult)); am.setDefaults(getClassAnnotations(iTestResult)); am.update(event); getLifecycle().fire(event); fireAddParameterEvents(iTestResult); }
Source:
public void mount(CryptoFileSystem fs) throws VolumeException { String mountPath; if (vaultSettings.usesIndividualMountPath().get()) { mountPath = vaultSettings.individualMountPath().get(); } else if (!Strings.isNullOrEmpty(vaultSettings.winDriveLetter().get())) { mountPath = vaultSettings.winDriveLetter().get().charAt(0) + ":\\"; } else { if (!windowsDriveLetters.getAvailableDriveLetters().isEmpty()) { mountPath = windowsDriveLetters.getAvailableDriveLetters().iterator().next() + ":\\"; } else { throw new VolumeException("No free drive letter available."); } } String mountName = vaultSettings.mountName().get(); try { this.mount = mountFactory.mount(fs.getPath("/"), Paths.get(mountPath), mountName, FS_TYPE_NAME); } catch (MountFailedException e) { throw new VolumeException("Unable to mount Filesystem", e); } }

Target:
public void mount(CryptoFileSystem fs) throws VolumeException { Path mountPath = Paths.get(getMountPathString()); String mountName = vaultSettings.mountName().get(); try { this.mount = mountFactory.mount(fs.getPath("/"), mountPath, mountName, FS_TYPE_NAME); } catch (MountFailedException e) { throw new VolumeException("Unable to mount Filesystem", e); } }
Source:
public ValidationResult provisioningComputeResourceValid(boolean provisioned, ExternalComputeResource computeResource) { return ValidationResult.failWith(VdcBllMessages.VDS_PROVIDER_PROVISION_MISSING_COMPUTERESOURCE) .when(provisioned == true && computeResource == null); }

Target:
public ValidationResult provisioningComputeResourceValid(boolean provisioned, ExternalComputeResource computeResource) { return ValidationResult.failWith(VdcBllMessages.VDS_PROVIDER_PROVISION_MISSING_COMPUTERESOURCE) .when(provisioned && computeResource == null); }
Source:
public void close() { synchronized (producerClosingLock) { kafkaProducer.close(); LOG.debug("Closed internal KafkaProducer {}. Stacktrace: {}", System.identityHashCode(this), Joiner.on("\n").join(Thread.currentThread().getStackTrace())); closed = true; } }

Target:
public void close() { synchronized (producerClosingLock) { kafkaProducer.close(); if (LOG.isDebugEnabled()) { LOG.debug( "Closed internal KafkaProducer {}. Stacktrace: {}", System.identityHashCode(this), Joiner.on("\n").join(Thread.currentThread().getStackTrace())); } closed = true; } }
Source:
public String toString() { return "DataInfoImpl{" + "dataType='" + dataType + '\'' + ", numUnits=" + numUnits + '}'; }

Target:
public String toString() { final StringBuilder sb = new StringBuilder("DataInfoImpl{"); sb.append("dataType='").append(dataType).append('\''); sb.append(", numUnits=").append(numUnits); sb.append('}'); return sb.toString(); }
Source:
public void onResume() { super.onResume(); Log_OC.v(TAG, "onResume"); if ((Util.SDK_INT <= 23 || player == null)) { preparePlayer(); } }

Target:
public void onResume() { super.onResume(); Log_OC.v(TAG, "onResume"); preparePlayer(); }
Source:
public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("liskbnb".equalsIgnoreCase(walletType)) { String address = st.nextToken(); String bnbapikey = st.nextToken(); String bnbapisecret = st.nextToken(); if ( address != null && bnbapikey !=null && bnbapisecret != null ) { return new Lskwallet(address,bnbapikey,bnbapisecret); } } } return null; }

Target:
public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("liskBinance".equalsIgnoreCase(walletType)) { String address = st.nextToken(); String binanceApiKey = st.nextToken(); String binanceApiSecret = st.nextToken(); if (address != null && binanceApiKey !=null && binanceApiSecret != null ) { return new LskWallet(address,binanceApiKey,binanceApiSecret); } } } return null; }