auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Collection<WorldProperties> getUnloadedWorlds() throws IOException { final Optional<Path> optCurrentSavesDir = getCurrentSavesDirectory(); checkState(optCurrentSavesDir.isPresent(), "Attempt made to get unloaded worlds too early!"); final DirectoryStream<Path> stream = Files.newDirectoryStream(optCurrentSavesDir.get(), LEVEL_AND_SPONGE); final List<WorldProperties> worlds = new ArrayList<>(); for (Path worldFolder : stream) { final String worldFolderName = worldFolder.getFileName().toString(); final WorldInfo worldInfo = new AnvilSaveHandler(DimensionManager.getCurrentSavesDirectory().get().toFile(), worldFolderName, true, ((MinecraftServer) Sponge.getServer()).getDataFixer()).loadWorldInfo(); if (worldInfo != null) { worlds.add((WorldProperties) worldInfo); } } return worlds; }

Target:
public static Collection<WorldProperties> getUnloadedWorlds() throws IOException { final Optional<Path> optCurrentSavesDir = getCurrentSavesDirectory(); checkState(optCurrentSavesDir.isPresent(), "Attempt made to get unloaded worlds too early!"); final List<WorldProperties> worlds = new ArrayList<>(); try (final DirectoryStream<Path> stream = Files.newDirectoryStream(optCurrentSavesDir.get(), LEVEL_AND_SPONGE)) { for (Path worldFolder : stream) { final String worldFolderName = worldFolder.getFileName().toString(); final WorldInfo worldInfo = new AnvilSaveHandler(DimensionManager.getCurrentSavesDirectory().get().toFile(), worldFolderName, true, ((MinecraftServer) Sponge.getServer()).getDataFixer()).loadWorldInfo(); if (worldInfo != null) { worlds.add((WorldProperties) worldInfo); } } } return worlds; }
Source:
public String getMimeType() { String returnString = ""; if(!Files.isDirectory(path)) { TikaConfig tc = TikaConfig.getDefaultConfig(); Detector detector = tc.getDetector(); TikaInputStream stream = null; try { stream = TikaInputStream.get(new FileInputStream(new File(path.toString()))); } catch (FileNotFoundException e) { e.printStackTrace(); } Metadata metadata = new Metadata(); metadata.add(Metadata.RESOURCE_NAME_KEY, path.getFileName().toString()); try { MediaType mediaType = detector.detect(stream, metadata); returnString = mediaType.toString(); } catch (IOException e) { e.printStackTrace(); } } return returnString; }

Target:
public String getMimeType() { String returnString = ""; if(!Files.isDirectory(path)) { TikaConfig tc = TikaConfig.getDefaultConfig(); Detector detector = tc.getDetector(); try (TikaInputStream stream = TikaInputStream.get(new FileInputStream(new File(path.toString())))) { Metadata metadata = new Metadata(); metadata.add(Metadata.RESOURCE_NAME_KEY, path.getFileName().toString()); MediaType mediaType = detector.detect(stream, metadata); returnString = mediaType.toString(); } catch (IOException e) { e.printStackTrace(); } } return returnString; }
Source:
public CloudBigtableScanConfiguration build() { if (request == null) { if(scan == null){ scan = new Scan(); } request = new RequestWithScanValueProvider(scan.getStartRow(), scan.getStopRow(), scan.getMaxVersions(), scan.getFilter()); } return new CloudBigtableScanConfiguration(projectId, instanceId, tableId, request, additionalConfiguration); }

Target:
public CloudBigtableScanConfiguration build() { RowSet rowSet = null; if (request == null) { if (scan == null) { scan = new Scan(); } BigtableExtendedScan extendedScan = new BigtableExtendedScan(); extendedScan.addRange(scan.getStartRow(), scan.getStopRow()); extendedScan.setMaxVersions(scan.getMaxVersions()); extendedScan.setFilter(scan.getFilter()); rowSet = extendedScan.getRowSet(); } return new CloudBigtableScanConfiguration(projectId, instanceId, tableId, request, rowSet, additionalConfiguration); }
Source:
public void prepare() throws Exception { String phpRepoLocation = "<LINK_0>"; List<ProjectConfigDto> list = new ArrayList<>(); List<String> projects = Arrays.asList( NAME_OF_PROJECT_FOR_CHECKING_GIT_SOFT_RESET, NAME_OF_PROJECT_FOR_CHECKING_GIT_HARD_RESET, NAME_OF_PROJECT_FOR_CHECKING_GIT_MIX_RESET); SourceStorageDto sourceStorage = DtoFactory.getInstance() .createDto(SourceStorageDto.class) .withLocation(phpRepoLocation) .withType("git"); projects.forEach(item -> list.add(configureTestProject(item, sourceStorage))); WorkspaceConfigDto workspace = workspaceDtoDeserializer.deserializeWorkspaceTemplate(DEFAULT); workspace.setProjects(list); testWorkspace = new TestWorkspaceImpl( NameGenerator.generate("check-resetting-test", 4), testUser, 4, workspace, workspaceServiceClient); ide.open(testWorkspace); projects.forEach(item -> projectExplorer.waitItem(item)); notificationsPopupPanel.waitPopupPanelsAreClosed(); projectExplorer.quickExpandWithJavaScript(); }

Target:
public void prepare() throws Exception { List<String> projects = Arrays.asList( NAME_OF_PROJECT_FOR_CHECKING_GIT_SOFT_RESET, NAME_OF_PROJECT_FOR_CHECKING_GIT_HARD_RESET, NAME_OF_PROJECT_FOR_CHECKING_GIT_MIX_RESET); ide.open(ws); projects.forEach(item -> projectExplorer.waitItem(item)); notificationsPopupPanel.waitPopupPanelsAreClosed(); projectExplorer.quickExpandWithJavaScript(); }
Source:
public List<String> getRawTerms(Document articleXml) throws IOException { ArrayList<String> rawTerms = new ArrayList<>(); rawTerms.add("dummy raw term"); return rawTerms; }

