auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static OsObjectSchemaInfo createExpectedObjectSchemaInfo() { OsObjectSchemaInfo info = new OsObjectSchemaInfo("AllTypes");; info.add("columnString", RealmFieldType.STRING, Property.PRIMARY_KEY, Property.INDEXED, !Property.REQUIRED); info.add("columnLong", RealmFieldType.INTEGER, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); info.add("columnFloat", RealmFieldType.FLOAT, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); info.add("columnDouble", RealmFieldType.DOUBLE, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); info.add("columnBoolean", RealmFieldType.BOOLEAN, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); info.add("columnDate", RealmFieldType.DATE, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); info.add("columnBinary", RealmFieldType.BINARY, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); info.add("columnObject", RealmFieldType.OBJECT, "AllTypes"); info.add("columnRealmList", RealmFieldType.LIST, "AllTypes"); return info; }

Target:
private static OsObjectSchemaInfo createExpectedObjectSchemaInfo() { OsObjectSchemaInfo.Builder builder = new OsObjectSchemaInfo.Builder("AllTypes"); builder.addProperty("columnString", RealmFieldType.STRING, Property.PRIMARY_KEY, Property.INDEXED, !Property.REQUIRED); builder.addProperty("columnLong", RealmFieldType.INTEGER, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); builder.addProperty("columnFloat", RealmFieldType.FLOAT, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); builder.addProperty("columnDouble", RealmFieldType.DOUBLE, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); builder.addProperty("columnBoolean", RealmFieldType.BOOLEAN, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); builder.addProperty("columnDate", RealmFieldType.DATE, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); builder.addProperty("columnBinary", RealmFieldType.BINARY, !Property.PRIMARY_KEY, !Property.INDEXED, Property.REQUIRED); builder.addLinkedProperty("columnObject", RealmFieldType.OBJECT, "AllTypes"); builder.addLinkedProperty("columnRealmList", RealmFieldType.LIST, "AllTypes"); return builder.build(); }
Source:
public void perform(Run build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException { TestResultAction action = parseAndAttach(this, null, build, workspace, launcher, listener); if (action != null && action.getResult().getFailCount() > 0) build.setResult(Result.UNSTABLE); listener.getLogger().println(Messages.JUnitResultArchiver_ChangeState("UNSTABLE")); }

Target:
public void perform(Run build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException { TestResultAction action = parseAndAttach(this, null, build, workspace, launcher, listener); if ((action != null) && (action.getResult().getFailCount() > 0)) build.setResult(Result.UNSTABLE); listener.getLogger().println(Messages.JUnitResultArchiver_ChangeState("UNSTABLE")); }
Source:
public void clearContainer(String container, ListContainerOptions options) { filesystemContainerNameValidator.validate(container); String optsPrefix; optsPrefix = options.getDir() == null ? options.getPrefix() : options.getDir(); optsPrefix = optsPrefix == null ? "" : optsPrefix; String normalizedOptsPath = normalize(optsPrefix); String basePath = buildPathStartingFromBaseDir(container, normalizedOptsPath); filesystemBlobKeyValidator.validate(basePath); try { File object = new File(basePath); if (object.isFile()) { delete(object); } else if (object.isDirectory() & (optsPrefix.endsWith(File.separator) | isNullOrEmpty(optsPrefix))) { File containerFile = openFolder(container + File.separator + normalizedOptsPath); File[] children = containerFile.listFiles(); if (null != children) { for (File child : children) { if (options.isRecursive()) { Utils.deleteRecursively(child); } else { if (child.isFile()) { Utils.delete(child); } } } } if (!isNullOrEmpty(optsPrefix)) { if (options.isRecursive()) { deleteDirectory(container, optsPrefix); } removeDirectoriesTreeOfBlobKey(container, optsPrefix); } } } catch (IOException e) { logger.error(e, "An error occurred while clearing container %s", container); Throwables.propagate(e); } }

Target:
public void clearContainer(String container, ListContainerOptions options) { filesystemContainerNameValidator.validate(container); checkArgument((options.getDir() == null) || (options.getPrefix() == null), "cannot specify both directory and prefix"); String optsPrefix; optsPrefix = options.getDir() == null ? options.getPrefix() : options.getDir(); optsPrefix = Strings.nullToEmpty(optsPrefix); String normalizedOptsPath = normalize(optsPrefix); String basePath = buildPathStartingFromBaseDir(container, normalizedOptsPath); filesystemBlobKeyValidator.validate(basePath); try { File object = new File(basePath); if (object.isFile()) { delete(object); } else if (object.isDirectory() && (optsPrefix.endsWith(File.separator) || isNullOrEmpty(optsPrefix))) { File containerFile = openFolder(container + File.separator + normalizedOptsPath); File[] children = containerFile.listFiles(); if (null != children) { for (File child : children) { if (options.isRecursive()) { Utils.deleteRecursively(child); } else { if (child.isFile()) { Utils.delete(child); } } } } if (!optsPrefix.isEmpty()) { if (options.isRecursive()) { deleteDirectory(container, optsPrefix); } removeDirectoriesTreeOfBlobKey(container, optsPrefix); } } } catch (IOException e) { logger.error(e, "An error occurred while clearing container %s", container); Throwables.propagate(e); } }
Source:
public void addChildrenCounts(List<BriefObjectMetadata> containers, AccessGroupSet principals, String countKey, SolrQuery baseQuery) { Assert.notNull(containers); if (containers.size() == 0) { return; } log.debug("Adding child counts of type to result list", countKey); SolrQuery solrQuery; if (baseQuery == null) { solrQuery = createBaseQuery(principals); } else { solrQuery = baseQuery.getCopy(); solrQuery.setRows(0); if (solrQuery.getFacetFields() != null) { for (String facetField : solrQuery.getFacetFields()) { solrQuery.removeFacetField(facetField); } } } String ancestorPathField = solrField(ANCESTOR_PATH); solrQuery.setFacetMinCount(1); solrQuery.addFacetField(ancestorPathField); solrQuery.add("f." + ancestorPathField + ".facet.limit", Integer.toString(Integer.MAX_VALUE)); solrQuery.setFacetSort("index"); try { QueryResponse queryResponse = this.executeQuery(solrQuery); assignChildrenCounts(queryResponse.getFacetField(ancestorPathField), containers, countKey); } catch (SolrServerException e) { throw new SolrRuntimeException(e); } }

Target:
public void addChildrenCounts(List<BriefObjectMetadata> containers, AccessGroupSet principals, String countKey, SolrQuery baseQuery) { Assert.notNull(containers); if (containers.size() == 0) { return; } log.debug("Adding child counts of type to result list", countKey); SolrQuery solrQuery; if (baseQuery == null) { solrQuery = createBaseQuery(principals); } else { solrQuery = baseQuery.getCopy(); solrQuery.setRows(0); String[] facetFields = solrQuery.getFacetFields(); if (facetFields != null) { for (String facetField : facetFields) { solrQuery.removeFacetField(facetField); } } } String ancestorPathField = solrField(ANCESTOR_PATH); solrQuery.setFacetMinCount(1); solrQuery.addFacetField(ancestorPathField); solrQuery.add("f." + ancestorPathField + ".facet.limit", Integer.toString(Integer.MAX_VALUE)); solrQuery.setFacetSort("index"); try { QueryResponse queryResponse = this.executeQuery(solrQuery); assignChildrenCounts(queryResponse.getFacetField(ancestorPathField), containers, countKey); } catch (SolrServerException e) { throw new SolrRuntimeException(e); } }
Source:
public String getOffsetsStorage() { return getStringLastValue("kafka.offsets.storage", "zookeeper"); }

Target:
public String getOffsetsStorage() { return getString("kafka.offsets.storage"); }
Source:
public void setLives(int l) { lives = l; addToLog("The player's current amount of lives is now: " + lives); }

Target:
public void setLives(int l) { lives = l; addToLog("[PLAYER]\t Player's current amount of lives is now: " + lives); }
Source:
private void initViewModel() { mFloatingActionButton = findViewById(R.id.fab_button); mViewModel = ViewModelProviders.of(this, mViewModelFactory).get(WPMainActivityViewModel.class); if (BuildConfig.INFORMATION_ARCHITECTURE_AVAILABLE) { mViewModel.getShowMainActionFab().observe(this, shouldShow -> { if (shouldShow) { mFloatingActionButton.show(); } else { mFloatingActionButton.hide(); } }); mViewModel.getCreateAction().observe(this, createAction -> { switch (createAction) { case CREATE_NEW_POST: handleNewPostAction(PagePostCreationSourcesDetail.POST_FROM_MY_SITE); break; case CREATE_NEW_PAGE: handleNewPageAction(PagePostCreationSourcesDetail.PAGE_FROM_MY_SITE); break; } }); mFloatingActionButton.setOnClickListener(v -> { MainBottomSheetFragment bottomSheet = new MainBottomSheetFragment(); bottomSheet.show(getSupportFragmentManager(), MAIN_BOTTOM_SHEET_TAG); mViewModel.setIsBottomSheetShowing(true); }); mViewModel.isBottomSheetShowing().observe(this, isShowing -> { if (!isShowing) { FragmentManager fm = getSupportFragmentManager(); if (fm != null) { MainBottomSheetFragment bottomSheet = (MainBottomSheetFragment) fm.findFragmentByTag(MAIN_BOTTOM_SHEET_TAG); if (bottomSheet != null) { bottomSheet.dismiss(); } } } }); } mViewModel.start(mBottomNav.getCurrentSelectedPage() == PageType.MY_SITE); }

Target:
private void initViewModel() { mFloatingActionButton = findViewById(R.id.fab_button); mViewModel = ViewModelProviders.of(this, mViewModelFactory).get(WPMainActivityViewModel.class); if (BuildConfig.INFORMATION_ARCHITECTURE_AVAILABLE) { mViewModel.getShowMainActionFab().observe(this, shouldShow -> { if (shouldShow) { mFloatingActionButton.show(); } else { mFloatingActionButton.hide(); } }); mViewModel.getCreateAction().observe(this, createAction -> { switch (createAction) { case CREATE_NEW_POST: handleNewPostAction(PagePostCreationSourcesDetail.POST_FROM_MY_SITE); break; case CREATE_NEW_PAGE: handleNewPageAction(PagePostCreationSourcesDetail.PAGE_FROM_MY_SITE); break; } }); mFloatingActionButton.setOnClickListener(v -> { mViewModel.setIsBottomSheetShowing(true); }); mViewModel.isBottomSheetShowing().observe(this, isShowing -> { FragmentManager fm = getSupportFragmentManager(); if (fm != null) { MainBottomSheetFragment bottomSheet = (MainBottomSheetFragment) fm.findFragmentByTag(MAIN_BOTTOM_SHEET_TAG); if (isShowing && bottomSheet == null) { bottomSheet = new MainBottomSheetFragment(); bottomSheet.show(getSupportFragmentManager(), MAIN_BOTTOM_SHEET_TAG); } else if (!isShowing && bottomSheet != null) { bottomSheet.dismiss(); } } }); } mViewModel.start(mBottomNav.getCurrentSelectedPage() == PageType.MY_SITE); }
Source:
protected boolean canDoAction() { boolean returnValue = true; StorageServerConnections paramConnection = getConnection(); if (paramConnection.getstorage_type() == StorageType.NFS && !new NfsMountPointConstraint().isValid(paramConnection.getconnection(), null)) { returnValue = false; addCanDoActionMessage(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_INVALID); } if (paramConnection.getstorage_type() == StorageType.POSIXFS && (StringUtils.isEmpty(paramConnection.getVfsType()))) { return failCanDoAction(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE); } if(isConnWithSameDetailsExists()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS); } if (getParameters().getVdsId().equals(Guid.Empty)) { returnValue = InitializeVds(); } else if (getVds() == null) { addCanDoActionMessage(VdcBllMessages.VDS_INVALID_SERVER_ID); returnValue = false; } else if (getVds().getStatus() != VDSStatus.Up) { addCanDoActionMessage(VdcBllMessages.VDS_ADD_STORAGE_SERVER_STATUS_MUST_BE_UP); returnValue = false; } return returnValue; }

Target:
protected boolean canDoAction() { boolean returnValue = true; StorageServerConnections paramConnection = getConnection(); if (StringUtils.isNotEmpty(paramConnection.getid())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY); } if (paramConnection.getstorage_type() == StorageType.NFS && !new NfsMountPointConstraint().isValid(paramConnection.getconnection(), null)) { returnValue = false; addCanDoActionMessage(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_INVALID); } if (paramConnection.getstorage_type() == StorageType.POSIXFS && (StringUtils.isEmpty(paramConnection.getVfsType()))) { return failCanDoAction(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE); } if (isConnWithSameDetailsExists()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS); } if (getParameters().getVdsId().equals(Guid.Empty)) { returnValue = InitializeVds(); } else if (getVds() == null) { addCanDoActionMessage(VdcBllMessages.VDS_INVALID_SERVER_ID); returnValue = false; } else if (getVds().getStatus() != VDSStatus.Up) { addCanDoActionMessage(VdcBllMessages.VDS_ADD_STORAGE_SERVER_STATUS_MUST_BE_UP); returnValue = false; } return returnValue; }
Source:
private SerialNumberObject convert(ResultSet result) throws SQLException { SerialNumberObject serialNumber = new SerialNumberObject(); serialNumber .setId(result.getLong(SerialNumberEnum.ID)) .setProjectId(result.getLong(SerialNumberEnum.PROJECT_ID)) .setReleaseId(result.getLong(SerialNumberEnum.RELEASE)) .setSprintId(result.getLong(SerialNumberEnum.SPRINT)) .setStoryId(result.getLong(SerialNumberEnum.STORY)) .setTaskId(result.getLong(SerialNumberEnum.TASK)) .setUnplannedId(result.getLong(SerialNumberEnum.UNPLANNED)) .setRetrospectiveId( result.getLong(SerialNumberEnum.RETROSPECTIVE)); ; return serialNumber; }

