auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Response add(VM vm) { validateParameters(vm, "name", "cluster.id|name"); validateEnums(VM.class, vm); Response response = null; if (isCreateFromSnapshot(vm)) { response = createVmFromSnapshot(vm); } else { validateParameters(vm, "template.id|name"); Guid templateId = getTemplateId(vm); VmStatic staticVm = getMapper(VM.class, VmStatic.class).map(vm, getMapper(VmTemplate.class, VmStatic.class).map(lookupTemplate(templateId), null)); if (namedCluster(vm)) { staticVm.setvds_group_id(getClusterId(vm)); } UsbPolicy usbPolicy = UsbResourceUtils.getUsbPolicy(vm.getUsb(), lookupCluster(staticVm.getvds_group_id())); if (usbPolicy != null) { staticVm.setusb_policy(usbPolicy); } if (!isFiltered()) { if (vm.isSetPlacementPolicy() && vm.getPlacementPolicy().isSetHost() && vm.getPlacementPolicy().getHost().isSetName() && !vm.getPlacementPolicy().getHost().isSetId()) { vm.getPlacementPolicy().getHost().setId(getHostId(vm.getPlacementPolicy().getHost().getName())); } } else { vm.setPlacementPolicy(null); } Guid storageDomainId = (vm.isSetStorageDomain() && vm.getStorageDomain().isSetId()) ? asGuid(vm.getStorageDomain().getId()) : Guid.Empty; if (isCreateFromSnapshot(vm)) { createVmFromSnapshot(vm); } else if (vm.isSetDisks() && vm.getDisks().isSetClone() && vm.getDisks().isClone()) { response = cloneVmFromTemplate(staticVm, vm, templateId); } else if (Guid.Empty.equals(templateId)) { response = addVmFromScratch(staticVm, vm, storageDomainId); } else { response = addVm(staticVm, vm, storageDomainId, templateId); } } return removeRestrictedInfoFromResponse(response); }

Target:
public Response add(VM vm) { validateParameters(vm, "name", "cluster.id|name"); validateEnums(VM.class, vm); Response response = null; if (isCreateFromSnapshot(vm)) { response = createVmFromSnapshot(vm); } else { validateParameters(vm, "template.id|name"); Guid templateId = getTemplateId(vm); VmStatic staticVm = getMapper(VM.class, VmStatic.class).map(vm, getMapper(VmTemplate.class, VmStatic.class).map(lookupTemplate(templateId), null)); if (namedCluster(vm)) { staticVm.setvds_group_id(getClusterId(vm)); } UsbPolicy usbPolicy = UsbResourceUtils.getUsbPolicy(vm.getUsb(), lookupCluster(staticVm.getvds_group_id())); if (usbPolicy != null) { staticVm.setusb_policy(usbPolicy); } if (!isFiltered()) { if (vm.isSetPlacementPolicy() && vm.getPlacementPolicy().isSetHost() && vm.getPlacementPolicy().getHost().isSetName() && !vm.getPlacementPolicy().getHost().isSetId()) { vm.getPlacementPolicy().getHost().setId(getHostId(vm.getPlacementPolicy().getHost().getName())); } } else { vm.setPlacementPolicy(null); } Guid storageDomainId = (vm.isSetStorageDomain() && vm.getStorageDomain().isSetId()) ? asGuid(vm.getStorageDomain().getId()) : Guid.Empty; if (vm.isSetDisks() && vm.getDisks().isSetClone() && vm.getDisks().isClone()) { response = cloneVmFromTemplate(staticVm, vm, templateId); } else if (Guid.Empty.equals(templateId)) { response = addVmFromScratch(staticVm, vm, storageDomainId); } else { response = addVm(staticVm, vm, storageDomainId, templateId); } } return removeRestrictedInfoFromResponse(response); }
Source:
private void dropLease() { Collection<KinesisClientLease> leases = leaseCoordinator.getAssignments(); if(leases != null && !leases.isEmpty()) { for(KinesisClientLease lease : leases) { if(lease.getLeaseKey().equals(shardInfo.getShardId())) { leaseCoordinator.dropLease(lease); LOG.warn("Dropped lease for shutting down ShardConsumer: " + lease.getLeaseKey()); break; } } } }

Target:
private void dropLease() { KinesisClientLease lease = leaseCoordinator.getCurrentlyHeldLease(shardInfo.getShardId()); leaseCoordinator.dropLease(lease); LOG.warn("Dropped lease for shutting down ShardConsumer: " + lease.getLeaseKey()); }
Source:
public static Scheduler computation() { synchronized (computationGuard) { if (computationScheduler == null) { Scheduler c = RxJavaPlugins.getInstance().getSchedulersHook().getComputationScheduler(); if (c != null) { computationScheduler = c; } else { computationScheduler = new EventLoopsScheduler(); } } return computationScheduler; } }

Target:
public static Scheduler computation() { Scheduler s = computationScheduler; if (s != null) { return s; } synchronized (computationGuard) { if (computationScheduler == null) { Scheduler c = RxJavaPlugins.getInstance().getSchedulersHook().getComputationScheduler(); if (c != null) { computationScheduler = c; } else { computationScheduler = new EventLoopsScheduler(); } } return computationScheduler; } }
Source:
private void setupHBaseDist() throws IOException { final Path downloadDirectory = tmp.newFolder("getOrDownload").toPath(); final Path hbaseArchive = downloadCache.getOrDownload(getHBaseDownloadUrl(), downloadDirectory); LOG.info("HBase localtion: {}", hbaseDir.toAbsolutePath()); AutoClosableProcess.runBlocking(CommandLineWrapper .tar(hbaseArchive) .extract() .zipped() .strip(1) .targetDir(hbaseDir) .build()); LOG.info("Configure as hbase.tmp.dir", hbaseDir.toAbsolutePath()); final String tmpDirConfig = "<configuration><property><name>hbase.tmp.dir</name><value>" + hbaseDir + "</value></property></configuration>"; Files.write(hbaseDir.resolve(Paths.get("conf", "hbase-site.xml")), tmpDirConfig.getBytes()); }