Target:
public List<String> getRawTerms(Document articleXml) throws IOException { return ImmutableList.of("dummy raw term"); }
Source:
public SimpleFeatureType retrieveSchema(Name name) throws IOException { if (name == null) { return null; } File schemaFile = schemaFile(name); if (!schemaFile.canRead()) { return null; } BufferedReader reader = new BufferedReader(new FileReader(schemaFile)); return MongoSchemaStore.super.getSimpleFeatureType(reader, name); }

Target:
public SimpleFeatureType retrieveSchema(Name name) throws IOException { if (name == null) { return null; } File schemaFile = schemaFile(name); if (!schemaFile.canRead()) { return null; } BufferedReader reader = new BufferedReader(new FileReader(schemaFile)); return MongoUtil.getSimpleFeatureType(reader, name); }
Source:
public static Locator createLocatorFromPathComponents(String tenantId, String... parts) throws IllegalArgumentException { if(StringUtils.isEmpty(tenantId) || parts == null) throw new IllegalArgumentException("'tenantId' is null or empty OR 'parts' is null."); return new Locator(tenantId + METRIC_TOKEN_SEPARATOR + StringUtils.join(parts, METRIC_TOKEN_SEPARATOR)); }

Target:
public static Locator createLocatorFromPathComponents(String tenantId, String... parts) throws IllegalArgumentException { if(StringUtils.isEmpty(tenantId) || parts == null) log.error("'tenantId' is null or empty OR 'parts' is null."); return new Locator(tenantId + METRIC_TOKEN_SEPARATOR + StringUtils.join(parts, METRIC_TOKEN_SEPARATOR)); }
Source:
private static void cwl(List<String> args) { if (args.isEmpty()) { kill("Please provide a container."); } String[] parts = args.get(0).split(":"); String path = parts[0]; String tag = (parts.length > 1) ? parts[1] : null; out("TAG: " + tag); try { Container container = containersApi.getContainerByPath(path); if (container.getHasCollab()) { try { FileResponse collab = containersApi.cwl(container.getId(), tag); if (collab.getContent() != null && !collab.getContent().isEmpty()) { out(collab.getContent()); } else { out("No cwl file found."); } } catch (ApiException ex) { if (ex.getCode() == HttpStatus.SC_BAD_REQUEST) { out("Invalid tag"); } else { out("No cwl file found."); } } } else { out("No cwl file found."); } } catch (ApiException ex) { out("Could not find container"); } }

Target:
private static void cwl(List<String> args) { if (args.isEmpty()) { kill("Please provide a container."); } String[] parts = args.get(0).split(":"); String path = parts[0]; String tag = (parts.length > 1) ? parts[1] : null; try { Container container = containersApi.getContainerByPath(path); if (container.getHasCollab()) { try { SourceFile file = containersApi.cwl(container.getId(), tag); if (file.getContent() != null && !file.getContent().isEmpty()) { out(file.getContent()); } else { kill("No cwl file found."); } } catch (ApiException ex) { if (ex.getCode() == HttpStatus.SC_BAD_REQUEST) { kill("Invalid tag"); } else { kill("No cwl file found."); } } } else { kill("No cwl file found."); } } catch (ApiException ex) { kill("Could not find container"); } }
Source:
public void refresh(Detail detail, TreeReference reference, int index) { EntityDetailPagerAdapter mEntityDetailPagerAdapter = new EntityDetailPagerAdapter(mContext.getSupportFragmentManager(), detail, index, reference, new ListItemViewStriper(this.mOddColor, this.mEvenColor)); mViewPager.setAdapter(mEntityDetailPagerAdapter); if (!detail.isCompound()) { if (mViewPageTabStrip != null) { mViewPageTabStrip.setVisibility(GONE); } } }

Target:
public void refresh(Detail detail, TreeReference reference, int index) { EntityDetailPagerAdapter entityDetailPagerAdapter = new EntityDetailPagerAdapter(mContext.getSupportFragmentManager(), detail, index, reference, new ListItemViewStriper(this.mOddColor, this.mEvenColor)); mViewPager.setAdapter(entityDetailPagerAdapter); if (!detail.isCompound()) { if (mViewPageTabStrip != null) { mViewPageTabStrip.setVisibility(GONE); } } }
Source:
public void testCreate() { Invoice invoiceCreated = api.create( new InvoiceRequest() .addItem("Product", 1, "Detail", 1000) .customer( new CustomerRequest() .email("vavagner.vieira@moip.com.br")) .checkoutPreferences( new CheckoutPreferencesRequest() .fundingInstruments( new FundingInstrumentRequest() .supressBoleto(true)) .addInstallment( new int[]{1, 2}) .addInstallment( new int[]{6, 9}) .supressShippingAddress(true))); assertEquals("INV-B36128A22351", invoiceCreated.getId()); assertEquals(Integer.valueOf(1000), invoiceCreated.getAmount().getTotal()); assertEquals("My Invoice Product", invoiceCreated.getItems().get(0).getProduct()); assertEquals("My Invoice Detail", invoiceCreated.getItems().get(0).getDetail()); }