Target:
private SerialNumberObject convert(ResultSet result) throws SQLException { SerialNumberObject serialNumber = new SerialNumberObject(); serialNumber .setId(result.getLong(SerialNumberEnum.ID)) .setProjectId(result.getLong(SerialNumberEnum.PROJECT_ID)) .setReleaseId(result.getLong(SerialNumberEnum.RELEASE)) .setSprintId(result.getLong(SerialNumberEnum.SPRINT)) .setStoryId(result.getLong(SerialNumberEnum.STORY)) .setTaskId(result.getLong(SerialNumberEnum.TASK)) .setUnplannedId(result.getLong(SerialNumberEnum.UNPLANNED)) .setRetrospectiveId( result.getLong(SerialNumberEnum.RETROSPECTIVE)); return serialNumber; }
Source:
public synchronized void clear() { for (int i = 0; i < this.fPageTable.length; i++) { final Chunk chunk = this.fPageTable[i]; if (chunk == null) { continue; } chunk.fCacheIndex = -1; chunk.fDatabase.checkIfChunkReleased(chunk); this.fPageTable[i] = null; } this.fTableIsFull = false; this.fPointer = 0; }

Target:
public synchronized void clear() { for (int i = 0; i < this.fPageTable.length; i++) { Chunk chunk = this.fPageTable[i]; if (chunk == null) { continue; } chunk.fCacheIndex = -1; chunk.fDatabase.checkIfChunkReleased(chunk); this.fPageTable[i] = null; } this.fTableIsFull = false; this.fPointer = 0; }
Source:
protected String getClassName(EntityType model) { Type type = conf.getTypeMappings().getPathType(model, model, true); String packageName = type.getPackageName(); return !packageName.isEmpty() ? (packageName + "." + type.getSimpleName()) : type.getSimpleName(); }

