auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Boolean login(){ Reader reader = null; this.logger.debug("Do login for user '{}'", this.userName); try { HttpURLConnection httpURLConnection; httpURLConnection = (HttpURLConnection) new URL(API_URL + "auth?email=" + this.userName + "&password=" + this.password) .openConnection(); InputStream inputStream = httpURLConnection.getInputStream(); reader = new InputStreamReader(inputStream, "UTF-8"); JsonObject jsonObject = (JsonObject) jsonParser.parse(reader); String status = jsonObject.get("status").getAsString(); if(!status.equals("ok")){ return false; } this.logger.debug("Logon successfull"); this.authToken = jsonObject.get("authToken").getAsString(); return true; } catch(Exception ex) { this.logger.error("Error do logon: '{}'", ex.toString()); return false; } finally { if (reader != null) { try { reader.close(); } catch (IOException ignored) { } } } }

Target:
public Boolean login() { Reader reader = null; logger.debug("Do login for user '{}'", this.userName); try { String url = API_URL + "auth?email=" + this.userName + "&password=" + this.password; HttpURLConnection httpURLConnection; httpURLConnection = (HttpURLConnection) new URL(url) .openConnection(); InputStream inputStream = httpURLConnection.getInputStream(); reader = new InputStreamReader(inputStream, "UTF-8"); JsonObject jsonObject = (JsonObject) jsonParser.parse(reader); String status = jsonObject.get("status").getAsString(); if (!status.equals("ok")) { return false; } logger.debug("Logon successfull"); authToken = jsonObject.get("authToken").getAsString(); return true; } catch (Exception ex) { logger.error("Error do logon: '{}'", ex.toString()); return false; } finally { if (reader != null) { try { reader.close(); } catch (IOException ignored) { } } } }
Source:
public void testTemporaryStagingDirectorySessionProperties() { String tableName = "test_temporary_staging_directory_session_properties"; assertUpdate(format("CREATE TABLE %s(i int)", tableName)); Session session = Session.builder(getSession()) .setCatalogSessionProperty("hive", "temporary_staging_directory_enabled", "false") .build(); HiveInsertTableHandle hiveInsertTableHandle = getHiveInsertTableHandle(session, tableName); assertEquals(hiveInsertTableHandle.getLocationHandle().getWritePath(), hiveInsertTableHandle.getLocationHandle().getTargetPath()); session = Session.builder(getSession()) .setCatalogSessionProperty("hive", "temporary_staging_directory_path", "/tmp/custom/temporary-${USER}") .build(); hiveInsertTableHandle = getHiveInsertTableHandle(session, tableName); assertNotEquals(hiveInsertTableHandle.getLocationHandle().getWritePath(), hiveInsertTableHandle.getLocationHandle().getTargetPath()); assertTrue(hiveInsertTableHandle.getLocationHandle().getWritePath().toString().startsWith("file:/tmp/custom/temporary-")); assertUpdate("DROP TABLE " + tableName); }

Target:
public void testTemporaryStagingDirectorySessionProperties() { String tableName = "test_temporary_staging_directory_session_properties"; assertUpdate(format("CREATE TABLE %s(i int)", tableName)); Session session = Session.builder(getSession()) .setCatalogSessionProperty("hive", "temporary_staging_directory_enabled", "false") .build(); HiveInsertTableHandle hiveInsertTableHandle = getHiveInsertTableHandle(session, tableName); assertEquals(hiveInsertTableHandle.getLocationHandle().getWritePath(), hiveInsertTableHandle.getLocationHandle().getTargetPath()); session = Session.builder(getSession()) .setCatalogSessionProperty("hive", "temporary_staging_directory_enabled", "true") .setCatalogSessionProperty("hive", "temporary_staging_directory_path", "/tmp/custom/temporary-${USER}") .build(); hiveInsertTableHandle = getHiveInsertTableHandle(session, tableName); assertNotEquals(hiveInsertTableHandle.getLocationHandle().getWritePath(), hiveInsertTableHandle.getLocationHandle().getTargetPath()); assertTrue(hiveInsertTableHandle.getLocationHandle().getWritePath().toString().startsWith("file:/tmp/custom/temporary-")); assertUpdate("DROP TABLE " + tableName); }
Source:
public boolean shouldSchedule(Queue.Task p, List<Action> actions) { for (Action action : actions) { if (action instanceof CauseAction) { for (Cause c : ((CauseAction) action).getCauses()) { if (c instanceof BranchIndexingCause) { if (p instanceof Job) { Job j = (Job) p; OverrideIndexTriggersJobProperty overrideProp = (OverrideIndexTriggersJobProperty) j.getProperty(OverrideIndexTriggersJobProperty.class); if (j.getParent() instanceof MultiBranchProject) { MultiBranchProject mbp = (MultiBranchProject) j.getParent(); if (mbp.getParent() instanceof OrganizationFolder) { NoTriggerOrganizationFolderProperty prop = ((OrganizationFolder) mbp.getParent()).getProperties().get(NoTriggerOrganizationFolderProperty.class); if (prop != null) { String name = mbp.getProjectFactory().getBranch(j).getName(); if (!name.matches(prop.getBranches()) && (overrideProp == null || !overrideProp.getEnableTriggers())) { return false; } } } } } } } } } return true; }

Target:
public boolean shouldSchedule(Queue.Task p, List<Action> actions) { for (Action action : actions) { if (action instanceof CauseAction) { for (Cause c : ((CauseAction) action).getCauses()) { if (c instanceof BranchIndexingCause) { if (p instanceof Job) { Job<?,?> j = (Job) p; if (j.getParent() instanceof MultiBranchProject) { OverrideIndexTriggersJobProperty overrideProp = j.getProperty(OverrideIndexTriggersJobProperty.class); if (overrideProp != null) { return overrideProp.getEnableTriggers(); } else { MultiBranchProject mbp = (MultiBranchProject) j.getParent(); if (mbp.getParent() instanceof OrganizationFolder) { NoTriggerOrganizationFolderProperty prop = ((OrganizationFolder) mbp.getParent()).getProperties().get(NoTriggerOrganizationFolderProperty.class); if (prop != null) { String name = mbp.getProjectFactory().getBranch(j).getName(); if (!name.matches(prop.getBranches())) { return false; } } } } } } } } } } return true; }
Source:
public void handleWaypoints() { if (getVisibleCachesCount() < Settings.getWayPointsThreshold()) { Collection<String> baseGeocodes = Collections.<String>emptyList(); if (baseOverlay != null) { baseGeocodes = baseOverlay.getCacheGeocodes(); } final boolean showStored = storedOverlay != null; wpOverlay.showWaypoints(baseGeocodes, showStored); } else { wpOverlay.hideWaypoints(); } }