Target:
public void testCreate() { Invoice invoiceCreated = api.create( new InvoiceRequest() .addItem("My Invoice Product", 1, "My Invoice Detail", 1000) .customer( new CustomerRequest() .email("vavagner.vieira@moip.com.br")) .checkoutPreferences( new CheckoutPreferencesRequest() .fundingInstruments( new FundingInstrumentRequest() .suppressBoleto(true)) .addInstallment( new int[]{1, 2}) .addInstallment( new int[]{6, 9}) .supressShippingAddress(true))); assertEquals("INV-B36128A22351", invoiceCreated.getId()); assertEquals(Integer.valueOf(1000), invoiceCreated.getAmount().getTotal()); assertEquals("My Invoice Product", invoiceCreated.getItems().get(0).getProduct()); assertEquals("My Invoice Detail", invoiceCreated.getItems().get(0).getDetail()); }
Source:
public void testPushWithoutOptions() throws Exception { try (Git git = new Git(db); Git git2 = new Git(createBareRepository())) { final StoredConfig config = constructConfig(git, git2); config.save(); final StoredConfig config2 = git2.getRepository().getConfig(); config2.setBoolean("receive", null, "pushoptions", true); config2.save(); RevCommit commit = setupCommit(git); git.checkout().setName("not-pushed").setCreateBranch(true).call(); git.checkout().setName("branchtopush").setCreateBranch(true).call(); assertNull(git2.getRepository().resolve("refs/heads/branchtopush")); assertNull(git2.getRepository().resolve("refs/heads/not-pushed")); assertNull(git2.getRepository().resolve("refs/heads/master")); PushCommand pushCommand = git.push().setRemote("test"); pushCommand.call(); assertEquals(commit.getId(), git2.getRepository().resolve("refs/heads/branchtopush")); assertNull(git2.getRepository().resolve("refs/heads/not-pushed")); assertNull(git2.getRepository().resolve("refs/heads/master")); } }

Target:
public void testPushWithoutOptions() throws Exception { try (Git git = new Git(db); Git git2 = new Git(createBareRepository())) { connectLocalToRemote(git, git2); final StoredConfig config2 = git2.getRepository().getConfig(); config2.setBoolean("receive", null, "pushoptions", true); config2.save(); RevCommit commit = addCommit(git); git.checkout().setName("not-pushed").setCreateBranch(true).call(); git.checkout().setName("branchtopush").setCreateBranch(true).call(); assertNull(git2.getRepository().resolve("refs/heads/branchtopush")); assertNull(git2.getRepository().resolve("refs/heads/not-pushed")); assertNull(git2.getRepository().resolve("refs/heads/master")); PushCommand pushCommand = git.push().setRemote("test"); pushCommand.call(); assertEquals(commit.getId(), git2.getRepository().resolve("refs/heads/branchtopush")); assertNull(git2.getRepository().resolve("refs/heads/not-pushed")); assertNull(git2.getRepository().resolve("refs/heads/master")); } }
Source:
public List<Tree.Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.METHOD, Tree.Kind.METHOD_INVOCATION, Tree.Kind.NEW_CLASS); }

Target:
public List<Tree.Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.METHOD, Tree.Kind.LAMBDA_EXPRESSION); }
Source:
private String executeRequest(String request, String command, boolean login) throws RWESmarthomeSessionExpiredException { if(!login && "".equals(sessionId)) throw new RWESmarthomeSessionExpiredException(); String sReturn = ""; try { sReturn = client.execute(hostname, clientId, request, command); if (sReturn.contains("IllegalSessionId")) { logger.warn("Session expired!"); sessionId = ""; throw new RWESmarthomeSessionExpiredException(sReturn); } } catch (ClientProtocolException ex) { logger.error(ex.getClass().getSimpleName(), ex); } catch (IOException ex) { logger.error(ex.getClass().getSimpleName(), ex); } finally { } return sReturn; }

Target:
private String executeRequest(String request, String command, boolean login) throws RWESmarthomeSessionExpiredException { if(!login && "".equals(sessionId)) { throw new RWESmarthomeSessionExpiredException(); } String sReturn = ""; try { sReturn = client.execute(hostname, clientId, request, command); if (sReturn.contains("IllegalSessionId")) { logger.info("Session expired!"); sessionId = ""; throw new RWESmarthomeSessionExpiredException(sReturn); } logger.trace("XMLResponse:" + sReturn); } catch (ClientProtocolException ex) { logger.error(ex.getClass().getSimpleName(), ex); } catch (IOException ex) { logger.error(ex.getClass().getSimpleName(), ex); } return sReturn; }
Source:
ExecMetrics() { this.registry = SERVICE_PROVIDER.getInstance(MetricsManager.class).getRegistry(); setupStaticMetrics(); }