Target:
protected String getClassName(EntityType model) { Type type = conf.getTypeMappings().getPathType(model, model, true); String packageName = type.getPackageName(); return packageName.isEmpty() ? type.getSimpleName() : (packageName + "." + type.getSimpleName()); }
Source:
protected org.eclipse.jetty.webapp.Configuration[] getWebAppContextConfigurations(WebAppContext webAppContext, ServletContextInitializer... initializers) { webAppContextCustomizers.ifPresent(consumers -> consumers.forEach(c -> c.accept(webAppContext))); webAppContext.setErrorHandler(new ConservedHeadersJettyErrorHandler(webAppContext.getErrorHandler())); return super.getWebAppContextConfigurations(webAppContext, initializers); }

Target:
protected org.eclipse.jetty.webapp.Configuration[] getWebAppContextConfigurations(WebAppContext webAppContext, ServletContextInitializer... initializers) { webAppContextCustomizers.ifPresent(consumers -> consumers.forEach(c -> c.accept(webAppContext))); webAppContext.setErrorHandler(new ConservedHeadersJettyErrorHandler(webAppContext.getErrorHandler(), showStacks)); return super.getWebAppContextConfigurations(webAppContext, initializers); }
Source:
public int compareTo(DfsPackDescription b) { PackSource as = getPackSource(); PackSource bs = b.getPackSource(); if (as != null && bs != null) { int cmp = as.category - bs.category; if (cmp != 0) return cmp; } if (as != null && as.equals(bs) && isGC(as)) { int cmp = Long.signum(getFileSize(PACK) - b.getFileSize(PACK)); if (cmp != 0) { return cmp; } } int cmp = Long.signum(b.getLastModified() - getLastModified()); if (cmp != 0) return cmp; return Long.signum(getObjectCount() - b.getObjectCount()); }

Target:
public int compareTo(DfsPackDescription b) { PackSource as = getPackSource(); PackSource bs = b.getPackSource(); if (as != null && bs != null) { int cmp = as.category - bs.category; if (cmp != 0) return cmp; } if (as != null && as == bs && isGC(as)) { int cmp = Long.signum(getFileSize(PACK) - b.getFileSize(PACK)); if (cmp != 0) { return cmp; } } int cmp = Long.signum(b.getLastModified() - getLastModified()); if (cmp != 0) return cmp; return Long.signum(getObjectCount() - b.getObjectCount()); }
Source:
public void setUp() { injector = Guice.createInjector(new UnitTestModule()); mockRobotIO = injector.getInstance(MockRobotIO.class); HLUsageReporting.SetImplementation(new MockHLUsageReporting()); Timer.SetImplementation(injector.getInstance(MockTimer.class)); this.mockRobotState = injector.getInstance(MockRobotState.class); RobotState.SetImplementation(mockRobotState); propertyManager = injector.getInstance(PropertyManager.class); SafeRobotAssertionManager assertionMan = injector.getInstance(SafeRobotAssertionManager.class); assertionMan.setExceptionsEnabled(true); DOMConfigurator.configure("lib/log4jConfig/log4j4unitTesting.xml"); }