Target:
public void handleWaypoints() { if (getVisibleCachesCount() < Settings.getWayPointsThreshold()) { Collection<String> baseGeocodes = Collections.emptyList(); if (baseOverlay != null) { baseGeocodes = baseOverlay.getCacheGeocodes(); } final boolean showStored = storedOverlay != null; wpOverlay.showWaypoints(baseGeocodes, showStored); } else { wpOverlay.hideWaypoints(); } }
Source:
int count(@Nonnull final Table<K, V, M> table) { txBeginMaybe(); operations.forEach(Runnable::run); operations.clear(); return table.count(); }

Target:
int count(@Nonnull final Table<K, V, M> table) { applyWritesForReadOnTable(table); table.getMetrics().incNumCounts(); return table.count(); }
Source:
public void injectInSingletonInstance() throws Exception { final MarshallerInspector inspector = new MarshallerInspector(SingletonMarshaller.class); SingletonMarshaller instance1 = inspector.getInstance(ctx); assertNotSame(ctx, instance1.ctx); assertTrue(instance1.ctx instanceof ThreadSafeRenderingContext); ThreadSafeRenderingContext safeCtx = (ThreadSafeRenderingContext) instance1.ctx; assertNotNull(safeCtx.getDelegate()); assertSame(ctx, safeCtx.getDelegate()); ExecutorService executor = Executors.newSingleThreadExecutor(); try { Future<?> future = executor.submit(new Runnable() { @Override public void run() { SingletonMarshaller instance2 = inspector.getInstance(ctx); assertNotSame(ctx, instance2.ctx); assertTrue(instance2.ctx instanceof ThreadSafeRenderingContext); ThreadSafeRenderingContext safeCtx = (ThreadSafeRenderingContext) instance2.ctx; assertNotNull(safeCtx.getDelegate()); assertSame(ctx, safeCtx.getDelegate()); } }); executor.shutdown(); future.get(10, TimeUnit.SECONDS); } finally { executor.shutdownNow(); } }

Target:
public void injectInSingletonInstance() throws Exception { final MarshallerInspector inspector = new MarshallerInspector(SingletonMarshaller.class); SingletonMarshaller instance1 = inspector.getInstance(ctx); assertNotSame(ctx, instance1.ctx); assertTrue(instance1.ctx instanceof ThreadSafeRenderingContext); ThreadSafeRenderingContext safeCtx = (ThreadSafeRenderingContext) instance1.ctx; assertNotNull(safeCtx.getDelegate()); assertSame(ctx, safeCtx.getDelegate()); ExecutorService executor = Executors.newSingleThreadExecutor(); try { Future<?> future = executor.submit(() -> { SingletonMarshaller instance2 = inspector.getInstance(ctx); assertNotSame(ctx, instance2.ctx); assertTrue(instance2.ctx instanceof ThreadSafeRenderingContext); ThreadSafeRenderingContext safeCtx2 = (ThreadSafeRenderingContext) instance2.ctx; assertNotNull(safeCtx2.getDelegate()); assertSame(ctx, safeCtx2.getDelegate()); }); executor.shutdown(); future.get(10, TimeUnit.SECONDS); } finally { executor.shutdownNow(); } }
Source:
protected boolean deleteTopics(Collection<String> topics) { boolean deleteStatus = true; try { DeleteTopicsResult resultFutures = adminClient.deleteTopics(topics); resultFutures.all().get(10000, TimeUnit.MILLISECONDS); } catch (Exception e) { deleteStatus = false; } return deleteStatus; }

Target:
protected boolean deleteTopics(Collection<String> topics) { boolean deleteStatus = true; try { DeleteTopicsResult resultFutures = adminClient.deleteTopics(topics); resultFutures.all().get(ADMIN_OPERATION_WAIT_DURATION_MS, TimeUnit.MILLISECONDS); } catch (Exception e) { deleteStatus = false; } return deleteStatus; }
Source:
private Mono<Void> handleChannel(int streamId, Frame firstFrame) { UnicastProcessor<Frame> frames = UnicastProcessor.create(); Flux<Payload> payloads = frames .doOnCancel(() -> { if (connection.availability() > 0.0) { connection.sendOne(Frame.Cancel.from(streamId)).subscribe(null, errorConsumer::accept); } }) .doOnError(t -> { if (connection.availability() > 0.0) { connection.sendOne(Frame.Error.from(streamId, t)).subscribe(null, errorConsumer::accept); } }) .doOnRequest(l -> { if (connection.availability() > 0.0) { connection.sendOne(Frame.RequestN.from(streamId, l)).subscribe(null, errorConsumer::accept); } }) .cast(Payload.class); return handleStream(streamId, requestChannel(payloads), firstFrame); }

Target:
private Mono<Void> handleChannel(int streamId, Frame firstFrame) { UnicastProcessor<Payload> frames = UnicastProcessor.create(); addChannelProcessor(streamId, frames); Flux<Payload> payloads = frames .doOnCancel(() -> { if (connection.availability() > 0.0) { connection.sendOne(Frame.Cancel.from(streamId)).subscribe(null, errorConsumer); } }) .doOnError(t -> { if (connection.availability() > 0.0) { connection.sendOne(Frame.Error.from(streamId, t)).subscribe(null, errorConsumer); } }) .doOnRequest(l -> { if (connection.availability() > 0.0) { connection.sendOne(Frame.RequestN.from(streamId, l)).subscribe(null, errorConsumer); } }) .doFinally(signalType -> { removeChannelProcessor(streamId); }); return handleStream(streamId, requestChannel(payloads), firstFrame); }
Source:
public static boolean isLegalReviewerGroup(final AccountGroup.UUID groupUUID) { if (AccountGroup.ANONYMOUS_USERS.equals(groupUUID) || AccountGroup.REGISTERED_USERS.equals(groupUUID)) { return false; } return true; }