Target:
ExecMetrics() { this.registry = SERVICE_PROVIDER.getInstance(MetricRegistry.class); setupStaticMetrics(); }
Source:
public void testRecordSubmoduleLabels() throws Exception { try ( Repository remoteDb = createBareRepository(); Repository tempDb = createWorkRepository()) { StringBuilder xmlContent = new StringBuilder(); xmlContent .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"test\" ") .append("revision=\"master\" ") .append("name=\"").append(notDefaultUri).append("\" ") .append("groups=\"a1,a2\" />") .append("</manifest>"); JGitTestUtil.writeTrashFile(tempDb, "manifest.xml", xmlContent.toString()); RepoCommand command = new RepoCommand(remoteDb); command.setPath(tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml") .setURI(rootUri) .setRecordSubmoduleLabels(true) .call(); File directory = createTempDirectory("testBareRepo"); try (Repository localDb = Git.cloneRepository() .setDirectory(directory) .setURI(remoteDb.getDirectory().toURI().toString()).call() .getRepository();) { File gitmodules = new File(localDb.getWorkTree(), ".gitmodules"); assertTrue("The .gitmodules file should exist", gitmodules.exists()); FileBasedConfig c = new FileBasedConfig(gitmodules, FS.DETECTED); c.load(); String[] expect = new String[] {"a1", "a2"}; assertArrayEquals("recording labels works", expect, c.getStringList("submodule", "test", "label")); } } }

Target:
public void testRecordSubmoduleLabels() throws Exception { try ( Repository remoteDb = createBareRepository(); Repository tempDb = createWorkRepository()) { StringBuilder xmlContent = new StringBuilder(); xmlContent .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"test\" ") .append("revision=\"master\" ") .append("name=\"").append(notDefaultUri).append("\" ") .append("groups=\"a1,a2\" />") .append("</manifest>"); JGitTestUtil.writeTrashFile(tempDb, "manifest.xml", xmlContent.toString()); RepoCommand command = new RepoCommand(remoteDb); command.setPath(tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml") .setURI(rootUri) .setRecordSubmoduleLabels(true) .call(); File directory = createTempDirectory("testBareRepo"); try (Repository localDb = Git.cloneRepository() .setDirectory(directory) .setURI(remoteDb.getDirectory().toURI().toString()).call() .getRepository();) { File gitmodules = new File(localDb.getWorkTree(), ".gitmodules"); assertTrue("The .gitmodules file should exist", gitmodules.exists()); FileBasedConfig c = new FileBasedConfig(gitmodules, FS.DETECTED); c.load(); Set<String> expect = new HashSet<String>(); expect.add("a1"); expect.add("a2"); Set<String> actual = new HashSet<String>(); actual.addAll(Arrays.asList(c.getStringList("submodule", "test", "label"))); assertEquals("recording labels works", expect, actual); } } }
Source:
public static void putObject_test14() throws Exception { if (!mintEnv) { System.out.println("Test: putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_S3."); } long startTime = System.currentTimeMillis(); ServerSideEncryption sse = ServerSideEncryption.atRest(); try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * MB)) { client.putObject(bucketName, objectName, is, 1 * MB, sse); } client.removeObject(bucketName, objectName); mintSuccessLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse)", "size: 13 MB", startTime); } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse)", "size: 13 MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }

Target:
public static void putObject_test14() throws Exception { if (!mintEnv) { System.out.println("Test: putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_S3."); } long startTime = System.currentTimeMillis(); ServerSideEncryption sse = ServerSideEncryption.atRest(); try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * MB)) { client.putObject(bucketName, objectName, is, 1 * MB, sse); } client.removeObject(bucketName, objectName); mintSuccessLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_S3.", "size: 1 MB", startTime); } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_S3.", "size: 1 MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }
Source:
public void endRecord() { ++rowCount; if (rowCount >= rowCountForNextRowCountCheck) { rowCountCheck(); } if (rowCount >= rowCountForNextSizeCheck) { sizeCheck(); } }

Target:
public void endRecord() { ++rowCount; if (rowCount >= rowCountForNextSizeCheck) { sizeCheck(); } }
Source:
public void serialize(@Nullable Object obj) throws IOException { if (obj == null) { nullRowsBitmap.add(rowCount); writer.add(0L); } else { writer.add(((Number) obj).floatValue()); } rowCount++; }

Target:
public void serialize(@Nullable Object obj) throws IOException { if (obj == null) { nullRowsBitmap.add(rowCount); writer.add(0f); } else { writer.add(((Number) obj).floatValue()); } rowCount++; }
Source:
public void castFireball() throws SpellCastException { if (this.calculateMagicPower() >= 10.0) { System.out.println(this.toString() + ": a fireball spell is casted"); } else { throw new SpellCastException("Can not cast lighting! Not enough magic power..."); } }

Target:
public void castFireball() throws SpellCastException { if (calculateMagicPower() >= 10.0) { System.out.println(toString() + ": a fireball spell is casted"); } else { throw new SpellCastException("Can not cast fire ball! Not enough magic power..."); } }
Source:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); if (instructor == null) { throw new UnauthorizedAccessException("Not instructor of the course"); } gateKeeper.verifyAccessible( instructor, logic.getCourse(courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR); }