Target:
public void setUp() { injector = Guice.createInjector(new UnitTestModule()); mockRobotIO = injector.getInstance(MockRobotIO.class); HLUsageReporting.SetImplementation(new MockHLUsageReporting()); Timer.SetImplementation(injector.getInstance(MockTimer.class)); this.mockRobotState = injector.getInstance(MockRobotState.class); RobotState.SetImplementation(mockRobotState); propertyManager = injector.getInstance(PropertyManager.class); DOMConfigurator.configure("lib/log4jConfig/log4j4unitTesting.xml"); }
Source:
public void moveSelectedPathToRootPath() { fVariablesTreeContentProvider.addPath(new Path(ID_GROUP1)); fVariablesTreeContentProvider.addPath(new Path(ID_GROUP1_SUBGROUP1)); fVariablesTreeContentProvider.moveSelectedPath(new Path("/subgroup1"), new Path("/group1/subgroup1")); fVariablesTreeContentProvider.getElements(new HashSet<IPath>()); final Object[] actualAdditionalPathRoot = fVariablesTreeContentProvider.getChildren(new Path("")); assertEquals(2, actualAdditionalPathRoot.length); assertEquals(new Path("group1"), actualAdditionalPathRoot[0]); assertEquals(new Path("subgroup1"), actualAdditionalPathRoot[1]); assertTrue(!fVariablesTreeContentProvider.hasChildren(new Path(ID_GROUP1).makeRelative())); }

Target:
public void moveSelectedPathToRootPath() { fVariablesTreeContentProvider.addPath(new Path(ID_GROUP1)); fVariablesTreeContentProvider.addPath(new Path(ID_GROUP1_SUBGROUP1)); fVariablesTreeContentProvider.moveSelectedPath(new Path("/subgroup1"), new Path("/group1/subgroup1")); fVariablesTreeContentProvider.getElements(new HashSet<IPath>()); final Object[] actualAdditionalPathRoot = fVariablesTreeContentProvider.getChildren(new Path("")); assertEquals(2, actualAdditionalPathRoot.length); assertEquals(new Path("group1"), actualAdditionalPathRoot[0]); assertEquals(new Path("subgroup1"), actualAdditionalPathRoot[1]); assertFalse(fVariablesTreeContentProvider.hasChildren(new Path(ID_GROUP1).makeRelative())); }
Source:
protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception { final int length = in.readableBytes(); final int idx = in.readerIndex(); final byte[] input; final int inputPtr; if (in.hasArray()) { input = in.array(); inputPtr = in.arrayOffset() + idx; } else { input = recycler.allocInputBuffer(length); in.getBytes(idx, input, 0, length); inputPtr = 0; } final int maxOutputLength = LZFEncoder.estimateMaxWorkspaceSize(length); out.ensureWritable(maxOutputLength); final byte[] output = out.array(); final int outputPtr = out.arrayOffset() + out.writerIndex(); int outputLength; if (length >= compressThreshold) { outputLength = encodeCompress(input, inputPtr, length, output, outputPtr); } else { outputLength = encodeNonCompress(input, inputPtr, length, output, outputPtr); } out.writerIndex(out.writerIndex() + outputLength); in.skipBytes(length); if (!in.hasArray()) { recycler.releaseInputBuffer(input); } }

Target:
protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception { final int length = in.readableBytes(); final int idx = in.readerIndex(); final byte[] input; final int inputPtr; if (in.hasArray()) { input = in.array(); inputPtr = in.arrayOffset() + idx; } else { input = recycler.allocInputBuffer(length); in.getBytes(idx, input, 0, length); inputPtr = 0; } final int maxOutputLength = LZFEncoder.estimateMaxWorkspaceSize(length); out.ensureWritable(maxOutputLength); final byte[] output = out.array(); final int outputPtr = out.arrayOffset() + out.writerIndex(); final int outputLength; if (length >= compressThreshold) { outputLength = encodeCompress(input, inputPtr, length, output, outputPtr); } else { outputLength = encodeNonCompress(input, inputPtr, length, output, outputPtr); } out.writerIndex(out.writerIndex() + outputLength); in.skipBytes(length); if (!in.hasArray()) { recycler.releaseInputBuffer(input); } }
Source:
void setUniverseWrapper(UniverseWrapper wrapper) { this.universeWrapper = wrapper; }

Target:
public void setUniverseWrapper(UniverseWrapper wrapper) { this.universeWrapper = wrapper; }
Source:
private void addPublishCache(String tenantId, String triggerId, Set<String> dataIds) { if (!isEmpty(dataIds)) { dataIds.stream().forEach(dataId -> { CacheKey cacheKey = new CacheKey(tenantId, dataId); Set<String> triggers = publishCache.get(cacheKey); Set<String> newTriggers = triggers == null ? new HashSet<>() : new HashSet<>(triggers); newTriggers.add(triggerId); publishCache.put(cacheKey, newTriggers); }); } }

Target:
private void addPublishCache(String tenantId, String triggerId, Set<String> dataIds) { if (!isEmpty(dataIds)) { dataIds.stream().forEach(dataId -> { CacheKey cacheKey = new CacheKey(tenantId, dataId); Set<String> triggerIds = publishCache.get(cacheKey); if (triggerIds == null) { triggerIds = new HashSet<>(); } triggerIds.add(triggerId); publishCache.put(cacheKey, triggerIds); }); } }
Source:
public final void cancel() { logger.info("Cancelling task " + taskId); if (participant != null) { participant.unregisterRunningTask(this); } onCancel(); }

Target:
public final void cancel() { try { logger.info("Cancelling task " + taskId); onCancel(); } finally { if (participant != null) { participant.unregisterRunningTask(this); } else { logger.warn("Task with id: " + taskId + " is not unregistered since the participant is not set"); } } }
Source:
public IModel loadModel(ResourceLocation modelLocation) throws IOException { ResourceLocation file = new ResourceLocation(modelLocation.getResourceDomain(), modelLocation.getResourcePath()); if (!cache.containsKey(file)) { try { IResource resource = null; try { resource = manager.getResource(file); } catch (FileNotFoundException e) { if (modelLocation.getResourcePath().startsWith("models/block/")) resource = manager.getResource(new ResourceLocation(file.getResourceDomain(), "models/item/" + file.getResourcePath().substring("models/block/".length()))); else if (modelLocation.getResourcePath().startsWith("models/item/")) resource = manager.getResource(new ResourceLocation(file.getResourceDomain(), "models/block/" + file.getResourcePath().substring("models/item/".length()))); else throw e; } OBJModel.Parser parser = new OBJModel.Parser(resource, manager); OBJModel model = null; try { model = parser.parse(); } catch (OBJModel.UVsOutOfBoundsException e) { throw e; } finally { cache.put(modelLocation, model); } } catch (IOException e) { throw e; } } OBJModel model = cache.get(file); if (model == null) return ModelLoaderRegistry.getMissingModel(); return model; }