Target:
public static boolean isLegalReviewerGroup(final AccountGroup.UUID groupUUID) { return !(AccountGroup.ANONYMOUS_USERS.equals(groupUUID) || AccountGroup.REGISTERED_USERS.equals(groupUUID)); }
Source:
public void testSimpleAtomicBlockwisePUTWithBiggerNegociation() throws Exception { System.out.println("Simple atomic blockwise PUT with bigger size negociation"); reqtPayload = generateRandomPayload(300); respPayload = generateRandomPayload(50); String path = "test"; Request request = createRequest(PUT, path, server); request.setPayload(reqtPayload); client.sendRequest(request); server.expectRequest(CON, PUT, path).storeBoth("A").block1(0, true, 128).payload(reqtPayload.substring(0, 128)) .go(); server.sendResponse(ACK, CONTINUE).loadBoth("A").block1(0, true, 256).go(); server.expectRequest(CON, PUT, path).storeBoth("B").block1(1, true, 128) .payload(reqtPayload.substring(128, 256)).go(); server.sendResponse(ACK, CONTINUE).loadBoth("B").block1(1, true, 256).go(); server.expectRequest(CON, PUT, path).storeBoth("C").block1(2, false, 128).go(); server.sendResponse(ACK, CHANGED).loadBoth("C").block1(2, false, 256).payload(respPayload).go(); Response response = request.waitForResponse(1000); assertResponseContainsExpectedPayload(response, CHANGED, respPayload); printServerLog(clientInterceptor); }

Target:
public void testSimpleAtomicBlockwisePUTWithBiggerNegociation() throws Exception { System.out.println("Simple atomic blockwise PUT with bigger size negociation"); reqtPayload = generateRandomPayload(300); respPayload = generateRandomPayload(50); String path = "test"; Request request = createRequest(PUT, path, server); request.setPayload(reqtPayload); client.sendRequest(request); server.expectRequest(CON, PUT, path).storeBoth("A").block1(0, true, 128).payload(reqtPayload.substring(0, 128)) .go(); server.sendResponse(ACK, CONTINUE).loadBoth("A").block1(0, true, 256).go(); server.expectRequest(CON, PUT, path).storeBoth("B").block1(1, true, 128) .payload(reqtPayload.substring(128, 256)).go(); server.sendResponse(ACK, CONTINUE).loadBoth("B").block1(1, true, 256).go(); server.expectRequest(CON, PUT, path).storeBoth("C").block1(2, false, 128) .payload(reqtPayload.substring(256, 300)).go(); server.sendResponse(ACK, CHANGED).loadBoth("C").block1(2, false, 256).payload(respPayload).go(); Response response = request.waitForResponse(1000); assertResponseContainsExpectedPayload(response, CHANGED, respPayload); printServerLog(clientInterceptor); }
Source:
public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); int id = params.getRequiredParamInt(ActionConstants.PARAM_ID); if (!indicatorService.delete(id, params.getUser().getId())) { throw new ActionParamsException("Unknown indicator/not the owner of the indicator."); } LOG.info("Deleting indicator", id); if (!indicatorService.delete(id, params.getUser().getId())) { throw new ActionDeniedException("Tried to delete indicator from other user"); } ResponseHelper.writeResponse(params, JSONHelper.createJSONObject("deleted", id)); }

Target:
public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); int id = params.getRequiredParamInt(ActionConstants.PARAM_ID); if (!indicatorService.delete(id, params.getUser().getId())) { throw new ActionParamsException("Unknown indicator/not the owner of the indicator."); } LOG.info("Deleted indicator", id); ResponseHelper.writeResponse(params, JSONHelper.createJSONObject("deleted", id)); }
Source:
protected boolean evaluatePredicate(List<String> trueVariables, String pred) { Expression expression; try { expression = StaticJavaParser.parseExpression(pred); } catch (ParseProblemException p) { throw new BugInCF("unparseable predicate: " + pred + ". Parse exception: " + p); } return evaluateBooleanExpression(expression, trueVariables); }

Target:
protected boolean evaluatePredicate(List<String> trueVariables, String pred) { Expression expression; try { expression = StaticJavaParser.parseExpression(pred); } catch (ParseProblemException p) { throw new UserError("unparseable predicate: " + pred + ". Parse exception: " + p); } return evaluateBooleanExpression(expression, trueVariables); }
Source:
public ZkBaseDataAccessor<byte[]> getByteArrayBaseDataAccessor() { if (_byteArrayBaseDataAccessor == null) { synchronized (this) { if (_byteArrayBaseDataAccessor == null) { _byteArrayBaseDataAccessor = new ZkBaseDataAccessor<>(_zkAddr, new ZkSerializer() { @Override public byte[] serialize(Object o) throws ZkMarshallingError { return (byte[]) o; } @Override public Object deserialize(byte[] bytes) throws ZkMarshallingError { return bytes; } }); } } } return _byteArrayBaseDataAccessor; }

Target:
public ZkBaseDataAccessor<byte[]> getByteArrayBaseDataAccessor() { if (_byteArrayBaseDataAccessor == null) { synchronized (this) { if (_byteArrayBaseDataAccessor == null) { _byteArrayBaseDataAccessor = new ZkBaseDataAccessor<>(_zkAddr, new ZkSerializer() { @Override public byte[] serialize(Object o) throws ZkMarshallingError { throw new UnsupportedOperationException("Serialize is not supported yet!"); } @Override public Object deserialize(byte[] bytes) throws ZkMarshallingError { return bytes; } }); } } } return _byteArrayBaseDataAccessor; }
Source:
public void init() { int numThreads = 2 * Runtime.getRuntime().availableProcessors(); LOGGER.debug("{} size: {}", QUERY_POOL_NAME, numThreads); if (queryExecutor != null) { destroy(); } queryExecutor = new ThreadPoolExecutor( numThreads, numThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingDeque<>(BLOCKING_Q_INITIAL_SIZE), StandardThreadFactoryBuilder.newThreadFactory(QUERY_POOL_NAME), new ThreadPoolExecutor.CallerRunsPolicy()); queryExecutor.prestartAllCoreThreads(); }

Target:
public void init() { int numThreads = 2 * Runtime.getRuntime().availableProcessors(); String threadProp = System.getProperty(ENDPOINT_THREADPOOL_COUNT); if (threadProp != null) { try { numThreads = Integer.parseInt(threadProp); } catch (NumberFormatException nfe) { LOGGER.info( "Unable to use configured pool size: {}, defaulting to: {}", ENDPOINT_THREADPOOL_COUNT, threadProp, numThreads, nfe); } } LOGGER.debug("{} size: {}", QUERY_POOL_NAME, numThreads); if (queryExecutor != null) { destroy(); } queryExecutor = new ThreadPoolExecutor( numThreads, numThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingDeque<>(MAX_Q_SIZE), StandardThreadFactoryBuilder.newThreadFactory(QUERY_POOL_NAME), new ThreadPoolExecutor.CallerRunsPolicy()); queryExecutor.prestartAllCoreThreads(); }
Source:
public void sendResponse(ResponseMsg response, ChannelHandlerContext ctx) { ctx.writeAndFlush(response, ctx.voidPromise()); log.trace("Sent response: {}", response); }