Target:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); gateKeeper.verifyAccessible( instructor, logic.getCourse(courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR); }
Source:
protected List<? extends Module> getModules() { return ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/internal-hadoop-indexer"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bind(NodeTypeConfig.class).toInstance(new NodeTypeConfig("internal-hadoop-indexer")); MetadataStorageUpdaterJobSpec metadataSpec = getHadoopDruidIndexerConfig().getSchema() .getIOConfig() .getMetadataUpdateSpec(); binder.bind(new TypeLiteral<Supplier<MetadataStorageConnectorConfig>>() {}) .toInstance(metadataSpec); binder.bind(MetadataStorageTablesConfig.class).toInstance(metadataSpec.getMetadataStorageTablesConfig()); binder.bind(IndexerMetadataStorageCoordinator.class).to(IndexerSQLMetadataStorageCoordinator.class).in( LazySingleton.class ); } } ); }

Target:
protected List<? extends Module> getModules() { return ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/internal-hadoop-indexer"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bind(NodeTypeConfig.class).toInstance(new NodeTypeConfig("hadoop-indexer")); MetadataStorageUpdaterJobSpec metadataSpec = getHadoopDruidIndexerConfig().getSchema() .getIOConfig() .getMetadataUpdateSpec(); binder.bind(new TypeLiteral<Supplier<MetadataStorageConnectorConfig>>() {}) .toInstance(metadataSpec); binder.bind(MetadataStorageTablesConfig.class).toInstance(metadataSpec.getMetadataStorageTablesConfig()); binder.bind(IndexerMetadataStorageCoordinator.class).to(IndexerSQLMetadataStorageCoordinator.class).in( LazySingleton.class ); } } ); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_dds_style_circles_categorically); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull final MapboxMap mapboxMap) { mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { VectorSource vectorSource = new VectorSource( "ethnicity-source", "<LINK_0>" + Mapbox.getAccessToken() ); mapboxMap.getStyle().addSource(vectorSource); CircleLayer circleLayer = new CircleLayer("population", "ethnicity-source"); circleLayer.setSourceLayer("sf2010"); circleLayer.withProperties( circleRadius( interpolate( exponential(1.75f), zoom(), stop(12, 2f), stop(22, 180f) )), circleColor( match(get("ethnicity"), rgb(0, 0, 0), stop("white", rgb(251, 176, 59)), stop("Black", rgb(34, 59, 83)), stop("Hispanic", rgb(229, 94, 94)), stop("Asian", rgb(59, 178, 208)), stop("Other", rgb(204, 204, 204))))); mapboxMap.getStyle().addLayer(circleLayer); } }); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_dds_style_circles_categorically); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull final MapboxMap mapboxMap) { mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { style.addSource(new VectorSource( "ethnicity-source", "<LINK_0>" + Mapbox.getAccessToken() )); CircleLayer circleLayer = new CircleLayer("population", "ethnicity-source"); circleLayer.setSourceLayer("sf2010"); circleLayer.withProperties( circleRadius( interpolate( exponential(1.75f), zoom(), stop(12, 2f), stop(22, 180f) )), circleColor( match(get("ethnicity"), rgb(0, 0, 0), stop("white", rgb(251, 176, 59)), stop("Black", rgb(34, 59, 83)), stop("Hispanic", rgb(229, 94, 94)), stop("Asian", rgb(59, 178, 208)), stop("Other", rgb(204, 204, 204))))); style.addLayer(circleLayer); } }); } }); }
Source:
public Builder implName(String implName) { this.implName = "default".equals( implName ) ? "*Impl" : implName; this.customName = !"*Impl".equals( this.implName ); return this; }

Target:
public Builder implName(String implName) { this.implName = implName; this.customName = !DEFAULT_IMPLEMENTATION_CLASS.equals( this.implName ); return this; }
Source:
public int getDeadNodeCount() { return getNodeCount( new NodeStatus(NodeOperationalState.IN_SERVICE, NodeState.DEAD)); }

Target:
public int getDeadNodeCount() { return getDeadNodes().size(); }
Source:
public void unregisterConsumer(EventConsumer consumer) { if (consumer == null) { throw new InvalidParameterException("Consumer must not be null"); } regMgmtLock.lock(); try { log.debug("unregisterConsumer " + consumer.getClass().getCanonicalName()); for (Entry<String, RegisteredPublisher> entry : nameToPublisher.entrySet()) { entry.getValue().removeComsumer(consumer); } for (RegisteredConsumer regCon : this.danglingConsumers) { if (regCon.getConsumer().equals(consumer)) { this.danglingConsumers.remove(regCon); break; } } } finally { regMgmtLock.unlock(); } }

Target:
public void unregisterConsumer(EventConsumer consumer) { if (consumer == null) { throw new InvalidParameterException("Consumer must not be null"); } regMgmtLock.lock(); try { log.debug("unregisterConsumer " + consumer.getClass().getCanonicalName()); for (Entry<String, RegisteredPublisher> entry : nameToPublisher.entrySet()) { entry.getValue().removeComsumer(consumer); } removeDanglingConsumer(consumer); } finally { regMgmtLock.unlock(); } }
Source:
public void testDistinctFrom() { assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' IS DISTINCT FROM IPADDRESS '2001:db8::ff00:42:8329'", BOOLEAN, false); assertFunction("CAST(NULL AS IPADDRESS) IS DISTINCT FROM CAST(NULL AS IPADDRESS)", BOOLEAN, false); }

Target:
public void testDistinctFrom() { assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' IS DISTINCT FROM IPADDRESS '2001:db8::ff00:42:8329'", BOOLEAN, false); assertFunction("CAST(NULL AS IPADDRESS) IS DISTINCT FROM CAST(NULL AS IPADDRESS)", BOOLEAN, false); assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' IS DISTINCT FROM IPADDRESS '2001:db8::ff00:42:8328'", BOOLEAN, true); assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' IS DISTINCT FROM CAST(NULL AS IPADDRESS)", BOOLEAN, true); assertFunction("CAST(NULL AS IPADDRESS) IS DISTINCT FROM IPADDRESS '2001:db8::ff00:42:8328'", BOOLEAN, true); }
Source:
private String findAdbExecutable() { String android_home = System.getenv("ANDROID_HOME"); return android_home != null && !android_home.equals("")?android_home + "/platform-tools/adb":"adb"; }

Target:
private String findAdbExecutable() { String android_home = System.getenv("ANDROID_HOME"); if (android_home == null || android_home.equals("")) { return "adb"; } return android_home + "/platform-tools/adb"; }
Source:
public void areUniqueAndOrderedLong() { final int iterations = PARAMETERS.NUM_ITERATIONS_MODERATE; OrderedGuidGenerator guidGenerator = new CorfuGuidGenerator(getDefaultRuntime()); long lastValue = 0; HashSet<Long> uniq = new HashSet<>(iterations); for (int i = 0; i < iterations; i++) { long current = guidGenerator.nextLong(); lastValue = current; assertThat(uniq).doesNotContain(current); uniq.add(current); } }

Target:
public void areUniqueAndOrderedLong() { final int iterations = PARAMETERS.NUM_ITERATIONS_MODERATE; OrderedGuidGenerator guidGenerator = new CorfuGuidGenerator(getDefaultRuntime().connect()); long lastValue = 0; HashSet<Long> uniq = new HashSet<>(iterations); for (int i = 0; i < iterations; i++) { long current = guidGenerator.nextLong(); assertThat(uniq).doesNotContain(current); assertThat(current).isGreaterThan(lastValue); lastValue = current; uniq.add(current); } }
Source:
public void checkSpecificAccessControl() { if (!Config.isDevServer()) { throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } }

Target:
public void checkSpecificAccessControl() { if (!userInfo.isAdmin) { throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } }
Source:
public String searchNodesByConcept(String conceptId) throws Exception { List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = buildRestHeader(messageConverters, restTemplate); VelocityEngine engine = restVelocityFactory.getVelocityEngine(); engine.init(); Template template = engine.getTemplate("velocitytemplates/searchQStore/requestNodes.vm"); VelocityContext context = new VelocityContext(); context.put("conceptId", conceptId); StringWriter writer = new StringWriter(); template.merge(context, writer); HttpEntity<String> request = new HttpEntity<String>(writer.toString(), headers); String res = ""; try { res = restTemplate.postForObject(getQStoreSearchUrl(), request, String.class); logger.info("Response from QStore", res); } catch (Exception e) { logger.error("QStore not accepting the xml, please check with the server logs.", e); return res; } return res; }

Target:
public String searchNodesByConcept(String conceptId) throws Exception { List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = buildRestHeader(messageConverters, restTemplate); VelocityEngine engine = restVelocityFactory.getVelocityEngine(); engine.init(); Template template = engine.getTemplate("velocitytemplates/searchQStore/requestNodes.vm"); VelocityContext context = new VelocityContext(); context.put("conceptId", conceptId); StringWriter writer = new StringWriter(); template.merge(context, writer); HttpEntity<String> request = new HttpEntity<String>(writer.toString(), headers); String res = ""; try { res = restTemplate.postForObject(getQStoreSearchUrl(), request, String.class); } catch (Exception e) { logger.error("QStore not accepting the xml, please check with the server logs.", e); return res; } return res; }
Source:
private void initClusterConnection() { try { properties.put(ConnectionPropertyNames.CONNECTION_NAME, CONNECTION_PREFIX + entityIdentifier); properties.put(ConnectionPropertyNames.CONNECTION_TIMEOUT, Long.toString(Timeouts.INFINITE_TIMEOUT.toMillis())); clusterConnection = ConnectionFactory.connect(clusterUri, properties); } catch (ConnectionException ex) { throw new RuntimeException(ex); } }

Target:
private void initClusterConnection() { try { properties.put(ConnectionPropertyNames.CONNECTION_NAME, CONNECTION_PREFIX + entityIdentifier); properties.put(ConnectionPropertyNames.CONNECTION_TIMEOUT, Long.toString(timeouts.getConnectionTimeout().toMillis())); clusterConnection = ConnectionFactory.connect(clusterUri, properties); } catch (ConnectionException ex) { throw new RuntimeException(ex); } }
Source:
private int verifyComma(String line) { boolean withComma = true; int commaAmount = 0; int len = line.length(); if (line.endsWith(")")) { line = line.substring(0, len - 1); line = line.trim(); len--; while (withComma == true) { if (line.endsWith(",")) { line = line.substring(0, len - 1); len--; commaAmount++; } else { withComma = false; line = line.concat(")"); len++; } } } else { while (withComma == true) { if (line.endsWith(",")) { line = line.substring(0, len - 1); len--; commaAmount++; } else { withComma = false; } } } return commaAmount; }

Target:
private int verifyComma(String line) { boolean withComma = true; int commaAmount = 0; int len = line.length(); if (line.endsWith(")")) { line = line.substring(0, len - 1); line = line.trim(); len = line.length(); while (withComma == true) { if (line.endsWith(",")) { line = line.substring(0, len - 1); len--; commaAmount++; } else { withComma = false; line = line.concat(")"); len++; } } } else { while (withComma == true) { if (line.endsWith(",")) { line = line.substring(0, len - 1); len--; commaAmount++; } else { withComma = false; } } } return commaAmount; }
Source:
public static Configuration getConfig(DataSource ds, Class<?>... mappers) { if (ds == null) { } if (ds == null) { throw new NullPointerException("Tried initializing MyBatis without a datasource"); } final TransactionFactory transactionFactory = new JdbcTransactionFactory(); final Environment environment = new Environment("development", transactionFactory, ds); final Configuration configuration = new Configuration(environment); configuration.setLazyLoadingEnabled(true); addMappers(configuration, mappers); return configuration; }

Target:
public static Configuration getConfig(DataSource ds, Class<?>... mappers) { if (ds == null) { throw new NullPointerException("Tried initializing MyBatis without a datasource"); } final TransactionFactory transactionFactory = new JdbcTransactionFactory(); final Environment environment = new Environment("development", transactionFactory, ds); final Configuration configuration = new Configuration(environment); configuration.setLazyLoadingEnabled(true); addMappers(configuration, mappers); return configuration; }
Source:
public boolean visit(IResourceDelta delta) throws CoreException { if (atLeastOneInterestingDelta) { return false; } final IResource resource = delta.getResource(); if (resource.getType() == IResource.ROOT) { return true; } if (resource.getType() == IResource.PROJECT && (delta.getKind() == IResourceDelta.REMOVED)) { atLeastOneInterestingDelta = true; return false; } if (resource.getType() == IResource.FOLDER && delta.getKind() == IResourceDelta.ADDED) { atLeastOneInterestingDelta = true; return false; } if (GitResourceDeltaVisitor.isInteresting(delta)) { atLeastOneInterestingDelta = true; return false; } return true; }

Target:
public boolean visit(IResourceDelta delta) throws CoreException { if (atLeastOneInterestingDelta) { return false; } if (GitResourceDeltaVisitor.isInteresting(delta)) { atLeastOneInterestingDelta = true; return false; } return true; }
Source:
public void setRange(int begin, int end) { this.end = end; int[] wholeRowGroup = ensureWholeRowGroupCapacity(end); if (positions == null || positions.length < end) { positions = new int[end]; } System.arraycopy(wholeRowGroup, begin, positions, 0, end - begin); int[] allZeroes = ensureAllZeroesCapacity(end); if (inputNumbers == null || inputNumbers.length < end - begin) { inputNumbers = Arrays.copyOf(allZeroes, end - begin); } else { System.arraycopy(allZeroes, 0, inputNumbers, 0, end - begin); } positionCount = end - begin; }

Target:
public void setRange(int begin, int end) { checkArgument(begin >= 0, "begin must not be negative"); checkArgument(begin < end, "begin must be less than end"); this.end = end; int[] wholeRowGroup = ensureWholeRowGroupCapacity(end); if (positions == null || positions.length < end - begin) { positions = new int[end]; } System.arraycopy(wholeRowGroup, begin, positions, 0, end - begin); int[] allZeroes = ensureAllZeroesCapacity(end); if (inputNumbers == null || inputNumbers.length < end - begin) { inputNumbers = Arrays.copyOf(allZeroes, end - begin); } else { System.arraycopy(allZeroes, begin, inputNumbers, 0, end - begin); } positionCount = end - begin; }
Source:
public Query<SegmentAnalysis> withOverriddenContext(Map<String, Object> contextOverride) { return new SegmentMetadataQuery( getDataSource(), getQuerySegmentSpec(), toInclude, merge, computeOverridenContext(contextOverride), isUsingDefaultInterval() ); }

Target:
public Query<SegmentAnalysis> withOverriddenContext(Map<String, Object> contextOverride) { return new SegmentMetadataQuery( getDataSource(), getQuerySegmentSpec(), toInclude, merge, computeOverridenContext(contextOverride), usingDefaultInterval ); }
Source:
public final String toString() { return new StringBuilder().append("Contact Id : ").append(contactId).append(",\n").append("Name : ").append(name) .append(",\n").append("HAS_PHONE_NUMBER : ").append(hasPhoneNumber).append(",\n").append("Contact Number : ") .append(listToString(contactNumberList)).append(",\n").append("EmailId : ").append(listToString(emailIdList)) .append(",\n").append("PhotoID : ").append(photoId).append(",\n").append("LogoID : ").append(logoId) .append("\n").toString(); }

Target:
public final String toString() { return new StringBuilder().append("Contact Id : ").append(contactId).append(",\n").append("Name : ").append(name) .append(",\n").append("HAS_PHONE_NUMBER : ").append(hasPhoneNumber).append(",\n").append("Contact Number : ") .append(contactNumberList.toString()).append(",\n").append("EmailId : ") .append(emailIdList.toString()).append(",\n").append("PhotoID : ").append(photoId).append("," + "" + "\n").append("LogoID : ").append(logoId) .append("\n").toString(); }
Source:
private static boolean doesLBHaveDrainSupport(Map<Object, Object> launchConfig) { if(launchConfig.get(InstanceConstants.FIELD_IMAGE_UUID) != null) { String imageUuid = (String)launchConfig.get(InstanceConstants.FIELD_IMAGE_UUID); Pair<String, String> instanceImage = getImageAndVersion(imageUuid.toLowerCase()); if (instanceImage.getLeft().isEmpty() || instanceImage.getRight().isEmpty()) { return false; } Pair<String, String> defaultImage = getImageAndVersion(LB_IMAGE_UUID.get().toLowerCase()); if (!defaultImage.getLeft().equalsIgnoreCase(instanceImage.getLeft())) { return false; } return isDrainProvider(instanceImage.getRight()); } return false; }

Target:
private static boolean doesLBHaveDrainSupport(Map<Object, Object> launchConfig) { if(launchConfig.get(InstanceConstants.FIELD_IMAGE_UUID) == null) { return false; } String imageUuid = (String)launchConfig.get(InstanceConstants.FIELD_IMAGE_UUID); Pair<String, String> instanceImage = getImageAndVersion(imageUuid.toLowerCase()); if (instanceImage.getLeft().isEmpty() || instanceImage.getRight().isEmpty()) { return false; } Pair<String, String> defaultImage = getImageAndVersion(LB_IMAGE_UUID.get().toLowerCase()); if (!defaultImage.getLeft().equals(instanceImage.getLeft())) { return false; } return isDrainProvider(instanceImage.getRight()); }
Source:
public Blob findOrCreateByPath(String tenantId, String path) { if (Strings.isEmpty(path)) { throw new IllegalArgumentException("An empty path was provided!"); } String cacheKey = tenantId + "-" + ensureRelativePath(path); return blobByPathCache.get(cacheKey, ignored -> fetchOrCreateByPath(tenantId, path)); }

Target:
public Blob findOrCreateByPath(String tenantId, String path) { if (Strings.isEmpty(path)) { throw new IllegalArgumentException("An empty path was provided!"); } return blobByPathCache.get(determinePathCacheKey(tenantId, path), ignored -> fetchOrCreateByPath(tenantId, path)); }
Source:
public List<String> getIndices() { return this.cacheManager.getCacheNames() .stream() .collect(toList()); }

Target:
public List<String> getIndices() { return new ArrayList<>(this.cacheManager.getCacheNames()); }
Source:
private String getVmEditedName() { if (!getVmNamesMap().containsKey(getEditedVmId())) { getVmNamesMap().put(getEditedVmId(), getEntity().getVm().getName()); } return getVmNamesMap().get(getEditedVmId()); }

Target:
private String getVmEditedName() { if (!vmNamesMap.containsKey(editedVmId)) { vmNamesMap.put(editedVmId, getEntity().getVm().getName()); } return vmNamesMap.get(editedVmId); }
Source:
public Envelope apply(Request webRequest) throws BadRequestException { String bboxParam = webRequest.queryParams("bbox"); if (bboxParam == null) { return null; } Envelope bbox = null; try { String[] bboxCoords = bboxParam.split(","); if (bboxCoords.length != 4) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } Double minLon = Double.valueOf(bboxCoords[0]); Double minLat = Double.valueOf(bboxCoords[2]); Double maxLon = Double.valueOf(bboxCoords[1]); Double maxLat = Double.valueOf(bboxCoords[3]); if (minLon > 180.0 || minLon < -180.00 || maxLon > 180.0 || maxLon < -180.00) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } if (minLat > 90.0 || minLat < -90.00 || maxLat > 90.0 || maxLat < -90.00) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } bbox = new Envelope(minLon, minLat, maxLon, maxLat); } catch (NumberFormatException nfe) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } return bbox; }