Target:
private void setupHBaseDist() throws IOException { final Path downloadDirectory = tmp.newFolder("getOrDownload").toPath(); final Path hbaseArchive = downloadCache.getOrDownload(getHBaseDownloadUrl(), downloadDirectory); LOG.info("HBase location: {}", hbaseDir.toAbsolutePath()); AutoClosableProcess.runBlocking(CommandLineWrapper .tar(hbaseArchive) .extract() .zipped() .strip(1) .targetDir(hbaseDir) .build()); LOG.info("Configure as hbase.tmp.dir", hbaseDir.toAbsolutePath()); final String tmpDirConfig = "<configuration><property><name>hbase.tmp.dir</name><value>" + hbaseDir + "</value></property></configuration>"; Files.write(hbaseDir.resolve(Paths.get("conf", "hbase-site.xml")), tmpDirConfig.getBytes()); }
Source:
private boolean shouldTrigger(Run upstreamBuild, TaskListener listener) { Jenkins jenkins = Jenkins.getInstance(); if (job == null) { return false; } boolean downstreamVisible = false; boolean downstreamDiscoverable = false; try { downstreamVisible = jenkins.getItemByFullName(job.getFullName()) == job; } catch (AccessDeniedException ex) { downstreamDiscoverable = true; } Authentication originalAuth = Jenkins.getAuthentication(); Job upstream = upstreamBuild.getParent(); Authentication auth = Tasks.getAuthenticationOf((Queue.Task) job); if (auth.equals(ACL.SYSTEM) && !QueueItemAuthenticatorConfiguration.get().getAuthenticators().isEmpty()) { auth = Jenkins.ANONYMOUS; } SecurityContext orig = ACL.impersonate(auth); Item authUpstream = null; try { authUpstream = jenkins.getItemByFullName(upstream.getFullName()); } catch (AccessDeniedException ade) { } finally { SecurityContextHolder.setContext(orig); } if(authUpstream != upstream) { if (downstreamVisible) { listener.getLogger().println(Messages.ReverseBuildTrigger_running_as_cannot_even_see_for_trigger_f(auth.getName(), upstream.getFullName(), job.getFullName())); } else { LOGGER.log(Level.WARNING, Messages.ReverseBuildTrigger_running_as_cannot_even_see_but_cannot_tell(auth.getName(), downstreamDiscoverable ? "READ" : "DISCOVER", upstream, job, originalAuth.getName())); } return false; } Result result = upstreamBuild.getResult(); return result != null && result.isBetterOrEqualTo(threshold); }

Target:
private boolean shouldTrigger(Run upstreamBuild, TaskListener listener) { Jenkins jenkins = Jenkins.getInstance(); if (job == null) { return false; } boolean downstreamVisible = false; boolean downstreamDiscoverable = false; try { downstreamVisible = jenkins.getItemByFullName(job.getFullName()) == job; } catch (AccessDeniedException ex) { downstreamDiscoverable = true; } Authentication originalAuth = Jenkins.getAuthentication(); Job upstream = upstreamBuild.getParent(); Authentication auth = Tasks.getAuthenticationOf((Queue.Task) job); if (auth.equals(ACL.SYSTEM) && !QueueItemAuthenticatorConfiguration.get().getAuthenticators().isEmpty()) { auth = Jenkins.ANONYMOUS; } SecurityContext orig = ACL.impersonate(auth); Item authUpstream = null; try { authUpstream = jenkins.getItemByFullName(upstream.getFullName()); } catch (AccessDeniedException ade) { } finally { SecurityContextHolder.setContext(orig); } if(authUpstream != upstream) { if (downstreamVisible) { listener.getLogger().println(Messages.ReverseBuildTrigger_running_as_cannot_even_see_for_trigger_f(auth.getName(), upstream.getFullName(), job.getFullName())); } else { LOGGER.log(Level.WARNING, "Running as {0} cannot even {1} {2} for trigger from {3}, (but cannot tell {4} that)", new Object { auth.getName(), downstreamDiscoverable ? "READ" : "DISCOVER", upstream, job, originalAuth.getName()}); } return false; } Result result = upstreamBuild.getResult(); return result != null && result.isBetterOrEqualTo(threshold); }
Source:
private void readSXSHD() throws NitfFormatException { TreCollection extendedSubheaderTREs = parsingStrategy.parseTREs(reader, graphicExtendedSubheaderLength - GraphicSegmentConstants.SXSOFL_LENGTH, TreSource.GraphicExtendedSubheaderData); segment.mergeTREs(extendedSubheaderTREs); }

Target:
private void readSXSHD() throws NitfFormatException { TreCollection extendedSubheaderTREs = parsingStrategy.parseTREs(reader, graphicExtendedSubheaderLength - SXSOFL_LENGTH, TreSource.GraphicExtendedSubheaderData); segment.mergeTREs(extendedSubheaderTREs); }
Source:
private int readByte() throws IOException, InvalidPacketException { long deadline = new Date().getTime() + 200; int b = inputStream.read(); while (b == -1 && new Date().getTime() < deadline) { b = inputStream.read(); try { Thread.sleep(10); } catch (InterruptedException e) } if (b == -1) throw new InvalidPacketException("Read -1 from stream."); if (mode == OperatingMode.API_ESCAPE) { if (SpecialByte.isSpecialByte(b)) { if (b == SpecialByte.ESCAPE_BYTE.getValue()) { deadline = new Date().getTime() + 200; b = inputStream.read(); while (b == -1 && new Date().getTime() < deadline) { b = inputStream.read(); try { Thread.sleep(10); } catch (InterruptedException e) } if (b == -1) throw new InvalidPacketException("Read -1 from stream."); b ^= 0x20; } else { } } } if (lengthRead) { checksum.add(b); readBytes += 1; if (readBytes >= length + 1) { if (!checksum.validate()) throw new InvalidPacketException("Error verifying packet checksum."); } } return b; }