Target:
public void sendResponse(ResponseMsg response, ChannelHandlerContext ctx) { ctx.writeAndFlush(response, ctx.voidPromise()); if(log.isTraceEnabled()) { log.trace("Sent response: {}", response); } }
Source:
public Schematic build() throws IllegalArgumentException { if (this.palette == null) { this.palette = this.type.create(); } checkArgument(this.volume != null || this.view != null); Vector3i min; Vector3i size; if (this.volume != null) { min = this.volume.getBlockMin(); size = this.volume.getBlockSize(); } else { min = this.view.getBlockMin(); size = this.view.getBlockSize(); } if (this.metadata == null) { this.metadata = new MemoryDataContainer(); } for (Map.Entry<String, Object> entry : this.metaValues.entrySet()) { this.metadata.set(DataQuery.of(".", entry.getKey()), entry.getValue()); } if (this.volume == null) { final MutableBlockVolume volume; if (this.palette.getHighestId() <= 0xFF) { volume = new ByteArrayMutableBlockBuffer(this.palette, min, size); } else if (this.palette.getHighestId() <= 0xFFFF) { volume = new CharArrayMutableBlockBuffer(this.palette, min, size); } else { volume = new IntArrayMutableBlockBuffer(this.palette, min, size); } Map<Vector3i, TileEntityArchetype> tiles = Maps.newHashMap(); this.view.getBlockWorker(SpongeImpl.getImplementationCause()).iterate((v, x, y, z) -> { volume.setBlock(x, y, z, v.getBlock(x, y, z), SpongeImpl.getImplementationCause()); Optional<TileEntity> tile = v.getTileEntity(x, y, z); if (tile.isPresent()) { tiles.put(new Vector3i(x, y, z), tile.get().createArchetype()); } }); return new SpongeSchematic(volume, tiles, this.metadata); } else { return new SpongeSchematic((SpongeArchetypeVolume) this.volume, this.metadata); } }

Target:
public Schematic build() throws IllegalArgumentException { if (this.palette == null) { this.palette = this.type.create(); } checkArgument(this.volume != null || this.view != null); Vector3i min; Vector3i size; if (this.volume != null) { min = this.volume.getBlockMin(); size = this.volume.getBlockSize(); } else { min = this.view.getBlockMin(); size = this.view.getBlockSize(); } if (this.metadata == null) { this.metadata = new MemoryDataContainer(); } for (Map.Entry<String, Object> entry : this.metaValues.entrySet()) { this.metadata.set(DataQuery.of(".", entry.getKey()), entry.getValue()); } if (this.volume == null) { final MutableBlockVolume volume; if (this.palette.getHighestId() <= 0xFF) { volume = new ByteArrayMutableBlockBuffer(this.palette, min, size); } else if (this.palette.getHighestId() <= 0xFFFF) { volume = new CharArrayMutableBlockBuffer(this.palette, min, size); } else { volume = new IntArrayMutableBlockBuffer(this.palette, min, size); } Map<Vector3i, TileEntityArchetype> tiles = Maps.newHashMap(); this.view.getBlockWorker(SpongeImpl.getImplementationCause()).iterate((v, x, y, z) -> { volume.setBlock(x, y, z, v.getBlock(x, y, z), SpongeImpl.getImplementationCause()); Optional<TileEntity> tile = v.getTileEntity(x, y, z); if (tile.isPresent()) { tiles.put(new Vector3i(x, y, z), tile.get().createArchetype()); } }); return new SpongeSchematic(volume, tiles, this.metadata); } return new SpongeSchematic((SpongeArchetypeVolume) this.volume, this.metadata); }
Source:
private void processDigest(ConcurrentMap<Client, PaxosLong> currentCachedEntries, AcceptorCacheDigest digest) { TimestampedAcceptorCacheKey newCacheKey = TimestampedAcceptorCacheKey.of(digest); ConcurrentMap<Client, PaxosLong> newCachedEntries = cacheKeysToCaches.get(newCacheKey.cacheKey(), $ -> currentCachedEntries); KeyedStream.stream(digest.updates()) .map(PaxosLong::of) .forEach((client, paxosLong) -> newCachedEntries.merge(client, paxosLong, BatchingPaxosLatestSequenceCache::max)); maybeSetNewCacheKey(newCacheKey); }

Target:
private void processDigest(ConcurrentMap<Client, PaxosLong> currentCachedEntries, AcceptorCacheDigest digest) { TimestampedAcceptorCacheKey newCacheKey = TimestampedAcceptorCacheKey.of(digest); ConcurrentMap<Client, PaxosLong> newCachedEntries = cacheKeysToCaches.get(newCacheKey.cacheKey(), $ -> currentCachedEntries); KeyedStream.stream(digest.updates()) .map(PaxosLong::of) .forEach((client, paxosLong) -> newCachedEntries.merge(client, paxosLong, BatchingPaxosLatestSequenceCache::max)); accumulateLatestCacheKey(newCacheKey); }
Source:
public void addServoEventListener(NameProvider service) { isEventsEnabled = true; addListener("publishServoEvent", service.getName(), "onServoEvent"); }

Target:
public void addServoEventListener(NameProvider service) { isEventsEnabled = true; subscribe(getName(), "publishServoEvent"); }
Source:
protected boolean disconnectStorageDomain(StorageDomain storageDomain) { try { return StorageHelperDirector.getInstance() .getItem(storageDomain.getStorageType()) .disconnectStorageFromDomainByVdsId(storageDomain, getVdsId()); } catch (RuntimeException e) { log.error("Exception while disconnect storage domain", e); return false; } }

Target:
protected boolean disconnectStorageDomain(StorageDomain storageDomain) { try { return StorageHelperDirector.getInstance() .getItem(storageDomain.getStorageType()) .disconnectStorageFromDomainByVdsId(storageDomain, getVdsId()); } catch (RuntimeException e) { log.error("Exception while disconnecting a storage domain", e); return false; } }
Source:
public void verifyAdditionalPropertyResponse() throws Exception { Map<String, String> queryParams = new HashMap<String, String>(); String str = client.invokeAPI("/mockResponses/additionalPropertiesTest", "GET", queryParams, null, new HashMap<String, String>(), null, "application/json", null, new String[0]); assertEquals(str, "{\"key\":\"key\",\"value\":\"string\"}"); }