Target:
public Envelope apply(Request webRequest) throws BadRequestException { String bboxParam = webRequest.queryParams("bbox"); if (bboxParam == null) { return null; } Envelope bbox = null; try { String[] bboxCoords = bboxParam.split(","); if (bboxCoords.length != 4) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } Double minLon = Double.valueOf(bboxCoords[0]); Double minLat = Double.valueOf(bboxCoords[1]); Double maxLon = Double.valueOf(bboxCoords[2]); Double maxLat = Double.valueOf(bboxCoords[3]); if (minLon > 180.0 || minLon < -180.00 || maxLon > 180.0 || maxLon < -180.00) { throw new BadRequestException(400, INVALID_BBOX_BOUNDS_MESSAGE); } if (minLat > 90.0 || minLat < -90.00 || maxLat > 90.0 || maxLat < -90.00) { throw new BadRequestException(400, INVALID_BBOX_BOUNDS_MESSAGE); } bbox = new Envelope(minLon, maxLon, minLat, maxLat); } catch (NumberFormatException nfe) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } return bbox; }
Source:
public void insertExcessEnumMetric(Locator locator) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_EXCESS_ENUMS_NAME); try { AstyanaxIO.getKeyspace().prepareColumnMutation(CassandraModel.CF_METRICS_EXCESS_ENUMS, locator, 0L) .putEmptyColumn(null).execute(); } catch (ConnectionException e) { Instrumentation.markWriteError(e); Instrumentation.markExcessEnumWriteError(); LOG.error("Error writing ExcessEnum Metric", e); throw new IOException(e); } finally { ctx.stop(); } }