Target:
private int readByte() throws IOException, InvalidPacketException { long deadline = new Date().getTime() + 200; int b = inputStream.read(); while (b == -1 && new Date().getTime() < deadline) { b = inputStream.read(); try { Thread.sleep(10); } catch (InterruptedException e) } if (b == -1) throw new InvalidPacketException("Error parsing packet: Incomplete packet."); if (mode == OperatingMode.API_ESCAPE) { if (SpecialByte.isSpecialByte(b)) { if (b == SpecialByte.ESCAPE_BYTE.getValue()) { deadline = new Date().getTime() + 200; b = inputStream.read(); while (b == -1 && new Date().getTime() < deadline) { b = inputStream.read(); try { Thread.sleep(10); } catch (InterruptedException e) } if (b == -1) throw new InvalidPacketException("Error parsing packet: Incomplete packet."); b ^= 0x20; } else { throw new InvalidPacketException("Expecting a " + SpecialByte.ESCAPE_BYTE.getValue() + ", but got " + b); } } } if (lengthRead) { checksum.add(b); readBytes += 1; if (readBytes >= length + 1) { if (!checksum.validate()) throw new InvalidPacketException("Error verifying packet checksum."); } } return b; }
Source:
private void registerPaxosResource() { paxosResources.resourcesForRegistration().forEach(registrar); }

Target:
private void registerPaxosResource() { paxosResources.resourcesForRegistration().forEach(registrar::accept); }
Source:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command == getRemoveCommand()) { remove(); } else if ("Cancel".equals(command.getName())) { cancel(); } }

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command == getRemoveCommand()) { remove(); } }
Source:
public void deleteWireConfiguration(final WireConfiguration wireConfiguration) { requireNonNull(wireConfiguration, s_message.wireConfigurationNonNull()); s_logger.info(s_message.removingWires()); try { final Wire[] wiresList = this.wireAdmin.getWires(null); if (wiresList != null) { for (final Wire wire : wiresList) { final Dictionary<?, ?> props = wire.getProperties(); final String producerPid = props.get(WIREADMIN_PRODUCER_PID).toString(); final String consumerPid = props.get(WIREADMIN_CONSUMER_PID).toString(); final String emitterFactoryPid = this.wireHelperService .getServicePid(wireConfiguration.getEmitterPid()); final String receiverFactoryPid = this.wireHelperService .getServicePid(wireConfiguration.getReceiverPid()); if ((emitterFactoryPid != null) && (receiverFactoryPid != null) && producerPid.equals(emitterFactoryPid) && consumerPid.equals(receiverFactoryPid)) { synchronized (this.wireConfigs) { for (final Iterator<WireConfiguration> iter = this.wireConfigs.iterator(); iter .hasNext();) { final WireConfiguration configuration = iter.next(); if (configuration.equals(wireConfiguration)) { iter.remove(); this.wireAdmin.deleteWire(wire); break; } } } } } } } catch (final InvalidSyntaxException e) { throw new IllegalArgumentException(ThrowableUtil.stackTraceAsString(e)); } s_logger.info(s_message.removingWiresDone()); }

Target:
public void deleteWireConfiguration(final WireConfiguration wireConfiguration) { requireNonNull(wireConfiguration, message.wireConfigurationNonNull()); logger.info(message.removingWires()); try { final Wire[] wiresList = this.wireAdmin.getWires(wireConfiguration.getFilter()); if (wiresList != null) { for (final Wire wire : wiresList) { final Dictionary<?, ?> props = wire.getProperties(); final String producerPid = props.get(WIREADMIN_PRODUCER_PID).toString(); final String consumerPid = props.get(WIREADMIN_CONSUMER_PID).toString(); final String emitterFactoryPid = this.wireHelperService .getServicePid(wireConfiguration.getEmitterPid()); final String receiverFactoryPid = this.wireHelperService .getServicePid(wireConfiguration.getReceiverPid()); if ((emitterFactoryPid != null) && (receiverFactoryPid != null) && producerPid.equals(emitterFactoryPid) && consumerPid.equals(receiverFactoryPid)) { synchronized (this.wireConfigs) { for (final Iterator<WireConfiguration> iter = this.wireConfigs.iterator(); iter .hasNext();) { final WireConfiguration configuration = iter.next(); if (configuration.equals(wireConfiguration)) { iter.remove(); this.wireAdmin.deleteWire(wire); break; } } } } } } } catch (final InvalidSyntaxException ise) { throw new IllegalArgumentException(ise); } logger.info(message.removingWiresDone()); }
Source:
public void setUnlogged(String user) { String sql = "UPDATE " + tableName + " SET " + col.IS_LOGGED + "=? WHERE LOWER(" + col.NAME + ")=?;"; if (user != null) { try (PreparedStatement pst = con.prepareStatement(sql)) { pst.setInt(1, 0); pst.setString(2, user); pst.executeUpdate(); } catch (SQLException ex) { logSqlException(ex); } } }

Target:
public void setUnlogged(String user) { String sql = "UPDATE " + tableName + " SET " + col.IS_LOGGED + "=? WHERE LOWER(" + col.NAME + ")=?;"; try (PreparedStatement pst = con.prepareStatement(sql)) { pst.setInt(1, 0); pst.setString(2, user); pst.executeUpdate(); } catch (SQLException ex) { logSqlException(ex); } }
Source:
public Validation validate(Validation val) { if (SystemEnvironment.getProperty("jetty.home", "").equals("")) { new SystemEnvironment().setProperty("jetty.home", new SystemEnvironment().getPropertyImpl("user.dir")); new SystemEnvironment().setProperty("jetty.base", new SystemEnvironment().getPropertyImpl("user.dir")); } File home = new File(new SystemEnvironment().getPropertyImpl("jetty.home")); File work = new File(new SystemEnvironment().getPropertyImpl("jetty.home"), "work"); if (home.exists()) { if (work.exists()) { try { FileUtils.deleteDirectory(work); } catch (IOException e) { String message = format("Error trying to remove Jetty working directory {0}: {1}", work.getAbsolutePath(), e); return val.addError(new RuntimeException(message)); } } work.mkdir(); } return Validation.SUCCESS; }

Target:
public Validation validate(Validation val) { SystemEnvironment systemEnvironment = new SystemEnvironment(); if (SystemEnvironment.getProperty("jetty.home", "").equals("")) { systemEnvironment.setProperty("jetty.home", systemEnvironment.getPropertyImpl("user.dir")); } systemEnvironment.setProperty("jetty.base", systemEnvironment.getPropertyImpl("jetty.home")); File home = new File(systemEnvironment.getPropertyImpl("jetty.home")); File work = new File(systemEnvironment.getPropertyImpl("jetty.home"), "work"); if (home.exists()) { if (work.exists()) { try { FileUtils.deleteDirectory(work); } catch (IOException e) { String message = format("Error trying to remove Jetty working directory {0}: {1}", work.getAbsolutePath(), e); return val.addError(new RuntimeException(message)); } } work.mkdir(); } return Validation.SUCCESS; }
Source:
private URL deploymentOne() throws Throwable { System.out.println("deployment"); return new URL("<LINK_0>"); }