Target:
public void verifyAdditionalPropertyResponse() throws Exception { Map<String, String> queryParams = new HashMap<String, String>(); String str = client.invokeAPI("/mockResponses/additionalPropertiesTest", "GET", queryParams, null, new HashMap<String, String>(), null, "application/json", null, new String[0]); assertEquals(str, "{\"foo\":0,\"additionalProperty\":\"string\"}"); }
Source:
public CAS getMergeCas(AnnotatorState aState, SourceDocument aDocument, Map<String, CAS> aCasses, AnnotationDocument aTemplate, boolean aUpgrade, boolean aMergeIncompleteAnnotations, boolean aForceRecreateCas) throws UIMAException, ClassNotFoundException, IOException, AnnotationException { if (aForceRecreateCas) { return initializeMergeCas(aState, aCasses, aTemplate, aMergeIncompleteAnnotations); } CAS mergeCas = null; try { if (AUTOMATION.equals(aState.getMode()) || CORRECTION.equals(aState.getMode())) { if (!correctionDocumentService.existsCorrectionCas(aDocument)) { return initializeMergeCas(aState, aCasses, aTemplate, aMergeIncompleteAnnotations); } mergeCas = correctionDocumentService.readCorrectionCas(aDocument); if (aUpgrade) { correctionDocumentService.upgradeCorrectionCas(mergeCas, aDocument); correctionDocumentService.writeCorrectionCas(mergeCas, aDocument); updateDocumentTimestampAfterWrite(aState, correctionDocumentService .getCorrectionCasTimestamp(aState.getDocument())); } return mergeCas; } else { if (!curationDocumentService.existsCurationCas(aDocument)) { return initializeMergeCas(aState, aCasses, aTemplate, aMergeIncompleteAnnotations); } mergeCas = curationDocumentService.readCurationCas(aDocument); if (aUpgrade) { curationDocumentService.upgradeCurationCas(mergeCas, aDocument); curationDocumentService.writeCurationCas(mergeCas, aDocument, true); updateDocumentTimestampAfterWrite(aState, curationDocumentService .getCurationCasTimestamp(aState.getDocument())); } return mergeCas; } } catch (Exception e) { log.error(e.getMessage()); } return mergeCas; }

Target:
public CAS getMergeCas(AnnotatorState aState, SourceDocument aDocument, Map<String, CAS> aCasses, AnnotationDocument aTemplate, boolean aUpgrade, boolean aMergeIncompleteAnnotations, boolean aForceRecreateCas) throws UIMAException, ClassNotFoundException, IOException, AnnotationException { if (aForceRecreateCas) { return initializeMergeCas(aState, aCasses, aTemplate, aMergeIncompleteAnnotations); } CAS mergeCas = null; if (AUTOMATION.equals(aState.getMode()) || CORRECTION.equals(aState.getMode())) { if (!correctionDocumentService.existsCorrectionCas(aDocument)) { return initializeMergeCas(aState, aCasses, aTemplate, aMergeIncompleteAnnotations); } mergeCas = correctionDocumentService.readCorrectionCas(aDocument); if (aUpgrade) { correctionDocumentService.upgradeCorrectionCas(mergeCas, aDocument); correctionDocumentService.writeCorrectionCas(mergeCas, aDocument); updateDocumentTimestampAfterWrite(aState, correctionDocumentService.getCorrectionCasTimestamp(aState.getDocument())); } } else { if (!curationDocumentService.existsCurationCas(aDocument)) { return initializeMergeCas(aState, aCasses, aTemplate, aMergeIncompleteAnnotations); } mergeCas = curationDocumentService.readCurationCas(aDocument); if (aUpgrade) { curationDocumentService.upgradeCurationCas(mergeCas, aDocument); curationDocumentService.writeCurationCas(mergeCas, aDocument, true); updateDocumentTimestampAfterWrite(aState, curationDocumentService.getCurationCasTimestamp(aState.getDocument())); } } return mergeCas; }
Source:
public Mono<ResponseEntity<?>> updateWorkflowInstance( @ApiParam("Internal id for workflow instance") @PathVariable("id") long id, @RequestBody @ApiParam("Submitted workflow instance information") UpdateWorkflowInstanceRequest req) { return handleExceptions(() -> { return wrapBlocking(() -> { boolean updated = super.updateWorkflowInstance(id, req, workflowInstanceFactory, workflowInstances, workflowInstanceDao); return (updated ? noContent() : status(CONFLICT)).build(); }); }); }

Target:
public Mono<ResponseEntity<?>> updateWorkflowInstance( @ApiParam("Internal id for workflow instance") @PathVariable("id") long id, @RequestBody @ApiParam("Submitted workflow instance information") UpdateWorkflowInstanceRequest req) { return handleExceptions(() -> wrapBlocking(() -> { boolean updated = super.updateWorkflowInstance(id, req, workflowInstanceFactory, workflowInstances, workflowInstanceDao); return (updated ? noContent() : status(CONFLICT)).build(); })); }
Source:
public static void main(String... args) throws IOException { String mantaUserName = "USERNAME"; String privateKeyPath = "PATH/.ssh/id_rsa"; String publicKeyId = "04:92:7b:23:bc:08:4f:d7:3b:5a:38:9e:4a:17:2e:df"; ConfigContext config = new ChainedConfigContext( new DefaultsConfigContext(), new EnvVarConfigContext(), new MapConfigContext(System.getProperties())) .setMantaURL("<LINK_0>") .setMantaUser(mantaUserName) .setMantaKeyPath(privateKeyPath) .setMantaKeyId(publicKeyId) .setClientEncryptionEnabled(true) .setEncryptionAlgorithm("AES256/CTR/NoPadding") .setEncryptionAuthenticationMode(EncryptionAuthenticationMode.Mandatory) .setPermitUnencryptedDownloads(false) .setEncryptionKeyId("simple/example") .setEncryptionPrivateKeyBytes(Base64.getDecoder().decode("RkZGRkZGRkJEOTY3ODNDNkM5MUUyMjIyMTExMTIyMjI=")); try (MantaClient client = new MantaClient(config)) { String mantaPath = MantaClient.SEPARATOR + mantaUserName + "/stor/foo"; MantaObjectResponse response = client.put(mantaPath, "This is my secret\nthat I want encrypted."); System.out.println("HTTP Response headers:"); System.out.println(response.getHttpHeaders().toString()); try (InputStream is = client.getAsInputStream(mantaPath); Scanner scanner = new Scanner(is, StandardCharsets.UTF_8.name())) { while (scanner.hasNextLine()) { System.out.println(scanner.nextLine()); } } } }