Target:
public IModel loadModel(ResourceLocation modelLocation) throws IOException { ResourceLocation file = new ResourceLocation(modelLocation.getResourceDomain(), modelLocation.getResourcePath()); if (!cache.containsKey(file)) { try { IResource resource = null; try { resource = manager.getResource(file); } catch (FileNotFoundException e) { if (modelLocation.getResourcePath().startsWith("models/block/")) resource = manager.getResource(new ResourceLocation(file.getResourceDomain(), "models/item/" + file.getResourcePath().substring("models/block/".length()))); else if (modelLocation.getResourcePath().startsWith("models/item/")) resource = manager.getResource(new ResourceLocation(file.getResourceDomain(), "models/block/" + file.getResourcePath().substring("models/item/".length()))); else throw e; } OBJModel.Parser parser = new OBJModel.Parser(resource, manager); OBJModel model = null; try { model = parser.parse(); } finally { cache.put(modelLocation, model); } } catch (IOException e) { throw e; } } OBJModel model = cache.get(file); if (model == null) return ModelLoaderRegistry.getMissingModel(); return model; }
Source:
@NonNull @Override public CardType type() { return CardType.ONBOARDING_CUSTOMIZE_FEED; }

Target:
@NonNull @Override public CardType type() { return CardType.ONBOARDING_READING_LIST_SYNC; }
Source:
public int doStartTag() throws JspException { try { JspWriter out = pageContext.getOut(); PageParameters pageParameters = new PageParameters(); if (query != null) { RequestUtils.decodeParameters(query, pageParameters); } CharSequence urlFor = RequestCycle.get().urlFor( (Class<? extends WebPage>) Class.forName(page), pageParameters); out.write(urlFor.toString()); out.flush(); } catch (IOException e) { LOGGER.error("Error while generating url for page " + page, e); } catch (ClassNotFoundException e) { LOGGER.error( "Error while receiving the class with the name" + page, e); } return SKIP_BODY; }

Target:
public int doStartTag() throws JspException { try { JspWriter out = pageContext.getOut(); PageParameters pageParameters = new PageParameters(); if (query != null) { RequestUtils.decodeParameters(query, pageParameters); } Class<Page> resolveClass = WicketObjects.resolveClass(page); CharSequence urlFor = RequestCycle.get().urlFor( resolveClass, pageParameters); out.write(urlFor.toString()); out.flush(); } catch (IOException e) { LOGGER.error("Error while generating url for page " + page, e); throw new JspException("Error while generating url for page ",e); } return SKIP_BODY; }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("TmfLocationArray ["); for (int i = 0; i < fLocations.length; i++) { if (i > 0) { sb.append(", "); } sb.append("[" + fLocations[i] + "," + fRanks[i] + "]"); } sb.append("]"); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName() + " ["); for (int i = 0; i < fLocations.length; i++) { if (i > 0) { sb.append(", "); } sb.append("[location=" + fLocations[i] + ",rank=" + fRanks[i] + "]"); } sb.append("]"); return sb.toString(); }
Source:
public Map<Timestamp, Set<Object>> chronologize(final String key, final long record) { Map<Timestamp, Set<Object>> result = TLinkedHashMap.newTLinkedHashMap( "DateTime", "Value"); for (Timestamp timestamp : audit(key, record).keySet()) { Set<Object> values = fetch(key, record, timestamp); if (!values.isEmpty()) { result.put(timestamp, values); } } return result; }

Target:
public Map<Timestamp, Set<Object>> chronologize(final String key, final long record) { return execute(new Callable<Map<Timestamp, Set<Object>>>() { @Override public Map<Timestamp, Set<Object>> call() throws Exception { Map<Long, Set<TObject>> chronologie = client.chronologize(record, key, creds, transaction); Map<Timestamp, Set<Object>> result = TLinkedHashMap. newTLinkedHashMap("DateTime", "Values"); for (Entry<Long, Set<TObject>> entry : chronologie.entrySet()) { result.put(Timestamp.fromMicros(entry.getKey()), Transformers.transformSet(entry.getValue(), new Function<TObject, Object>() { @Override public Object apply(TObject input) { return Convert.thriftToJava(input); } })); } return result; } }); }
Source:
private void addPresentation(TextPresentation presentation) { StyleRange range = presentation.getDefaultStyleRange(); if (range != null) { range = modelStyleRange2WidgetStyleRange(range); if (range != null) { updateStyle(range); fMinimapTextWidget.setStyleRange(range); } List<StyleRange> ranges = new ArrayList<>(presentation.getDenumerableRanges()); Iterator<StyleRange> e = presentation.getNonDefaultStyleRangeIterator(); while (e.hasNext()) { range = e.next(); range = modelStyleRange2WidgetStyleRange(range); if (range != null) { updateStyle(range); ranges.add(range); } } if (!ranges.isEmpty()) fMinimapTextWidget.replaceStyleRanges(0, 0, ranges.toArray(new StyleRange[ranges.size()])); } else { IRegion region = modelRange2WidgetRange(presentation.getCoverage()); if (region == null) return; List<StyleRange> list = new ArrayList<>(presentation.getDenumerableRanges()); Iterator<StyleRange> e = presentation.getAllStyleRangeIterator(); while (e.hasNext()) { range = e.next(); range = modelStyleRange2WidgetStyleRange(range); if (range != null) { updateStyle(range); list.add(range); } } if (!list.isEmpty()) { StyleRange[] ranges = new StyleRange[list.size()]; list.toArray(ranges); fMinimapTextWidget.replaceStyleRanges(region.getOffset(), region.getLength(), ranges); } } }