Target:
private URL deploymentOne() throws Throwable { return new URL("<LINK_0>"); }
Source:
public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null) { if (Utils.isOreoOrLater()) { Notification notification = new NotificationCompat.Builder(this, ALERT_CHANNEL_ID) .setContentTitle("Update alerts") .setSmallIcon(R.drawable.stat_notify_calendar) .setShowWhen(false) .build(); startForeground(1337, notification); } Message msg = mServiceHandler.obtainMessage(); msg.arg1 = startId; msg.obj = intent.getExtras(); mServiceHandler.sendMessage(msg); } return START_REDELIVER_INTENT; }

Target:
public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null) { if (Utils.isOreoOrLater()) { Notification notification = new NotificationCompat.Builder(this, ALERT_CHANNEL_ID) .setContentTitle("Event notifications") .setSmallIcon(R.drawable.stat_notify_calendar) .setShowWhen(false) .build(); startForeground(1337, notification); } Message msg = mServiceHandler.obtainMessage(); msg.arg1 = startId; msg.obj = intent.getExtras(); mServiceHandler.sendMessage(msg); } return START_REDELIVER_INTENT; }
Source:
public List<InsightCard> getInsights(@Scope(OAuthScope.INSIGHTS_READ) final AccessToken accessToken) { LOGGER.debug("Returning list of insights for account id = {}", accessToken.accountId); final Boolean chronological = false; final DateTime queryDate = DateTime.now(DateTimeZone.UTC).plusDays(1); final ImmutableList<InsightCard> cards = insightsDAODynamoDB.getInsightsByDate(accessToken.accountId, queryDate, chronological, MAX_INSIGHTS_NUM); if (cards.size() == 0) { final Optional<Account> optionalAccount = accountDAO.getById(accessToken.accountId); int userAgeInYears = 0; if (optionalAccount.isPresent()) { userAgeInYears = DateTimeUtil.getDateDiffFromNowInDays(optionalAccount.get().DOB) / 365; } final List<InsightCard> introCards = GenericInsights.getIntroCards(accessToken.accountId, userAgeInYears); for (InsightCard card : introCards) { this.insightsDAODynamoDB.insertInsight(card); } return introCards; } return cards; }

Target:
public List<InsightCard> getInsights(@Scope(OAuthScope.INSIGHTS_READ) final AccessToken accessToken) { LOGGER.debug("Returning list of insights for account id = {}", accessToken.accountId); final Boolean chronological = false; final DateTime queryDate = DateTime.now(DateTimeZone.UTC).plusDays(1); final ImmutableList<InsightCard> cards = insightsDAODynamoDB.getInsightsByDate(accessToken.accountId, queryDate, chronological, MAX_INSIGHTS_NUM); if (cards.size() == 0) { final Optional<Account> optionalAccount = accountDAO.getById(accessToken.accountId); int userAgeInYears = 0; if (optionalAccount.isPresent()) { userAgeInYears = DateTimeUtil.getDateDiffFromNowInDays(optionalAccount.get().DOB) / 365; } final List<InsightCard> introCards = IntroductionInsights.getIntroCards(accessToken.accountId, userAgeInYears); this.insightsDAODynamoDB.insertListOfInsights(introCards); return introCards; } return cards; }
Source:
public Boolean deleteLoanRepayment(String accountId, String repaymentId) throws MambuApiException { if (accountId == null && repaymentId == null) { throw new IllegalArgumentException("Account ID and Repayment ID must not be null!"); } return serviceExecutor.deleteOwnedEntity(MambuEntityType.LOAN_ACCOUNT, accountId, MambuEntityType.REPAYMENTS, repaymentId); }

Target:
public Boolean deleteLoanRepayment(String accountId, String repaymentId) throws MambuApiException { if (accountId == null || repaymentId == null) { throw new IllegalArgumentException("Account ID and Repayment ID must not be null!"); } return serviceExecutor.deleteOwnedEntity(MambuEntityType.LOAN_ACCOUNT, accountId, MambuEntityType.REPAYMENTS, repaymentId); }
Source:
private void setupMouseEvents() { setOnMouseClicked(e -> { int currentlySelected = getSelectionModel().getSelectedIndex(); if (currentlySelected != -1) { selectedIndex = Optional.of(currentlySelected); logger.info("Mouse click on item index " + selectedIndex.get()); if (e.getButton().equals(MouseButton.SECONDARY)){ triggerItemSelectedSecondary(selectedIndex.get()); } else { triggerItemSelected(selectedIndex.get()); } } }); }

Target:
private void setupMouseEvents() { setOnMouseClicked(e -> { int currentlySelected = getSelectionModel().getSelectedIndex(); if (currentlySelected != -1) { selectedIndex = Optional.of(currentlySelected); logger.info("Mouse click on item index " + selectedIndex.get()); onItemSelected.accept(selectedIndex.get()); } }); }
Source:
public void testWriteFlushesIfAboveThreshold() throws IOException { int fileSizeThreshold = 100; final FsCheckpointStreamFactory factory = createFactory(FileSystem.getLocalFileSystem(), fileSizeThreshold, fileSizeThreshold); final FsCheckpointStreamFactory.FsCheckpointStateOutputStream stream = factory.createCheckpointStateOutputStream(CheckpointedStateScope.EXCLUSIVE); stream.write(new byte[fileSizeThreshold]); File[] files = new File(exclusiveStateDir.toUri()).listFiles(); assertEquals(1, files.length); File file = files[0]; assertEquals(fileSizeThreshold, file.length()); for (int i = 0; i < fileSizeThreshold; i++) { stream.write(127); } assertEquals(fileSizeThreshold, file.length()); }