Target:
public static void main(String... args) throws IOException { String mantaUserName = "USERNAME"; String privateKeyPath = "PATH/.ssh/id_rsa"; String publicKeyId = "04:92:7b:23:bc:08:4f:d7:3b:5a:38:9e:4a:17:2e:df"; ConfigContext config = new ChainedConfigContext( new DefaultsConfigContext(), new EnvVarConfigContext(), new MapConfigContext(System.getProperties())) .setMantaURL("<LINK_0>") .setMantaUser(mantaUserName) .setMantaKeyPath(privateKeyPath) .setMantaKeyId(publicKeyId) .setClientEncryptionEnabled(true) .setEncryptionAlgorithm("AES256/CTR/NoPadding") .setEncryptionAuthenticationMode(EncryptionAuthenticationMode.Mandatory) .setPermitUnencryptedDownloads(false) .setEncryptionKeyId("simple/example") .setEncryptionPrivateKeyBytes(Base64.getDecoder().decode("RkZGRkZGRkJEOTY3ODNDNkM5MUUyMjIyMTExMTIyMjI=")); try (MantaClient client = new MantaClient(config)) { String mantaPath = SEPARATOR + mantaUserName + SEPARATOR + "stor" + SEPARATOR + "foo"; MantaObjectResponse response = client.put(mantaPath, "This is my secret\nthat I want encrypted."); System.out.println("HTTP Response headers:"); System.out.println(response.getHttpHeaders().toString()); try (InputStream is = client.getAsInputStream(mantaPath); Scanner scanner = new Scanner(is, StandardCharsets.UTF_8.name())) { while (scanner.hasNextLine()) { System.out.println(scanner.nextLine()); } } } }
Source:
private void loggingAutoCommitHelper() throws SQLException { Connection conn = this.getConnection(); if(stmt.getUpdateOperation().isMutation() && conn.getAutoCommit()){ phoenixMetricsLog.logWriteMetricsfoForMutationsSinceLastReset( PhoenixRuntime.getWriteMetricInfoForMutationsSinceLastReset(conn)); phoenixMetricsLog.logReadMetricInfoForMutationsSinceLastReset( PhoenixRuntime.getReadMetricInfoForMutationsSinceLastReset(conn)); PhoenixRuntime.resetMetrics(conn); } return; }

Target:
private void loggingAutoCommitHelper() throws SQLException { if(conn.getAutoCommit() && (conn instanceof LoggingPhoenixConnection)) { ((LoggingPhoenixConnection)conn).loggingMetricsHelper(); } }
Source:
public void getGeneratedKeysWithNoAutoIncTest() throws DatabaseEngineException { final DbEntity entity = dbEntity() .name("TEST") .addColumn("COL1", STRING) .addColumn("COL2", STRING) .pkFields(ImmutableSet.of("COL1", "COL2")) .build(); this.engine.addEntity(entity); final EntityEntry ee = entry() .set("COL1", "VAL1") .set("COL2", "VAL2") .build(); Assertions.assertThat(this.engine.persist("TEST", ee)) .as("The auto generated value should be null!") .isNull(); }

Target:
public void getGeneratedKeysWithNoAutoIncTest() throws DatabaseEngineException { final DbEntity entity = dbEntity() .name("TEST") .addColumn("COL1", STRING) .addColumn("COL2", STRING) .pkFields(ImmutableSet.of("COL1", "COL2")) .build(); this.engine.addEntity(entity); final EntityEntry ee = entry() .set("COL1", "VAL1") .set("COL2", "VAL2") .build(); assertThat(this.engine.persist("TEST", ee)) .as("The auto generated value should be null!") .isNull(); }
Source:
private Publisher<Link> linksFetcher(DataFetchingEnvironment env) { return subscriber -> { sendData(subscriber, 0); }; }

Target:
private Publisher<Link> linksFetcher(DataFetchingEnvironment env) { return Flowable.fromIterable(links) .delay(1, TimeUnit.SECONDS); }
Source:
public static String unquoteSingleQuotes(String s) { if (s.length() >= 2) { if (s.charAt(0) == '\'' && s.charAt(s.length() - 1) == '\'') { return s.substring(1, s.length() - 1); } } return s; }

Target:
public static String unquoteSingleQuotes(String s) { return unquote(s, '\''); }
Source:
public void testNPEOnMutableGlobal() throws Exception { KieSession ksession = session.getStateful(); List<String> context = new ArrayList<String>(); ksession.setGlobal("context", context); FactHandle b = ksession.insert( new Message( "b" ) ); ksession.delete(b); int fired = ksession.fireAllRules(1); Assertions.assertThat(0).isEqualTo(fired); ksession.dispose(); }

Target:
public void testNPEOnMutableGlobal() throws Exception { KieSession ksession = session.getStateful(); List<String> context = new ArrayList<String>(); ksession.setGlobal("context", context); ksession.setGlobal("LOGGER", LOGGER); FactHandle b = ksession.insert( new Message( "b" ) ); ksession.delete(b); int fired = ksession.fireAllRules(1); Assertions.assertThat(fired).isEqualTo(0); ksession.dispose(); }
Source:
public StreamDeployer(ZooKeeperConnection zkConnection, StreamDefinitionRepository repository, StreamRepository streamRepository, XDParser parser) { super(zkConnection, repository, streamRepository, parser, stream); this.zkConnection = zkConnection; this.parser = parser; updateModuleDefinitions(); }

Target:
public StreamDeployer(ZooKeeperConnection zkConnection, StreamDefinitionRepository repository, StreamRepository streamRepository, XDParser parser) { super(zkConnection, repository, streamRepository, parser, stream); this.zkConnection = zkConnection; this.parser = parser; }
Source:
public Status getStatus() { synchronized (LOCK) { if (cachedStatus != null && cachedStatus.getTimeUTC() != null) { long lastUpdateTimeSkew = System.currentTimeMillis() - cachedStatus.getTimeUTC().getTime(); if (lastUpdateTimeSkew <= STATUS_CACHE_TTL) { log.debug("Returning cached status. Last Update Date: {}, Age: {}", cachedStatus.getTimeUTC(), lastUpdateTimeSkew); return cachedStatus; } log.debug("Cache existed but had expired. Date: {}, Age: {}ms", cachedStatus.getTimeUTC(), lastUpdateTimeSkew); } reset(); } return null; }

Target:
public Status getStatus() { synchronized (LOCK) { if (cachedStatus != null && cachedStatus.getTimeUTC() != null) { long lastUpdateTimeSkew = System.currentTimeMillis() - cachedStatus.getTimeUTC().getTime(); if (lastUpdateTimeSkew <= STATUS_CACHE_TTL) { log.debug("Returning cached status. Last Update Date: {}, Age: {}ms", cachedStatus.getTimeUTC(), lastUpdateTimeSkew); return cachedStatus; } log.debug("Cache existed but had expired. Date: {}, Age: {}ms", cachedStatus.getTimeUTC(), lastUpdateTimeSkew); } reset(); } return null; }
Source:
public Charset charset() { return (this.encoding != null) ? this.encoding : Util.UTF_8; }