Target:
public void insertExcessEnumMetric(Locator locator) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_EXCESS_ENUMS_NAME); try { AstyanaxIO.getKeyspace().prepareColumnMutation(CassandraModel.CF_METRICS_EXCESS_ENUMS, locator, 0L) .putEmptyColumn(null).execute(); } catch (ConnectionException e) { Instrumentation.markWriteError(e); Instrumentation.markExcessEnumWriteError(); LOG.error("Error writing ExcessEnum Metric " + locator, e); throw new IOException(e); } finally { ctx.stop(); } }
Source:
public void saveSettings(@RequestBody SettingsDto settings) { String taskPossibleErrors = settings.getTaskPossibleErrors(); OutputStream os = new ByteArrayOutputStream(); try { settings.getTaskRetriesProps().store(os, "TaskRetries"); } catch (IOException e) { throw new MotechException("Error parsing task retries", e); } if (settings.isValid()) { settingsFacade.setProperty(TASK_POSSIBLE_ERRORS, taskPossibleErrors); settingsFacade.saveRawConfig(TASK_PROPERTIES_FILE_NAME, new String(os.toString())); } else { throw new IllegalArgumentException("Settings are not valid"); } }

Target:
public void saveSettings(@RequestBody SettingsDto settings) { String taskPossibleErrors = settings.getTaskPossibleErrors(); try(OutputStream os = new ByteArrayOutputStream()) { settings.getTaskRetriesProps().store(os, "TaskRetries"); if (settings.isValid()) { settingsFacade.setProperty(TASK_POSSIBLE_ERRORS, taskPossibleErrors); settingsFacade.saveRawConfig(TASK_PROPERTIES_FILE_NAME, new String(os.toString())); } else { throw new IllegalArgumentException("Settings are not valid"); } } catch (IOException e) { throw new MotechException("Error parsing task retries", e); } }
Source:
public void testBouncyCastleProviderIsUsableThroughJceApi() throws Exception { BouncyCastleProvider bcProvider = null; try { bcProvider = new BouncyCastleProvider(); useBouncyCastleProviderThroughJceApi(bcProvider); } catch (Exception e) { e.printStackTrace(); if (e instanceof SecurityException && e.getMessage().contains("JCE cannot authenticate the provider")) { String bcLocation = (bcProvider == null) ? "" : "(" + bcProvider.getClass().getProtectionDomain().getCodeSource().getLocation() + ")"; throw new Exception("Packaging with BouncyCastleProvider" + bcLocation + " is probably not properly signed for JCE usage, see server log for details.", e); } else { throw e; } } }