Target:
public void testWriteFlushesIfAboveThreshold() throws IOException { int fileSizeThreshold = 100; final FsCheckpointStreamFactory factory = createFactory(FileSystem.getLocalFileSystem(), fileSizeThreshold, fileSizeThreshold); final FsCheckpointStreamFactory.FsCheckpointStateOutputStream stream = factory.createCheckpointStateOutputStream(CheckpointedStateScope.EXCLUSIVE); stream.write(new byte[fileSizeThreshold]); File[] files = new File(exclusiveStateDir.toUri()).listFiles(); assertEquals(1, files.length); File file = files[0]; assertEquals(fileSizeThreshold, file.length()); stream.write(new byte[fileSizeThreshold - 1]); stream.write(127); assertEquals(fileSizeThreshold, file.length()); }
Source:
public GoGoDuckProcess(WPSResourceManager resourceManager, HttpNotifier httpNotifier, Catalog catalog, GeoServerResourceLoader resourceLoader, GeoServer geoserver) { super(resourceManager, httpNotifier, geoserver); this.catalog = catalog; this.resourceLoader = resourceLoader; URLMangler.setUrlManglingMap(getConfigMap("/ncwms/urlSubstitution")); }

Target:
public GoGoDuckProcess(WPSResourceManager resourceManager, HttpNotifier httpNotifier, Catalog catalog, GeoServerResourceLoader resourceLoader, GeoServer geoserver) { super(resourceManager, httpNotifier, geoserver); this.catalog = catalog; this.resourceLoader = resourceLoader; URLMangler.setUrlManglingMap(getConfigMap("/gogoduck/urlSubstitution")); }
Source:
protected boolean isArchitectureUpdatable(Cluster group) { if (group.getCompatibilityVersion() != getParameters().getCluster().getCompatibilityVersion() && cpuFlagsManagerHandler.checkIfCpusExist(group.getCpuName(), group.getCompatibilityVersion()) && !cpuFlagsManagerHandler.checkIfCpusExist(group.getCpuName(), getParameters().getCluster().getCompatibilityVersion())) { return true; } return oldCluster.getArchitecture() == ArchitectureType.undefined ? true : getArchitecture() == oldCluster.getArchitecture(); }

Target:
protected boolean isArchitectureUpdatable(Cluster group) { if (!group.getCompatibilityVersion().equals(getParameters().getCluster().getCompatibilityVersion()) && ((cpuFlagsManagerHandler.checkIfCpusExist(group.getCpuName(), group.getCompatibilityVersion()) && !cpuFlagsManagerHandler.checkIfCpusExist(group.getCpuName(), getParameters().getCluster().getCompatibilityVersion())) || !cpuFlagsManagerHandler.checkIfCpusExist(getCluster().getCpuName(), getParameters().getCluster().getCompatibilityVersion()))) { return true; } return oldCluster.getArchitecture() == ArchitectureType.undefined ? true : getArchitecture() == oldCluster.getArchitecture(); }
Source:
public Tk103Protocol() { super("tk103"); setSupportedDataCommands( Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, Command.TYPE_POSITION_STOP, Command.TYPE_GET_VERSION, Command.TYPE_REBOOT_DEVICE, Command.TYPE_SET_ODOMETER, Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME, "T580W_positionSingle", "T580W_positionRealtime", "T580W_positionRealtimeStop", "T580W_modeDeepSleepInterval1Hour", "T580W_modeDeepSleepInterval2Hour", "T580W_modeDeepSleepInterval3Hour", "T580W_modeDeepSleepInterval4Hour", "T580W_modeDeepSleepMotion", "T580W_modeDeepSleepOff", "T580W_alarmSosOn", "T580W_alarmSosOff", "T580W_multiControllerOn", "T580W_multiControllerOff", "T580W_rebootDevice"); }

Target:
public Tk103Protocol() { super("tk103"); setSupportedDataCommands( Command.TYPE_CUSTOM, Command.TYPE_GET_DEVICE_STATUS, Command.TYPE_IDENTIFICATION, Command.TYPE_MODE_DEEP_SLEEP, Command.TYPE_MODE_POWER_SAVING, Command.TYPE_ALARM_SOS, Command.TYPE_SET_CONNECTION, Command.TYPE_SOS_NUMBER, Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, Command.TYPE_POSITION_STOP, Command.TYPE_GET_VERSION, Command.TYPE_REBOOT_DEVICE, Command.TYPE_SET_ODOMETER, Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME); }
Source:
void allStoppped() throws Exception { setUp(2); setUpFreeIpaAvailabilityResponse(false); when(stackInstanceProviderChecker.checkStatus(stack, notTerminatedInstances)).thenReturn(List.of( createCloudVmInstanceStatus(INSTANCE_1, com.sequenceiq.cloudbreak.cloud.model.InstanceStatus.STOPPED), createCloudVmInstanceStatus(INSTANCE_1, com.sequenceiq.cloudbreak.cloud.model.InstanceStatus.STOPPED) )); underTest.executeInternal(jobExecutionContext); verify(stackUpdater).updateStackStatus(eq(stack), eq(DetailedStackStatus.STOPPED), any()); }

Target:
void allStoppped() throws Exception { setUp(2); setUpFreeIpaAvailabilityResponse(false); when(stackInstanceProviderChecker.checkStatus(stack, notTerminatedInstances)).thenReturn(List.of( createCloudVmInstanceStatus(INSTANCE_1, com.sequenceiq.cloudbreak.cloud.model.InstanceStatus.STOPPED), createCloudVmInstanceStatus(INSTANCE_2, com.sequenceiq.cloudbreak.cloud.model.InstanceStatus.STOPPED) )); underTest.executeInternal(jobExecutionContext); verify(stackUpdater).updateStackStatus(eq(stack), eq(DetailedStackStatus.STOPPED), any()); }
Source:
public void setup() { Ignition.start(getConfiguration("srv1", false)); Ignition.start(getConfiguration("srv2", false)); Ignition.start(getConfiguration(IGNITE_CLIENT_INSTANCE_NAME, true)); }