Target:
public Charset charset() { return this.encoding; }
Source:
private void process(OpenGuiMessage msg) { EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity(); Object owner = msg.instance.getOwner(player.worldObj, player); if(owner == null) return; Object gui = msg.instance.clientElement(player.worldObj, player); FMLClientHandler.instance().showGuiScreen(gui); player.openContainer.windowId = msg.identifier; }

Target:
private void process(OpenGuiMessage msg) { EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity(); Object gui = msg.provider.clientElement(player.worldObj, player); FMLClientHandler.instance().showGuiScreen(gui); player.openContainer.windowId = msg.windowID; }
Source:
public static @NotNull IReferencePoint create(@NotNull Module module) { IPath path = IntelliJPathImpl.fromString(module.getName()); return new ReferencePointImpl(path); }

Target:
public static IReferencePoint create(@NotNull Module module) { IPath path = IntelliJPathImpl.fromString(module.getModuleFilePath()); return new ReferencePointImpl(path); }
Source:
private void writeAllFields(MessageOrBuilder pb) { Map<Descriptors.FieldDescriptor, Object> changedPbFields = pb.getAllFields(); for (Map.Entry<Descriptors.FieldDescriptor, Object> entry : changedPbFields.entrySet()) { Descriptors.FieldDescriptor fieldDescriptor = entry.getKey(); if(fieldDescriptor.isExtension()) { continue; } int fieldIndex = fieldDescriptor.getIndex(); fieldWriters[fieldIndex].writeField(entry.getValue()); } }

Target:
private void writeAllFields(MessageOrBuilder pb) { Map<Descriptors.FieldDescriptor, Object> changedPbFields = pb.getAllFields(); for (Map.Entry<Descriptors.FieldDescriptor, Object> entry : changedPbFields.entrySet()) { Descriptors.FieldDescriptor fieldDescriptor = entry.getKey(); if(fieldDescriptor.isExtension()) { throw new UnsupportedOperationException( "Cannot convert Protobuf message with extension field(s)"); } int fieldIndex = fieldDescriptor.getIndex(); fieldWriters[fieldIndex].writeField(entry.getValue()); } }
Source:
public void testFindFirstInet4Addr() throws HeliosDeploymentException { InterfaceAddress ifaceAddr0 = mock(InterfaceAddress.class); InterfaceAddress ifaceAddr1 = mock(InterfaceAddress.class); InterfaceAddress ifaceAddr2 = mock(InterfaceAddress.class); InterfaceAddress ifaceAddr3 = mock(InterfaceAddress.class); InetAddress inetAddr0 = mock(InetAddress.class); InetAddress inetAddr1 = mock(InetAddress.class); InetAddress inetAddr2 = mock(InetAddress.class); InetAddress inetAddr3 = mock(InetAddress.class); when(inetAddr0.toString()).thenReturn("/fe80:0:0:0:0:0:0:1%lo0"); when(inetAddr1.toString()).thenReturn("/0:0:0:0:0:0:0:1"); when(inetAddr2.toString()).thenReturn("/127u0.0.1"); when(inetAddr3.toString()).thenReturn("/10.01.23.45"); when(ifaceAddr0.getAddress()).thenReturn(inetAddr0); when(ifaceAddr1.getAddress()).thenReturn(inetAddr1); when(ifaceAddr2.getAddress()).thenReturn(inetAddr2); when(ifaceAddr3.getAddress()).thenReturn(inetAddr3); List addrs = new ArrayList<InterfaceAddress>(); addrs.add(ifaceAddr0); addrs.add(ifaceAddr1); addrs.add(ifaceAddr2); addrs.add(ifaceAddr3); assertEquals("10.01.23.45", findFirstInet4Addr(addrs)); }

Target:
public void testFindFirstInet4Addr() throws HeliosDeploymentException { List addrs = new ArrayList<InetAddress>(); addrs.add(InetAddresses.forString("fe80:0:0:0:0:0:0:1")); addrs.add(InetAddresses.forString("0:0:0:0:0:0:0:1")); addrs.add(InetAddresses.forString("127.0.0.1")); addrs.add(InetAddresses.forString("10.12.34.56")); addrs.add(InetAddresses.forString("10.98.76.54")); assertEquals("10.12.34.56", findFirstInet4Addr(addrs)); }
Source:
public boolean visit(MethodInvocation methodInvocation) { List<?> arguments= methodInvocation.arguments(); if (!arguments.isEmpty()) { IMethodBinding methodBinding= methodInvocation.resolveMethodBinding(); IMethod method = resolveMethodBinding(methodBinding); collectParameterNamesCodeMinings(method, arguments, methodBinding.isVarargs()); } return super.visit(methodInvocation); }

Target:
public boolean visit(MethodInvocation methodInvocation) { List<?> arguments= methodInvocation.arguments(); if (!arguments.isEmpty()) { IMethodBinding methodBinding= methodInvocation.resolveMethodBinding(); if (methodBinding != null) { IMethod method = resolveMethodBinding(methodBinding); collectParameterNamesCodeMinings(method, arguments, methodBinding.isVarargs()); } } return super.visit(methodInvocation); }
Source:
public void should_Set_PWA_Offline_Resources() throws Exception { ClassFinder classFinder = new DefaultClassFinder(new HashSet<>( new ArrayList<>(Arrays.asList(AppShellWithPwa.class)))); Builder builder = new Builder(classFinder, new File(userDir)) .withFlowResourcesFolder( new File(userDir, DEAULT_FLOW_RESOURCES_FOLDER)) .withWebpack(new File(userDir, TARGET + "classes"), WEBPACK_CONFIG, WEBPACK_GENERATED) .enablePackagesUpdate(false).enableImportsUpdate(false) .withEmbeddableWebComponents(false); builder.build().execute(); String webpackGeneratedContent = Files .lines(new File(userDir, WEBPACK_GENERATED).toPath()) .collect(Collectors.joining("\n")); Assert.assertTrue("should contain pwa.js pwa.css offlineResources", webpackGeneratedContent.contains("const offlineResources = " + "[\"pwa.js\",\"pwa.css\"];")); }