Target:
private void addPresentation(TextPresentation presentation) { StyleRange range = presentation.getDefaultStyleRange(); if (range != null) { range = modelStyleRange2WidgetStyleRange(range); if (range != null) { updateStyle(range); fMinimapTextWidget.setStyleRange(range); } List<StyleRange> ranges = new ArrayList<>(presentation.getDenumerableRanges()); Iterator<StyleRange> e = presentation.getNonDefaultStyleRangeIterator(); while (e.hasNext()) { range = e.next(); range = modelStyleRange2WidgetStyleRange(range); if (range != null) { updateStyle(range); ranges.add(range); } } if (!ranges.isEmpty()) { fMinimapTextWidget.replaceStyleRanges(0, 0, ranges.toArray(new StyleRange[ranges.size()])); } } else { IRegion region = modelRange2WidgetRange(presentation.getCoverage()); if (region == null) return; List<StyleRange> list = new ArrayList<>(presentation.getDenumerableRanges()); Iterator<StyleRange> e = presentation.getAllStyleRangeIterator(); while (e.hasNext()) { range = e.next(); range = modelStyleRange2WidgetStyleRange(range); if (range != null) { updateStyle(range); list.add(range); } } if (!list.isEmpty()) { StyleRange[] ranges = new StyleRange[list.size()]; list.toArray(ranges); fMinimapTextWidget.replaceStyleRanges(region.getOffset(), region.getLength(), ranges); } } }
Source:
public FF4j getFF4j() { try { FF4j ff4j = new FF4j(); JdbcFeatureStore featureStore = new JdbcFeatureStore(ff4jDataSource()); featureStore.setQueryBuilder(new JdbcQueryBuilder(TABLE_PREFIX, "", BaseDAOImpl.SCHEMA_NAME)); ff4j.setFeatureStore(featureStore); JdbcPropertyStore propertyStore = new JdbcPropertyStore(ff4jDataSource()); propertyStore.setQueryBuilder(new JdbcQueryBuilder(TABLE_PREFIX, "", BaseDAOImpl.SCHEMA_NAME)); ff4j.setPropertiesStore(propertyStore); JdbcEventRepository eventRepository = new JdbcEventRepository(ff4jDataSource()); eventRepository.setQueryBuilder(new JdbcQueryBuilder(TABLE_PREFIX, "", BaseDAOImpl.SCHEMA_NAME)); ff4j.setEventRepository(new JdbcEventRepository(ff4jDataSource())); FF4JCacheManager ff4jCache = new FeatureCacheProviderEhCache(); ff4j.cache(ff4jCache); return ff4j; } catch (NamingException | SQLException e) { return null; } }

Target:
public FF4j getFF4j() { try { FF4j ff4j = new FF4j(); JdbcFeatureStore featureStore = new JdbcFeatureStore(ff4jDataSource()); featureStore.setQueryBuilder(new JdbcQueryBuilder(TABLE_PREFIX, "", FF4J_SCHEMA)); ff4j.setFeatureStore(featureStore); JdbcPropertyStore propertyStore = new JdbcPropertyStore(ff4jDataSource()); propertyStore.setQueryBuilder(new JdbcQueryBuilder(TABLE_PREFIX, "", FF4J_SCHEMA)); ff4j.setPropertiesStore(propertyStore); JdbcEventRepository eventRepository = new JdbcEventRepository(ff4jDataSource()); eventRepository.setQueryBuilder(new JdbcQueryBuilder(TABLE_PREFIX, "", FF4J_SCHEMA)); ff4j.setEventRepository(new JdbcEventRepository(ff4jDataSource())); FF4JCacheManager ff4jCache = new FeatureCacheProviderEhCache(); ff4j.cache(ff4jCache); return ff4j; } catch (NamingException | SQLException e) { return null; } }
Source:
private int getHighestProblemSeverity(IResource resource) { int problemSeverity = -1; try { for (IMarker marker : resource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) { problemSeverity = Math.max(problemSeverity, marker.getAttribute(IMarker.SEVERITY, -1)); } } catch (CoreException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); } return problemSeverity; }

Target:
private int getHighestProblemSeverity(IResource resource) { int problemSeverity = -1; try { for (IMarker marker : resource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) { problemSeverity = Math.max(problemSeverity, marker.getAttribute(IMarker.SEVERITY, -1)); } } catch (CoreException e) { } return problemSeverity; }
Source:
public PDOMCPPMemberBlock(PDOMLinkage linkage, long record) throws CoreException { this.linkage = linkage; this.record = record; updateNextPosition(); }

Target:
public PDOMCPPMemberBlock(PDOMLinkage linkage, long record) throws CoreException { this.linkage = linkage; this.record = record; }
Source:
public JobWorkerHealth(alluxio.grpc.JobWorkerHealth jobWorkerHealth) { mWorkerId = jobWorkerHealth.getWorkerId(); mLoadAverage = Lists.newArrayList(jobWorkerHealth.getLoadAverageList()); mLastUpdated = jobWorkerHealth.getLastUpdated(); mHostname = jobWorkerHealth.getHostname(); }

Target:
public JobWorkerHealth(alluxio.grpc.JobWorkerHealth jobWorkerHealth) { mWorkerId = jobWorkerHealth.getWorkerId(); mLoadAverage = jobWorkerHealth.getLoadAverageList(); mLastUpdated = jobWorkerHealth.getLastUpdated(); mHostname = jobWorkerHealth.getHostname(); }
Source:
public void visit(File file, String relativePath) throws IOException { if(Functions.isWindows()) relativePath = relativePath.replace('\\','/'); if(file.isDirectory()) relativePath+='/'; TarArchiveEntry te = new TarArchiveEntry(relativePath); int mode = IOUtils.mode(file); if (mode!=-1) te.setMode(mode); te.setModTime(file.lastModified()); long size = 0; if (!file.isDirectory()) { size = file.length(); te.setSize(size); } tar.putArchiveEntry(te); try { if (!file.isDirectory()) { FileInputStream in = new FileInputStream(file); try { int len; int read = 0; while ((len = in.read(buf)) >= 0) { if (len + read <= size) { tar.write(buf, 0, len); read += len; } else { tar.write(buf, 0, (int) size - read); break; } } } catch (IOException e) { LOGGER.log(Level.SEVERE, "Error writing to tar file from: " + file, e); throw e; } finally { in.close(); } } } finally { tar.closeArchiveEntry(); } entriesWritten++; }

Target:
public void visit(File file, String relativePath) throws IOException { if(Functions.isWindows()) relativePath = relativePath.replace('\\','/'); if(file.isDirectory()) relativePath+='/'; TarArchiveEntry te = new TarArchiveEntry(relativePath); int mode = IOUtils.mode(file); if (mode!=-1) te.setMode(mode); te.setModTime(file.lastModified()); long size = 0; if (!file.isDirectory()) { size = file.length(); te.setSize(size); } tar.putArchiveEntry(te); try { if (!file.isDirectory()) { try (FileInputStream fin = new FileInputStream(file); BoundedInputStream in = new BoundedInputStream(fin, size)) { int len; while ((len = in.read(buf)) >= 0) { tar.write(buf, 0, len); } } catch (IOException e) { IOException ioE = new IOException("Error writing to tar file from: " + file, e); throw ioE; } } } finally { tar.closeArchiveEntry(); } entriesWritten++; }
Source:
public boolean supports(VectorDriver.Capability cap) { switch(cap) { case BOUND: return true; case FILTER: case LIMIT: case OFFSET: case SIMPLIFY: case REPROJECT: case SORT: default: return false; } }