Target:
public void setup() { int cnt = gridCnt(); for (int i = 0; i < cnt; i++) Ignition.start(getConfiguration("srv" + i, false)); Ignition.start(getConfiguration(IGNITE_CLIENT_INSTANCE_NAME, true)); }
Source:
public FileItem getMediaFileItemFromFormManager(String fileLink, CrfBean crf, CrfVersion crfVersion) { RestTemplate restTemplate = new RestTemplate(); restTemplate.getMessageConverters().add(new ByteArrayHttpMessageConverter()); HttpHeaders headers = new HttpHeaders(); headers.setAccept(Arrays.asList(MediaType.APPLICATION_OCTET_STREAM)); HttpEntity<String> entity = new HttpEntity<String>(headers); ResponseEntity<byte[]> response = restTemplate.exchange(fileLink, HttpMethod.GET, entity, byte[].class, "1"); FileItem fileItem = null; if (response.getStatusCode() == HttpStatus.OK) { String fileName = ""; try { String disposition = response.getHeaders().get("Content-Disposition").get(0); fileName = disposition.replaceFirst("(?i)^.*filename=\"([^\"]+)\".*$", "$1"); String dir = Utils.getCrfMediaFilePath(crf, crfVersion); if (!new File(dir).exists()) { new File(dir).mkdirs(); logger.debug("Made the directory " + dir); } File file = new File(dir + fileName); FileOutputStream output = new FileOutputStream(file); IOUtils.write(response.getBody(), output); fileItem = new DiskFileItem("media_file", response.getHeaders().get("Content-Type").get(0), false, fileName, 100000000, file); } catch (IOException e) { e.printStackTrace(); } } return fileItem; }

Target:
public FileItem getMediaFileItemFromFormManager(String fileLink, CrfBean crf, CrfVersion crfVersion) { RestTemplate restTemplate = new RestTemplate(); restTemplate.getMessageConverters().add(new ByteArrayHttpMessageConverter()); HttpHeaders headers = new HttpHeaders(); headers.setAccept(Arrays.asList(MediaType.APPLICATION_OCTET_STREAM)); HttpEntity<String> entity = new HttpEntity<String>(headers); ResponseEntity<byte[]> response = restTemplate.exchange(fileLink, HttpMethod.GET, entity, byte[].class, "1"); FileItem fileItem = null; if (response.getStatusCode() == HttpStatus.OK) { String fileName = ""; FileOutputStream output = null; try { String disposition = response.getHeaders().get("Content-Disposition").get(0); fileName = disposition.replaceFirst("(?i)^.*filename=\"([^\"]+)\".*$", "$1"); String dir = Utils.getCrfMediaFilePath(crf, crfVersion); if (!new File(dir).exists()) { new File(dir).mkdirs(); logger.debug("Made the directory " + dir); } File file = new File(dir + fileName); output = new FileOutputStream(file); IOUtils.write(response.getBody(), output); fileItem = new DiskFileItem("media_file", response.getHeaders().get("Content-Type").get(0), false, fileName, 100000000, file); } catch (IOException e) { e.printStackTrace(); } finally { try { if (output != null) { output.close(); } } catch (IOException e) { e.printStackTrace(); } } } return fileItem; }
Source:
protected Value<DyeColor> constructValue(DyeColor actualValue) { return SpongeValueFactory.getInstance().createValue(Keys.DYE_COLOR, actualValue, DyeColors.PURPLE); }

Target:
protected Value<DyeColor> constructValue(DyeColor actualValue) { return new SpongeValue<>(Keys.DYE_COLOR, DyeColors.PURPLE, actualValue); }
Source:
private String extractSnapshotId(String filename, String version, String type, String classifier) { if (version == null) return null; String front = version.substring(0, version.indexOf("-SNAPSHOT")); String back = "." + type; if (classifier != null) { back = "-" + classifier + back; } int idx1 = filename.indexOf(front) + front.length() + 1; int idx2 = filename.indexOf(back); if (idx1 > 0 && idx1 < filename.length() && idx2 > 0 && idx2 < filename.length()) { return filename.substring(idx1, idx2); } else { return null; } }

Target:
private String extractSnapshotId(String filename, String version, String type, String classifier) { if (version == null) { return null; } String front = version.substring(0, version.indexOf("-SNAPSHOT")); String back = "." + type; if (classifier != null) { back = "-" + classifier + back; } int idx1 = filename.indexOf(front) + front.length() + 1; int idx2 = filename.indexOf(back); if (idx1 > 0 && idx1 < filename.length() && idx2 > 0 && idx2 < filename.length()) { return filename.substring(idx1, idx2); } else { return null; } }
Source:
public Response getInstallers(@ApiParam(value = "Max items") @QueryParam("maxItems") @DefaultValue("30") int maxItems, @ApiParam(value = "Skip count") @QueryParam("skipCount") @DefaultValue("0") int skipCount) throws InstallerException, BadRequestException { try { Page<? extends Installer> installers = installerRegistry.getInstallers(maxItems, skipCount); return Response.ok() .entity(installers.getItems()) .header("Link", createLinkHeader(installers)) .header("TotalItemsCount", installers.getTotalItemsCount()) .build(); } catch (IllegalArgumentException e) { throw new BadRequestException(e.getMessage()); } }

Target:
public Response getInstallers(@ApiParam(value = "Max items") @QueryParam("maxItems") @DefaultValue("30") int maxItems, @ApiParam(value = "Skip count") @QueryParam("skipCount") @DefaultValue("0") int skipCount) throws InstallerException, BadRequestException { try { Page<? extends Installer> installers = installerRegistry.getInstallers(maxItems, skipCount); return Response.ok() .entity(installers.getItems()) .header("Link", createLinkHeader(installers)) .header(TOTAL_ITEMS_COUNT_HEADER, installers.getTotalItemsCount()) .build(); } catch (IllegalArgumentException e) { throw new BadRequestException(e.getMessage()); } }
Source:
private List<List<Integer>> buildSortedAvailableInputs() { final SortedMap<Integer, List<Integer>> orderedAvailableInputIds = new TreeMap<>(); for (InputSpec inputSpec : inputSpecs) { List<Integer> inputIds = orderedAvailableInputIds .computeIfAbsent(inputSpec.getReadOrder(), k -> new ArrayList<>()); inputIds.add(inputSpec.getMultipleInputId()); } return new ArrayList<>(orderedAvailableInputIds.values()); }

Target:
private List<List<Integer>> buildSortedAvailableInputs() { final SortedMap<Integer, List<Integer>> orderedAvailableInputIds = new TreeMap<>(); for (InputSpec inputSpec : inputSpecs) { List<Integer> inputIds = orderedAvailableInputIds .computeIfAbsent(inputSpec.getReadOrder(), k -> new LinkedList<>()); inputIds.add(inputSpec.getMultipleInputId()); } return new LinkedList<>(orderedAvailableInputIds.values()); }
Source:
public Iterable<Header> getHeaders() { if (headers == null) { headers = new ArrayList<>(); } return headers; }