Target:
public void should_Set_PWA_Offline_Resources() throws Exception { ClassFinder classFinder = new DefaultClassFinder(new HashSet<>( new ArrayList<>(Arrays.asList(AppShellWithPwa.class)))); Builder builder = new Builder(classFinder, new File(userDir)) .withFlowResourcesFolder( new File(userDir, DEFAULT_FLOW_RESOURCES_FOLDER)) .withWebpack(new File(userDir, TARGET + "classes"), WEBPACK_CONFIG, WEBPACK_GENERATED) .enablePackagesUpdate(false).enableImportsUpdate(false) .withEmbeddableWebComponents(false); builder.build().execute(); String webpackGeneratedContent = Files .lines(new File(userDir, WEBPACK_GENERATED).toPath()) .collect(Collectors.joining("\n")); Assert.assertTrue("should contain pwa.js pwa.css offlineResources", webpackGeneratedContent.contains("const offlineResources = " + "[\"pwa.js\",\"pwa.css\"];")); }
Source:
synchronized private static void init() { if (requiresUserPrivacyConsent()) { OneSignal.Log(LOG_LEVEL.WARN, "OneSignal SDK initialization delayed, user privacy consent is set to required for this application."); delayedInitParams = new DelayedConsentInitializationParameters(appContext, googleProjectNumber, appId, notificationWillShowInForegroundHandler, notificationOpenedHandler); appId = null; return; } if (!isGoogleProjectNumberRemote()) googleProjectNumber = ""; deviceType = osUtils.getDeviceType(); subscribableStatus = osUtils.initializationChecker(appContext, deviceType, appId); if (isSubscriptionStatusUninitializable()) return; if (initDone) { if (notificationOpenedHandler != null) fireCallbackForOpenedNotifications(); return; } saveFilterOtherGCMReceivers(mFilterOtherGCMReceivers); handleActivityLifecycleHandler(appContext); OneSignalStateSynchronizer.initUserState(); handleAmazonPurchase(); handleAppIdChange(); OSPermissionChangedInternalObserver.handleInternalChanges(getCurrentPermissionState(appContext)); doSessionInit(); if (notificationOpenedHandler != null) fireCallbackForOpenedNotifications(); if (TrackGooglePurchase.CanTrack(appContext)) trackGooglePurchase = new TrackGooglePurchase(appContext); if (TrackFirebaseAnalytics.CanTrack()) trackFirebaseAnalytics = new TrackFirebaseAnalytics(appContext); PushRegistratorFCM.disableFirebaseInstanceIdService(appContext); initDone = true; outcomeEventsController.sendSavedOutcomes(); startPendingTasks(); }

Target:
synchronized private static void init() { if (requiresUserPrivacyConsent()) { OneSignal.Log(LOG_LEVEL.WARN, "OneSignal SDK initialization delayed, user privacy consent is set to required for this application."); delayedInitParams = new DelayedConsentInitializationParameters(appContext, googleProjectNumber, appId, notificationWillShowInForegroundHandler, notificationOpenedHandler); appId = null; return; } deviceType = osUtils.getDeviceType(); subscribableStatus = osUtils.initializationChecker(appContext, deviceType, appId); if (isSubscriptionStatusUninitializable()) return; if (initDone) { if (notificationOpenedHandler != null) fireCallbackForOpenedNotifications(); return; } saveFilterOtherGCMReceivers(mFilterOtherGCMReceivers); handleActivityLifecycleHandler(appContext); OneSignalStateSynchronizer.initUserState(); handleAmazonPurchase(); handleAppIdChange(); OSPermissionChangedInternalObserver.handleInternalChanges(getCurrentPermissionState(appContext)); doSessionInit(); if (notificationOpenedHandler != null) fireCallbackForOpenedNotifications(); if (TrackGooglePurchase.CanTrack(appContext)) trackGooglePurchase = new TrackGooglePurchase(appContext); if (TrackFirebaseAnalytics.CanTrack()) trackFirebaseAnalytics = new TrackFirebaseAnalytics(appContext); PushRegistratorFCM.disableFirebaseInstanceIdService(appContext); initDone = true; outcomeEventsController.sendSavedOutcomes(); startPendingTasks(); }
Source:
public void create() { context = new ContextImpl(); context.put(SolApplication.class, this); worldConfig = new WorldConfig(); isMobile = Gdx.app.getType() == Application.ApplicationType.Android || Gdx.app.getType() == Application.ApplicationType.iOS; if (isMobile) { DebugOptions.read(null); } options = new GameOptions(isMobile(), null); logger.info("\n\n ------------------------------------------------------------ \n"); moduleManager.printAvailableModules(); musicManager = new OggMusicManager(options); soundManager = new OggSoundManager(context); inputManager = new SolInputManager(soundManager, context); ; musicManager.playMusic(OggMusicManager.MENU_MUSIC_SET, options); displayDimensions = new DisplayDimensions(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); commonDrawer = new CommonDrawer(); uiDrawer = new UiDrawer(commonDrawer); layouts = new SolLayouts(); menuScreens = new MenuScreens(layouts, isMobile(), options); menuBackgroundManager = new MenuBackgroundManager(displayDimensions); inputManager.setScreen(this, menuScreens.main); }

Target:
public void create() { context = new ContextImpl(); context.put(SolApplication.class, this); worldConfig = new WorldConfig(); isMobile = Gdx.app.getType() == Application.ApplicationType.Android || Gdx.app.getType() == Application.ApplicationType.iOS; if (isMobile) { DebugOptions.read(null); } options = new GameOptions(isMobile(), null); logger.info("\n\n ------------------------------------------------------------ \n"); moduleManager.printAvailableModules(); musicManager = new OggMusicManager(options); soundManager = new OggSoundManager(context); inputManager = new SolInputManager(soundManager, context); musicManager.playMusic(OggMusicManager.MENU_MUSIC_SET, options); displayDimensions = new DisplayDimensions(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); commonDrawer = new CommonDrawer(); uiDrawer = new UiDrawer(commonDrawer); layouts = new SolLayouts(); menuBackgroundManager = new MenuBackgroundManager(displayDimensions); menuScreens = new MenuScreens(layouts, isMobile(), options); inputManager.setScreen(this, menuScreens.main); }
Source:
private static <T> T getService(Class<T> serviceClass) { final Bundle bundle = FrameworkUtil.getBundle(ViewModelMigratorUtil.class); final BundleContext bundleContext = bundle.getBundleContext(); final ServiceReference<T> serviceReference = bundleContext.getServiceReference(serviceClass); if (serviceReference == null) { return null; } final Object service = bundleContext.getService(serviceReference); bundleContext.ungetService(serviceReference); return serviceClass.cast(service); }

Target:
private static <T> T getService(Class<T> serviceClass) { final Bundle bundle = FrameworkUtil.getBundle(ViewModelMigratorUtil.class); final BundleContext bundleContext = bundle.getBundleContext(); final ServiceReference<T> serviceReference = bundleContext.getServiceReference(serviceClass); if (serviceReference == null) { return null; } final T service = bundleContext.getService(serviceReference); bundleContext.ungetService(serviceReference); return service; }