Target:
public void testBouncyCastleProviderIsUsableThroughJceApi() throws Exception { BouncyCastleProvider bcProvider = null; try { bcProvider = new BouncyCastleProvider(); useBouncyCastleProviderThroughJceApi(bcProvider); } catch (Exception e) { if (e instanceof SecurityException && e.getMessage().contains("JCE cannot authenticate the provider")) { String bcLocation = (bcProvider == null) ? "" : "(" + bcProvider.getClass().getProtectionDomain().getCodeSource().getLocation() + ")"; throw new Exception("Packaging with BouncyCastleProvider" + bcLocation + " is probably not properly signed for JCE usage, see server log for details.", e); } else { throw e; } } }
Source:
protected boolean matchesSafely(ValidationResult item) { final List<String> vr = item.getVariableReplacements(); return variableReplacements.length == vr.size() && vr.containsAll(Arrays.asList(variableReplacements)); }

Target:
protected boolean matchesSafely(ValidationResult item) { List<String> replacements = item.getVariableReplacements(); final List<String> vr = replacements == null ? Collections.<String>emptyList() : replacements; return variableReplacements.length == vr.size() && vr.containsAll(Arrays.asList(variableReplacements)); }
Source:
public List<CaseFileData> index(String name, Object variable) { List<CaseFileData> indexed = new ArrayList<CaseFileData>(); CaseFileDataLog caseVariable = new CaseFileDataLog(); caseVariable.setItemName(name); caseVariable.setItemValue(variable == null ? "" : variable.toString()); indexed.add(caseVariable); return indexed; }

Target:
public List<CaseFileData> index(String name, Object variable) { List<CaseFileData> indexed = new ArrayList<CaseFileData>(); CaseFileDataLog caseVariable = new CaseFileDataLog(); caseVariable.setItemName(name); caseVariable.setItemValue(variable == null ? "" : variable.toString()); caseVariable.setItemType(variable == null ? "" : variable.getClass().getName()); indexed.add(caseVariable); return indexed; }