Target:
public Iterable<Header> getHeaders() { if (headers == null) { return Collections.emptyList(); } return headers; }
Source:
public FunctionExpression create(List<Expression> children, StatementContext context) throws SQLException { assert children.size() == 0; PTable table = context.getCurrentTable().getTable(); byte[] emptyColumnFamilyName = SchemaUtil.getEmptyColumnFamily(table); byte[] emptyColumnName = table.getEncodingScheme() == PTable.QualifierEncodingScheme.NON_ENCODED_QUALIFIERS ? QueryConstants.EMPTY_COLUMN_BYTES : table.getEncodingScheme().encode(QueryConstants.ENCODED_EMPTY_COLUMN_NAME); List<Expression> emptyColumnExpression = Arrays.asList(new Expression[] {new KeyValueColumnExpression(new PDatum() { @Override public boolean isNullable() { return true; } @Override public PDataType getDataType() { return PDate.INSTANCE; } @Override public Integer getMaxLength() { return null; } @Override public Integer getScale() { return null; } @Override public SortOrder getSortOrder() { return SortOrder.getDefault(); } }, emptyColumnFamilyName, emptyColumnName)}); IndexUtil.addEmptyColumnToScan(context.getScan(), emptyColumnFamilyName, emptyColumnName); return new PhoenixRowTimestampFunction(emptyColumnExpression, emptyColumnFamilyName, emptyColumnName); }

Target:
public FunctionExpression create(List<Expression> children, StatementContext context) throws SQLException { if (children.size() != 0) { throw new IllegalArgumentException( "PhoenixRowTimestampFunction does not take any parameters" ); } PTable table = context.getCurrentTable().getTable(); byte[] emptyColumnFamilyName = SchemaUtil.getEmptyColumnFamily(table); byte[] emptyColumnName = table.getEncodingScheme() == PTable.QualifierEncodingScheme.NON_ENCODED_QUALIFIERS ? QueryConstants.EMPTY_COLUMN_BYTES : table.getEncodingScheme().encode(QueryConstants.ENCODED_EMPTY_COLUMN_NAME); Expression emptyColumnExpression = new KeyValueColumnExpression(new PDatum() { @Override public boolean isNullable() { return false; } @Override public PDataType getDataType() { return PDate.INSTANCE; } @Override public Integer getMaxLength() { return null; } @Override public Integer getScale() { return null; } @Override public SortOrder getSortOrder() { return SortOrder.getDefault(); } }, emptyColumnFamilyName, emptyColumnName); List<Expression> expressionList = Arrays.asList(new Expression[] {emptyColumnExpression}); context.getScan().addColumn(emptyColumnFamilyName, emptyColumnName); return new PhoenixRowTimestampFunction(expressionList); }
Source:
public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) { if (!(e instanceof RuntimeException)) { return PASS_TO_NEXT_RESOLVER; } int httpStatusCode = AnnotationUtils.isAnnotationDeclaredLocally(ResponseStatus.class, e.getClass()) ? AnnotationUtils.findAnnotation(e.getClass(), ResponseStatus.class).value().value() : HttpServletResponse.SC_INTERNAL_SERVER_ERROR; String errorMessageKey = errorMessageKeyMap.getOrDefault(e.getClass(), TECHNICAL_ERROR_MESSAGE_KEY); String errorMessage = messageKeyResolver.resolveMessageOrDefault(errorMessageKey); httpServletResponse.setStatus(httpStatusCode); httpServletRequest.setAttribute(WebUtils.ERROR_STATUS_CODE_ATTRIBUTE, httpStatusCode); httpServletRequest.setAttribute(WebUtils.ERROR_MESSAGE_ATTRIBUTE, errorMessage); if (!RequestInspector.isAjaxRequest(httpServletRequest)) { return new ModelAndView(ERROR_VIEW_NAME); } else { RestResponse restResponse = new RestResponse(e.getMessage()); ModelAndView modelAndView = new ModelAndView(jsonView); modelAndView.addObject("errorMessage", restResponse.getErrorMessage()); modelAndView.addObject("fields", restResponse.getFields()); return modelAndView; } }

Target:
public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) { if (!(e instanceof RuntimeException)) { return PASS_TO_NEXT_RESOLVER; } int httpStatusCode = getHttpStatusCodeForException(e.getClass()); httpServletResponse.setStatus(httpStatusCode); if (!RequestInspector.isAjaxRequest(httpServletRequest)) { ModelAndView modelAndView = new ModelAndView(ERROR_VIEW_NAME); String errorMessage = messageKeyResolver.resolveMessageOrDefault(TECHNICAL_ERROR_MESSAGE_KEY); modelAndView.addObject(WebUtils.ERROR_STATUS_CODE_ATTRIBUTE, httpStatusCode); modelAndView.addObject(WebUtils.ERROR_MESSAGE_ATTRIBUTE, errorMessage); return modelAndView; } else { RestResponse restResponse = new RestResponse(e.getMessage()); ModelAndView modelAndView = new ModelAndView(jsonView); modelAndView.addObject("errorMessage", restResponse.getErrorMessage()); modelAndView.addObject("fields", restResponse.getFields()); return modelAndView; } }
Source:
public void cect_PairingActivity_OneTouchPlay() throws Exception { ITestDevice device = getDevice(); device.executeShellCommand(START_COMMAND + ACTION_CONNECT_INPUT_NORMAL); hdmiCecClient.checkExpectedOutput(CecDevice.TV, CecMessage.TEXT_VIEW_ON); String message = hdmiCecClient.checkExpectedOutput(CecMessage.ACTIVE_SOURCE); assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(PHYSICAL_ADDRESS); }

Target:
public void cect_PairingActivity_OneTouchPlay() throws Exception { ITestDevice device = getDevice(); device.reboot(); device.executeShellCommand(START_COMMAND + ACTION_CONNECT_INPUT_NORMAL); hdmiCecClient.checkExpectedOutput(CecDevice.TV, CecMessage.TEXT_VIEW_ON); String message = hdmiCecClient.checkExpectedOutput(CecMessage.ACTIVE_SOURCE); assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(PHYSICAL_ADDRESS); device.executeShellCommand(FORCE_STOP_COMMAND + SETTINGS_PACKAGE); }
Source:
protected Object run(String[] args) throws Exception { if (args != null) fArgs = args; fTestableObject = PlatformUI.getTestableObject(); fTestableObject.setTestHarness(this); try { Object application = getApplicationToRun(args); if (application == null) { return Integer.valueOf(200); } String timeoutParameter = getParameterValue(args, "-timeout"); if (timeoutParameter != null) { DumpStackTracesTimer.startStackDumpTimeoutTimer(timeoutParameter); } runApplication(application, args); } catch (Exception e) { if (fTestRunnerResult == -1) { throw e; } System.err.println("Caught unexpected exception during test framework shutdown"); e.printStackTrace(); } return Integer.valueOf(fTestRunnerResult); }