Target:
public boolean supports(VectorDriver.Capability cap) { return VECTOR_CAPABILITIES.contains(cap); }
Source:
public String apply(String oldName) { if ( UNDERSCORE_TO_CAMEL_CASE.equals(strategyName)) return caches.computeIfAbsent(oldName, k -> underscore2Camel(k)); return oldName; }

Target:
public String apply(String oldName) { if ( strategyType == TYPE_UNDERSCORE_TO_CAMEL_CASE ) return caches.computeIfAbsent(oldName, k -> underscore2Camel(k)); return oldName; }
Source:
private Collection<Map.Entry<String, String>> enrich( final Collection<Map.Entry<String, String>> headers, final Response rsp) { final List<String> list = rsp.headers().get(LAST_MODIFIED); final Map<String, String> map = new ConcurrentHashMap<>(headers.size() + 1); for (final Map.Entry<String, String> entry : headers) { map.put(entry.getKey(), entry.getValue()); } map.put(IF_MODIFIED_SINCE, list.iterator().next()); return map.entrySet(); }

Target:
private Collection<Map.Entry<String, String>> enrich( final Collection<Map.Entry<String, String>> headers, final Response rsp) { final List<String> list = rsp.headers().get( LastModifiedCachingWire.LAST_MODIFIED ); final Map<String, String> map = new ConcurrentHashMap<>(headers.size() + 1); for (final Map.Entry<String, String> entry : headers) { map.put(entry.getKey(), entry.getValue()); } map.put( LastModifiedCachingWire.IF_MODIFIED_SINCE, list.iterator().next() ); return map.entrySet(); }
Source:
public void testSyndicateExistingSyndication() throws Exception { final ArticleRevisionIdentifier revisionId = ArticleRevisionIdentifier.create("0", 1); when(mockArticleCrudService.readRevision(revisionId)).thenReturn(createStubArticleRevision()); when(mockHibernateTemplate.execute(any())).thenReturn(createStubSyndication()); mockSyndicationCrudService.syndicate(revisionId, "test"); verify(mockHibernateTemplate).update(any(Syndication.class)); verify(mockMessageSender).sendBody(any(String.class), any(String.class)); }

Target:
public void testSyndicateExistingSyndication() throws Exception { when(mockArticleCrudService.readRevision(stubRevisionId)).thenReturn(createStubArticleRevision()); when(mockHibernateTemplate.execute(any())).thenReturn(createStubSyndication()); mockSyndicationCrudService.syndicate(stubRevisionId, "test"); verify(mockHibernateTemplate).update(any(Syndication.class)); verify(mockMessageSender).sendBody(any(String.class), any(String.class)); }
Source:
public NotificationPopup(@NotNull StatusNotification notification, @NotNull Resources resources, @NotNull NotificationActionDelegate delegate) { this.notification = notification; this.resources = resources; this.delegate = delegate; setStyleName(resources.notificationCss().notificationPopupPanel()); notification.addObserver(this); FlowPanel contentWrapper = new FlowPanel("div"); contentWrapper.add(titlePanel = createTitleWidget()); contentWrapper.add(messagePanel = createMessageWidget()); contentWrapper.setStyleName(resources.notificationCss().notificationPopupContentWrapper()); contentWrapper.ensureDebugId(getDebugId(CONTENT_DBG_ID, notification)); FlowPanel notificationWrapper = new FlowPanel("div"); notificationWrapper.add(iconPanel = createIconWidget()); notificationWrapper.add(contentWrapper); notificationWrapper.add(createCloseWidget()); notificationWrapper.setStyleName(resources.notificationCss().notificationPopup()); notificationWrapper.ensureDebugId(getDebugId(NOTIFICATION_WRAPPER_DBG_ID, notification)); getElement().getStyle().setOpacity(0); setWidget(notificationWrapper); }

Target:
public NotificationPopup(@NotNull StatusNotification notification, @NotNull Resources resources, @NotNull NotificationActionDelegate delegate) { this.notification = notification; this.resources = resources; this.delegate = delegate; setStyleName(resources.notificationCss().notificationPopupPanel()); notification.addObserver(this); FlowPanel contentWrapper = new FlowPanel(); contentWrapper.add(titlePanel = createTitleWidget()); contentWrapper.add(messagePanel = createContentWidget()); contentWrapper.setStyleName(resources.notificationCss().notificationPopupContentWrapper()); contentWrapper.ensureDebugId(CONTENT_DBG_ID + notification.getId()); FlowPanel notificationWrapper = new FlowPanel(); notificationWrapper.add(iconPanel = createIconWidget()); notificationWrapper.add(contentWrapper); notificationWrapper.add(createCloseWidget()); notificationWrapper.setStyleName(resources.notificationCss().notificationPopup()); notificationWrapper.ensureDebugId(NOTIFICATION_WRAPPER_DBG_ID + notification.getId()); getElement().getStyle().setOpacity(0); setWidget(notificationWrapper); }
Source:
public String getName() { return "CrackShotPlayerFinishesReloadingWeaponEvent"; }

Target:
public String getName() { return "CrackShotPlayerFinishesReloadingWeapon"; }
Source:
public int run(String[] args) throws Exception { String command = args[0]; checkArgument(FSCK_COMMANDS.contains(command), "Unknown %s command, should be %s", command); int argsCount = COMMAND_CHECK.equals(command) ? 2 : 3; checkArgument( args.length == argsCount, "%s arguments should be specified for %s command, but were: %s", argsCount, lazy(() -> Arrays.toString(args))); String bucket = args[1]; checkArgument( bucket.startsWith(GoogleCloudStorageFileSystem.SCHEME + "://"), "bucket parameter should have 'gs://' scheme"); String operationId = COMMAND_CHECK.equals(command) ? null : args[2]; return new CoopLockFsckRunner(getConf(), URI.create(bucket), command, operationId).run(); }