Target:
protected Object run(String[] args) throws Exception { if (args != null) fArgs = args; fTestableObject = PlatformUI.getTestableObject(); fTestableObject.setTestHarness(this); try { Object application = getApplicationToRun(args); if (application == null) { return Integer.valueOf(200); } runApplication(application, args); } catch (Exception e) { if (fTestRunnerResult == -1) { throw e; } System.err.println("Caught unexpected exception during test framework shutdown"); e.printStackTrace(); } return Integer.valueOf(fTestRunnerResult); }
Source:
@Override public ClientConnection open(InetSocketAddress addr, ClientMessageHandler msgHnd, ClientConnectionStateHandler stateHnd) throws ClientConnectionException { try { java.nio.channels.SocketChannel ch = java.nio.channels.SocketChannel.open(); ch.socket().connect(new InetSocketAddress(addr.getHostName(), addr.getPort()), Integer.MAX_VALUE); Map<Integer, Object> meta = new HashMap<>(); GridNioFuture<?> sslHandshakeFut = null; if (sslCtx != null) { sslHandshakeFut = new GridNioFutureImpl<>(null); meta.put(GridNioSslFilter.HANDSHAKE_FUT_META_KEY, sslHandshakeFut); } GridNioSession ses = srv.createSession(ch, meta, false, null).get(); if (sslHandshakeFut != null) sslHandshakeFut.get(); return new GridNioClientConnection(ses, msgHnd, stateHnd); } catch (Exception e) { throw new ClientConnectionException(e.getMessage(), e); } }

Target:
@Override public ClientConnection open(InetSocketAddress addr, ClientMessageHandler msgHnd, ClientConnectionStateHandler stateHnd) throws ClientConnectionException { try { SocketChannel ch = SocketChannel.open(); ch.socket().connect(new InetSocketAddress(addr.getHostName(), addr.getPort()), Integer.MAX_VALUE); Map<Integer, Object> meta = new HashMap<>(); GridNioFuture<?> sslHandshakeFut = null; if (sslCtx != null) { sslHandshakeFut = new GridNioFutureImpl<>(null); meta.put(GridNioSslFilter.HANDSHAKE_FUT_META_KEY, sslHandshakeFut); } GridNioSession ses = srv.createSession(ch, meta, false, null).get(); if (sslHandshakeFut != null) sslHandshakeFut.get(); return new GridNioClientConnection(ses, msgHnd, stateHnd); } catch (Exception e) { throw new ClientConnectionException(e.getMessage(), e); } }
Source:
private void checkPasswordValidity(DocumentModel userModel) throws InvalidPasswordException { String schema = dirService.getDirectorySchema(userDirectoryName); String passwordField = dirService.getDirectory(userDirectoryName).getPasswordField(); Property passwordProperty = userModel.getProperty(String.format("%s:%s", schema, passwordField)); if (passwordProperty.isDirty()) { String clearPassword = passwordProperty.getValue(String.class); if (StringUtils.isNotBlank(clearPassword) && !validatePassword(clearPassword)) { throw new InvalidPasswordException(); } } }

Target:
protected void checkPasswordValidity(DocumentModel userModel) throws InvalidPasswordException { String schema = dirService.getDirectorySchema(userDirectoryName); String passwordField = dirService.getDirectory(userDirectoryName).getPasswordField(); Property passwordProperty = userModel.getProperty(String.format("%s:%s", schema, passwordField)); if (passwordProperty.isDirty()) { String clearPassword = passwordProperty.getValue(String.class); if (StringUtils.isNotBlank(clearPassword) && !validatePassword(clearPassword)) { throw new InvalidPasswordException(); } } }
Source:
public void compress(ByteBuffer input, ByteBuffer output) { if (input.isDirect() || output.isDirect()) { throw new UnsupportedOperationException("Compression of direct byte buffer not supported"); } byte[] inputArray; int inputOffset; if (input.hasArray()) { inputArray = input.array(); inputOffset = input.arrayOffset() + input.position(); } else { throw new IllegalArgumentException("Unsupported input ByteBuffer implementation " + input.getClass().getName()); } byte[] outputArray; int outputOffset; if (output.hasArray()) { outputArray = output.array(); outputOffset = output.arrayOffset() + output.position(); } else { throw new IllegalArgumentException("Unsupported output ByteBuffer implementation " + output.getClass().getName()); } int written = compress(inputArray, inputOffset, input.remaining(), outputArray, outputOffset, output.remaining()); output.position(output.position() + written); }

Target:
public void compress(ByteBuffer input, ByteBuffer output) { if (input.isDirect() || output.isDirect() || !input.hasArray() || !output.hasArray()) { throw new IllegalArgumentException("Non-direct byte buffer backed by byte array required"); } int inputOffset = input.arrayOffset() + input.position(); int outputOffset = output.arrayOffset() + output.position(); int written = compress(input.array(), inputOffset, input.remaining(), output.array(), outputOffset, output.remaining()); output.position(output.position() + written); }
Source:
public void setRequestInterceptors(List<HttpConnectionRequestInterceptor> requestInterceptors) { this.requestInterceptors.addAll(requestInterceptors); }

Target:
public void setRequestInterceptors(List<HttpConnectionRequestInterceptor> requestInterceptors) { this.requestInterceptors = requestInterceptors; }
Source:
public String toIndexableString() { return format( "Point{ %s, %s}", getCoordinateReferenceSystem().getName(), Arrays.toString( coordinate ) ); }

Target:
public String toIndexableString() { CoordinateReferenceSystem crs = getCoordinateReferenceSystem(); return format( "P:%d-%d%s", crs.getTable().getTableId(), crs.getCode(), Arrays.toString( coordinate ) ); }