Target:
public int run(String[] args) throws Exception { String command = args[0]; checkArgument(FSCK_COMMANDS.contains(command), "Unknown %s command, should be %s", command); int expectedArgsNumber = COMMAND_CHECK.equals(command) ? 2 : 3; checkArgument( args.length == expectedArgsNumber, "%s arguments should be specified for %s command, but were: %s", expectedArgsNumber, lazy(() -> Arrays.toString(args))); String bucket = args[1]; checkArgument( bucket.startsWith(GoogleCloudStorageFileSystem.SCHEME + "://"), "bucket parameter should have 'gs://' scheme"); String operationId = COMMAND_CHECK.equals(command) ? null : args[2]; return new CoopLockFsckRunner(getConf(), URI.create(bucket), command, operationId).run(); }
Source:
public void onEntityCollision(World world, BlockPos pos, IBlockState blockState, Entity entity) { if (!world.isRemote && world.getTileEntity(pos) instanceof TileDimensionalPortal) { TileDimensionalPortal tile = (TileDimensionalPortal) world.getTileEntity(pos); LocationsHandler.verifyIsInitialized(); ArrayList<PortalLocation> linkedLocations = LocationsHandler.getLinkedLocations(tile.portalID); if (linkedLocations != null && linkedLocations.size() > 1) { if (world.getTileEntity(tile.getMasterStonePos()) != null && world.getTileEntity(tile.getMasterStonePos()) instanceof IMasterRitualStone) { IMasterRitualStone masterRitualStone = (IMasterRitualStone) world.getTileEntity(tile.getMasterStonePos()); PortalLocation portal; int index = linkedLocations.size() - 1; if (linkedLocations.get(index).equals(new PortalLocation(masterRitualStone.getBlockPos().up(), world.provider.getDimension()))) { portal = linkedLocations.get(index-1); } else { portal = linkedLocations.get(index); } if (portal.getDimension() == world.provider.getDimension()) { TeleportQueue.getInstance().addITeleport(new Teleports.TeleportSameDim(portal.getX(), portal.getY(), portal.getZ(), entity, masterRitualStone.getOwner(), false)); } else { TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(portal.getX(), portal.getY(), portal.getZ(), entity, masterRitualStone.getOwner(), world, portal.getDimension(), false)); } } } } }

Target:
public void onEntityCollision(World world, BlockPos pos, IBlockState blockState, Entity entity) { if (!world.isRemote && world.getTileEntity(pos) instanceof TileDimensionalPortal) { TileDimensionalPortal tile = (TileDimensionalPortal) world.getTileEntity(pos); ArrayList<PortalLocation> linkedLocations = LocationsHandler.getLinkedLocations(tile.portalID); if (linkedLocations != null && linkedLocations.size() > 1) { TileEntity tileEntity = world.getTileEntity(tile.getMasterStonePos()); if (tileEntity instanceof IMasterRitualStone) { IMasterRitualStone masterRitualStone = (IMasterRitualStone) tileEntity; PortalLocation portal; int index = linkedLocations.size() - 1; if (linkedLocations.get(index).equals(new PortalLocation(masterRitualStone.getBlockPos().up(), world.provider.getDimension()))) index--; portal = linkedLocations.get(index); if (portal.getDimension() == world.provider.getDimension()) { TeleportQueue.getInstance().addITeleport(new Teleports.TeleportSameDim(portal.getX(), portal.getY(), portal.getZ(), entity, masterRitualStone.getOwner(), false)); } else { TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(portal.getX(), portal.getY(), portal.getZ(), entity, masterRitualStone.getOwner(), world, portal.getDimension(), false)); } } } } }
Source:
private TableConfiguration buildVertexTableConf(final String tableId) throws InjectionException { final DataParser dataParser = masterConfInjector.getInstance(DataParser.class); return TableConfiguration.newBuilder() .setId(tableId) .setKeyCodecClass(SerializableCodec.class) .setValueCodecClass(DefaultVertexCodec.class) .setUpdateValueCodecClass(SerializableCodec.class) .setUpdateFunctionClass(VoidUpdateFunction.class) .setIsMutableTable(true) .setIsOrderedTable(false) .setDataParserClass(dataParser.getClass()) .setBulkDataLoaderClass(ExistKeyBulkDataLoader.class) .build(); }

Target:
private TableConfiguration buildVertexTableConf(final String tableId) throws InjectionException { final DataParser dataParser = masterConfInjector.getInstance(DataParser.class); final StreamingCodec vertexValueCodec = masterConfInjector.getNamedInstance(VertexValueCodec.class); final StreamingCodec edgeCodec = masterConfInjector.getNamedInstance(EdgeCodec.class); final Configuration vertexComponentCodecConf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(VertexValueCodec.class, vertexValueCodec.getClass()) .bindNamedParameter(EdgeCodec.class, edgeCodec.getClass()) .build(); return TableConfiguration.newBuilder() .setId(tableId) .setKeyCodecClass(SerializableCodec.class) .setValueCodecClass(DefaultVertexCodec.class) .setUpdateValueCodecClass(NullCodec.class) .setUpdateFunctionClass(VoidUpdateFunction.class) .setIsMutableTable(true) .setIsOrderedTable(false) .setDataParserClass(dataParser.getClass()) .setBulkDataLoaderClass(ExistKeyBulkDataLoader.class) .setUserParamConf(vertexComponentCodecConf) .build(); }
Source:
public Map<String, String> getProperties() { try (InputStream in = resource.getInputStream()) { if (in != null) { try { Class.forName("org.yaml.snakeyaml.Yaml"); Yaml yaml = new Yaml(); Map config = yaml.loadAs(in, Map.class); return getFlattenedMap(config); } catch (ClassNotFoundException e) { log.warn("YAML not found in classpath, add 'org.yaml:snakeyaml' to support YAML configuration"); } } } catch (IOException e) { throw new IllegalArgumentException("Unable to read resource [" + resource + "]: " + e.getMessage(), e); } return new LinkedHashMap<>(); }

Target:
public Map<String, String> getProperties() { try (InputStream in = resource.getInputStream()) { if (in != null && Classes.isAvailable("org.yaml.snakeyaml.Yaml")) { Yaml yaml = new Yaml(); Map config = yaml.loadAs(in, Map.class); return getFlattenedMap(config); } else { log.warn("YAML not found in classpath, add 'org.yaml.snakeyaml' to support YAML configuration"); } } catch (IOException e) { throw new IllegalArgumentException("Unable to read resource [" + resource + "]: " + e.getMessage(), e); } return new LinkedHashMap<>(); }
Source:
public boolean isNetworkProviderEnabled() { return locationManager.isProviderEnabled(String.valueOf(R.string.network_provider)); }

Target:
public boolean isNetworkProviderEnabled() { return locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); }