auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void logCompactionChoice(String tableToCompact, long maxSweptAfterCompact) { if (maxSweptAfterCompact > 0) { log.info("Choosing to compact {}, because it was swept milliseconds after the last compaction", safeTableRef(tableToCompact), maxSweptAfterCompact); } else { log.info("All swept tables have been compacted after the last sweep. Choosing to compact anyway - " + "this may be a no-op. It was last compacted milliseconds after it was last swept.", safeTableRef(tableToCompact), maxSweptAfterCompact); } }

Target:
private void logCompactionChoice(String tableToCompact, long maxSweptAfterCompact) { if (maxSweptAfterCompact > 0) { log.info("Choosing to compact {}, because it was swept milliseconds after the last compaction", safeTableRef(tableToCompact), SafeArg.of("millisFromCompactionToSweep", maxSweptAfterCompact)); } else { log.info("All swept tables have been compacted after the last sweep. Choosing to compact anyway - " + "this may be a no-op. It was last compacted milliseconds after it was last swept.", safeTableRef(tableToCompact), SafeArg.of("millisFromSweepToCompaction", maxSweptAfterCompact)); } }
Source:
public boolean supportsPrefix(String searchPrefix) { return AbstractSearchProvider.supportsPrefix("nodes=", searchPrefix); }

Target:
public boolean supportsPrefix(String searchPrefix) { return AbstractSearchProvider.supportsPrefix(LinkdTopologyProvider.TOPOLOGY_NAMESPACE_LINKD+"=", searchPrefix); }
Source:
public void acceptBalloon() { final ImportVmCommand<ImportVmParameters> c = setupDiskSpaceTest(0); c.getParameters().getVm().setBalloonEnabled(true); c.getParameters().getVm().setClusterArch(ArchitectureType.x86_64); VDSGroup cluster = new VDSGroup(); cluster.setArchitecture(ArchitectureType.x86_64); cluster.setcompatibility_version(Version.getLast()); doReturn(cluster).when(c).getVdsGroup(); osRepository.getDisplayTypes().get(0).put(Version.getLast(), Arrays.asList(DisplayType.qxl)); when(osRepository.isBalloonEnabled(c.getParameters().getVm().getVmOsId(), cluster.getcompatibility_version())).thenReturn(true); assertTrue(c.canDoAction()); }

Target:
public void acceptBalloon() { final ImportVmCommand<ImportVmParameters> c = setupDiskSpaceTest(createParameters()); c.getParameters().getVm().setBalloonEnabled(true); c.getParameters().getVm().setClusterArch(ArchitectureType.x86_64); VDSGroup cluster = new VDSGroup(); cluster.setArchitecture(ArchitectureType.x86_64); cluster.setcompatibility_version(Version.getLast()); doReturn(cluster).when(c).getVdsGroup(); osRepository.getDisplayTypes().get(0).put(Version.getLast(), Arrays.asList(DisplayType.qxl)); when(osRepository.isBalloonEnabled(c.getParameters().getVm().getVmOsId(), cluster.getcompatibility_version())).thenReturn(true); assertTrue(c.canDoAction()); }
Source:
protected @NonNull TmfViewer createLeftChildViewer(Composite parent) { CounterTreeViewer treeViewer = new CounterTreeViewer(parent); treeViewer.addSelectionChangeListener(new SelectionChangeListener()); ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace != null) { TmfTraceSelectedSignal signal = new TmfTraceSelectedSignal(this, trace); treeViewer.traceSelected(signal); setTrace(trace); } return treeViewer; }

Target:
protected @NonNull TmfViewer createLeftChildViewer(Composite parent) { CounterTreeViewer treeViewer = new CounterTreeViewer(parent); treeViewer.addSelectionChangeListener(new SelectionChangeListener()); ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace != null) { TmfTraceSelectedSignal signal = new TmfTraceSelectedSignal(this, trace); treeViewer.traceSelected(signal); } return treeViewer; }
Source:
public void onPartitionsRevoked(Collection<TopicPartition> topicPartitions) { _logger.info("Partition ownership revoked for {}, checkpointing.", topicPartitions); if (_autoPausedSourcePartitions.retainAll(topicPartitions)) { _logger.info("Auto-paused partitions set changed after onPartitionsRevoked. Current set is: {}", _autoPausedSourcePartitions); } if (!_shouldDie) { maybeCommitOffsets(_consumer, true); } }

Target:
public void onPartitionsRevoked(Collection<TopicPartition> topicPartitions) { _logger.info("Partition ownership revoked for {}, checkpointing.", topicPartitions); if (!_shouldDie) { maybeCommitOffsets(_consumer, true); } _taskUpdates.add(DatastreamConstants.UpdateType.PAUSE_RESUME_PARTITIONS); }
Source:
protected Event analizePosition(Position position) { Object cmdResult = position.getAttributes().get(Position.KEY_RESULT); if (cmdResult != null) { return new Event(Event.COMMAND_RESULT, position.getDeviceId(), position.getId()); } return null; }

Target:
protected Event analizePosition(Position position) { Object commandResult = position.getAttributes().get(Position.KEY_RESULT); if (commandResult != null) { return new Event(Event.TYPE_COMMAND_RESULT, position.getDeviceId(), position.getId()); } return null; }
Source:
public FileSystem newFileSystem(final URI uri, final Map<String, ?> env) { checkNotNull("uri", uri); checkNotNull("env", env); throw new FileSystemAlreadyExistsException(uri.toString()); }

Target:
public FileSystem newFileSystem(final URI uri, final Map<String, ?> env) throws IllegalArgumentException, IOException, SecurityException, FileSystemAlreadyExistsException { checkNotNull("uri", uri); checkNotNull("env", env); throw new FileSystemAlreadyExistsException(uri.toString()); }
Source:
protected boolean isSecured() { PropertyCharacteristicHandler propertyHandler = Framework.getService(PropertyCharacteristicHandler.class); String xPath = getXPath(); String path = xPath.substring(xPath.lastIndexOf(':') + 1); return propertyHandler.isSecured(getSchema().getName(), path) && !ClientLoginModule.isCurrentAdministrator(); }

Target:
protected boolean isSecured() { return areFlagsSet(IS_SECURED) && !ClientLoginModule.isCurrentAdministrator(); }
Source:
private ListenableFuture<Void> deinitInternal() { mInitialized.set(false); ListenableFuture<Void> future = mCameraRepository.deinit(); return CallbackToFutureAdapter.getFuture( completer -> { future.addListener(() -> { if (mCameraExecutor instanceof CameraExecutor) { CameraExecutor executor = (CameraExecutor) mCameraExecutor; executor.deinit(); } completer.set(null); }, mCameraExecutor); return "CameraX deinitInternal"; } ); }

Target:
private ListenableFuture<Void> deinitInternal() { if (!mInitialized.getAndSet(false)) { return mDeinitInternalFuture; } ListenableFuture<Void> future = mCameraRepository.deinit(); mDeinitInternalFuture = CallbackToFutureAdapter.getFuture( completer -> { future.addListener(() -> { if (mCameraExecutor instanceof CameraExecutor) { CameraExecutor executor = (CameraExecutor) mCameraExecutor; executor.deinit(); } completer.set(null); }, mCameraExecutor); return "CameraX deinitInternal"; } ); return mDeinitInternalFuture; }
Source:
public List<Node> getChildren() { List<Node> children = new ArrayList<Node>(); children.addAll(methods); return children; }

Target:
public List<Node> getChildren() { return new ArrayList<Node>(methods); }
Source:
public static Integer toInteger(Boolean bool) { if (null == bool) { return null; } return bool.booleanValue() ? new Integer(1) : new Integer(0); }

Target:
public static Integer toInteger(Boolean bool) { if (null == bool) { return null; } return bool.booleanValue() ? Integer.valueOf(1) : Integer.valueOf(0); }
Source:
public ServiceEmitter getServiceEmitter(@Self Supplier<DruidNode> configSupplier, Emitter emitter) { final DruidNode config = configSupplier.get(); String version = getClass().getPackage().getImplementationVersion(); final ImmutableMap<String, String> otherServiceDimensions = ImmutableMap.of( "version", version != null ? version : "testing-version" ); final ServiceEmitter retVal = new ServiceEmitter( config.getServiceName(), config.getHostAndPort(), emitter, otherServiceDimensions ); EmittingLogger.registerEmitter(retVal); return retVal; }

Target:
public ServiceEmitter getServiceEmitter(@Self Supplier<DruidNode> configSupplier, Emitter emitter) { final DruidNode config = configSupplier.get(); String version = getClass().getPackage().getImplementationVersion(); final ImmutableMap<String, String> otherServiceDimensions = ImmutableMap.of( "version", Strings.nullToEmpty(version) ); final ServiceEmitter retVal = new ServiceEmitter( config.getServiceName(), config.getHostAndPort(), emitter, otherServiceDimensions ); EmittingLogger.registerEmitter(retVal); return retVal; }
Source:
public TimeGraphScale(Composite parent, TimeGraphColorScheme colors) { super(parent, colors, SWT.NO_BACKGROUND | SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED); TmfSignalManager.register(this); addMouseListener(this); addMouseMoveListener(this); TimeDraw.updateTimeZone(); addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { TmfSignalManager.deregister(TimeGraphScale.this); } }); }

Target:
public TimeGraphScale(Composite parent, TimeGraphColorScheme colors) { super(parent, colors, SWT.NO_BACKGROUND | SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED); TmfSignalManager.register(this); addMouseListener(this); addMouseMoveListener(this); TimeDraw.updateTimeZone(); addDisposeListener((e) -> { TmfSignalManager.deregister(TimeGraphScale.this); }); }
Source:
public void testSelectInverseOneToOne() { inTransaction( session -> { EntityA a = new EntityA( 1L, new EntityB( 2L ) ); session.persist( a ); session.flush(); session.clear(); List<EntityA> list = session.createQuery( "select a from EntityB b left join b.a a", EntityA.class ).list(); List<Object[]> tupleList = session.createQuery( "select b, b.id, a from EntityB b left join b.a a", Object[].class ).list(); assertEquals( "Selecting inverse one-to-one didn't construct the object properly from the result set!", list.get(0), tupleList.get(0)[2] ); } ); }

Target:
public void testSelectInverseOneToOne() { inTransaction( session -> { EntityA a = new EntityA( 1L, new EntityB( 2L ), new EntityC( 3L ) ); session.persist( a ); session.flush(); session.clear(); List<Object[]> tupleList = session.createQuery( "select b, b.id, a from EntityB b left join b.a a", Object[].class ).list(); List<EntityA> list = session.createQuery( "select a from EntityB b left join b.a a", EntityA.class ).list(); assertEquals( "Selecting inverse one-to-one didn't construct the object properly from the result set!", list.get(0), tupleList.get(0)[2] ); } ); }
Source:
public InfinispanClientImpl(ClientConfig clientConfig) { if (clientConfig instanceof ClientConfigurationLoader.ConfigurationWrapper) { ClientConfigurationLoader.ConfigurationWrapper wrapper = (ClientConfigurationLoader.ConfigurationWrapper) clientConfig; cacheManager = new RemoteCacheManager(wrapper.getConfiguration()); } asyncExecutorService = cacheManager.getAsyncExecutorService(); }

Target:
public InfinispanClientImpl(ClientConfig clientConfig) { if (clientConfig instanceof ClientConfigurationLoader.ConfigurationWrapper) { ClientConfigurationLoader.ConfigurationWrapper wrapper = (ClientConfigurationLoader.ConfigurationWrapper) clientConfig; cacheManager = new RemoteCacheManager(wrapper.getConfiguration()); } else { throw new InfinispanConfigurationException("Unable to construct InfinispanClientImpl. ClientConfig is not a ClientConfigurationLoader.ConfigurationWrapper"); } asyncExecutorService = cacheManager.getAsyncExecutorService(); }
Source:
public Object createAssociationKeyObject( RowKey rowKey, AssociationKeyMetadata keyMetadata ) { Object result = null; if ( IgniteAssociationSnapshot.isThirdTableAssociation( keyMetadata ) ) { result = UUID.randomUUID().toString(); } else { String associationKeyColumns[] = keyMetadata.getAssociatedEntityKeyMetadata().getAssociationKeyColumns(); if ( associationKeyColumns.length == 1 ) { result = rowKey.getColumnValue( associationKeyColumns[0] ); } else { BinaryObjectBuilder builder = createBinaryObjectBuilder( findKeyType( keyMetadata.getAssociatedEntityKeyMetadata().getEntityKeyMetadata() ) ); for ( int i = 0; i < associationKeyColumns.length; i++ ) { builder.setField( StringHelper.stringAfterPoint( associationKeyColumns[i] ), rowKey.getColumnValue( associationKeyColumns[i] ) ); } result = builder.build(); } } return result; }

Target:
public Object createAssociationKeyObject( RowKey rowKey, AssociationKeyMetadata keyMetadata ) { Object result = null; if ( IgniteAssociationSnapshot.isThirdTableAssociation( keyMetadata ) ) { result = UUID.randomUUID().toString(); } else { String associationKeyColumns[] = keyMetadata.getAssociatedEntityKeyMetadata().getAssociationKeyColumns(); if ( associationKeyColumns.length == 1 ) { result = rowKey.getColumnValue( associationKeyColumns[0] ); } else { HashCodeBuilder hashBuilder = new HashCodeBuilder(); BinaryObjectBuilder builder = createBinaryObjectBuilder( findKeyType( keyMetadata.getAssociatedEntityKeyMetadata().getEntityKeyMetadata() ) ); for ( int i = 0; i < associationKeyColumns.length; i++ ) { builder.setField( StringHelper.stringAfterPoint( associationKeyColumns[i] ), rowKey.getColumnValue( associationKeyColumns[i] ) ); hashBuilder.append( rowKey.getColumnValue( associationKeyColumns[i] ) ); } builder.hashCode( hashBuilder.toHashCode() ); result = builder.build(); } } return result; }
Source:
public APIResult getExtensionDefinition( @PathParam("extension-name") String extensionName) { checkIfExtensionServiceIsEnabled(); checkIfExtensionExists(extensionName); try { ExtensionType extensionType = getExtensionType(extensionName); if (ExtensionType.TRUSTED.equals(extensionType)) { return new APIResult(APIResult.Status.SUCCEEDED, ExtensionStore.get().getResource(extensionName, extensionName.toLowerCase() + EXTENSION_PROPERTY_JSON_SUFFIX)); } else { return new APIResult(APIResult.Status.SUCCEEDED, ExtensionStore.getMetaStore().getDetail(extensionName).getDescription()); } } catch (FalconException e) { throw FalconWebException.newAPIException(e, Response.Status.BAD_REQUEST); } catch (Throwable e) { throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } }

Target:
public APIResult getExtensionDefinition( @PathParam("extension-name") String extensionName) { checkIfExtensionServiceIsEnabled(); checkIfExtensionExists(extensionName); try { ExtensionType extensionType = getExtensionType(extensionName); if (ExtensionType.TRUSTED.equals(extensionType)) { return new APIResult(APIResult.Status.SUCCEEDED, ExtensionStore.get().getResource(extensionName, extensionName.toLowerCase() + EXTENSION_PROPERTY_JSON_SUFFIX)); } else { return new APIResult(APIResult.Status.SUCCEEDED, ExtensionStore.get().getResource(extensionName, null)); } } catch (FalconException e) { throw FalconWebException.newAPIException(e, Response.Status.BAD_REQUEST); } catch (Throwable e) { throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } }
Source:
private int persistHydrant(FireHydrant indexToPersist, SegmentIdWithShardSpec identifier) { synchronized (indexToPersist) { if (indexToPersist.hasSwapped()) { log.info( "Segment[%s], Hydrant[%s] already swapped. Ignoring request to persist.", identifier, indexToPersist ); return 0; } log.info("Segment[%s], persisting Hydrant[%s]", identifier, indexToPersist); try { int numRows = indexToPersist.getIndex().size(); final File persistedFile; final File persistDir = createPersistDirIfNeeded(identifier); final IndexSpec indexSpec = tuningConfig.getIndexSpec(); persistedFile = indexMerger.persist( indexToPersist.getIndex(), identifier.getInterval(), new File(persistDir, String.valueOf(indexToPersist.getCount())), indexSpec, tuningConfig.getSegmentWriteOutMediumFactory() ); indexToPersist.swapSegment( new QueryableIndexSegment(indexIO.loadIndex(persistedFile), indexToPersist.getSegmentId()) ); return numRows; } catch (IOException e) { log.makeAlert("dataSource[%s] -- incremental persist failed", schema.getDataSource()) .addData("segment", identifier.toString()) .addData("count", indexToPersist.getCount()) .emit(); throw new RuntimeException(e); } } }

Target:
private int persistHydrant(FireHydrant indexToPersist, SegmentIdWithShardSpec identifier) { synchronized (indexToPersist) { if (indexToPersist.hasSwapped()) { log.info( "Segment[%s], Hydrant[%s] already swapped. Ignoring request to persist.", identifier, indexToPersist ); return 0; } log.info("Segment[%s], persisting Hydrant[%s]", identifier, indexToPersist); try { int numRows = indexToPersist.getIndex().size(); final File persistedFile; final File persistDir = createPersistDirIfNeeded(identifier); persistedFile = indexMerger.persist( indexToPersist.getIndex(), identifier.getInterval(), new File(persistDir, String.valueOf(indexToPersist.getCount())), tuningConfig.getIndexSpecForIntermediatePersists(), tuningConfig.getSegmentWriteOutMediumFactory() ); indexToPersist.swapSegment( new QueryableIndexSegment(indexIO.loadIndex(persistedFile), indexToPersist.getSegmentId()) ); return numRows; } catch (IOException e) { log.makeAlert("dataSource[%s] -- incremental persist failed", schema.getDataSource()) .addData("segment", identifier.toString()) .addData("count", indexToPersist.getCount()) .emit(); throw new RuntimeException(e); } } }
Source:
public void close() throws SQLException { if (hpccConnection != null) { hpccConnection.close(); hpccConnection = null; } if (result != null) { result.close(); result = null; } sqlQuery = ""; dbMetadata = null; closed = true; parameters = null; parser = null; eclQuery = null; }

Target:
public void close() throws SQLException { if (!closed) { closed = true; hpccConnection = null; result = null; sqlQuery = null; dbMetadata = null; parameters = null; parser = null; eclQuery = null; } }
Source:
private void createSystemRole(String roleName, String[] userList, Permission[] permissions) throws UserStoreException { if (systemUserRoleManager.isExistingRole(roleName)) { handleRoleAlreadyExistException(roleName, userList, permissions); } try { systemUserRoleManager.addSystemRole(roleName, userList); } catch (UserStoreException e) { if (ERROR_CODE_DUPLICATE_WHILE_ADDING_A_SYSTEM_ROLE.getCode().contains(e.getErrorCode())) { if (systemUserRoleManager.isExistingRole(roleName)) { handleRoleAlreadyExistException(roleName, userList, permissions); } } throw e; } }

Target:
private void createSystemRole(String roleName, String[] userList, Permission[] permissions) throws UserStoreException { if (systemUserRoleManager.isExistingRole(roleName)) { handleRoleAlreadyExistException(roleName, userList, permissions); } try { systemUserRoleManager.addSystemRole(roleName, userList); } catch (UserStoreException e) { if (ERROR_CODE_DUPLICATE_WHILE_ADDING_A_SYSTEM_ROLE.getCode().contains(e.getErrorCode())) { handleRoleAlreadyExistException(roleName, userList, permissions); } throw e; } }
Source:
public void updateShouldUpdateEmail() throws Exception { userDao.saveOrUpdate(new User("user-1")); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); userService.update(new User("user-1"), TriState.UNSET, TriState.UNSET, "foo@example.com", null, result); assertThat(result.isSuccessful(), is(true)); assertThat(userService.findUserByName("user-1").getEmail(), is("foo@example.com")); result = new HttpLocalizedOperationResult(); userService.update(new User("user-1"), TriState.TRUE, TriState.UNSET, "", null, result); assertThat(userService.findUserByName("user-1").getEmail(), is("")); assertThat(result.isSuccessful(), is(true)); }

Target:
public void updateShouldUpdateEmail() throws Exception { User user = new User("user-1"); addUser(user); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); userService.update(user, TriState.UNSET, TriState.UNSET, "foo@example.com", null, result); assertThat(result.isSuccessful(), is(true)); assertThat(user.getEmail(), is("foo@example.com")); result = new HttpLocalizedOperationResult(); userService.update(user, TriState.TRUE, TriState.UNSET, "", null, result); assertThat(result.isSuccessful(), is(true)); assertThat(user.getEmail(), is("")); }
Source:
private void handleSuccess(IndexedRecord input) throws SQLException { Schema outputSchema = rowProperties.getSchema(); if (outputSchema == null || outputSchema.getFields().size() == 0) { return; } if (rowProperties.propagateQueryResultSet()) { if (rs == null || (!resultSetValidation && !validateResultSet())) { return; } if (resultSetFactory == null) { resultSetFactory = new SnowflakeResultSetIndexedRecordConverter(); resultSetFactory.setSchema(mainSchema); } while (rs.next()) { result.totalCount++; result.successCount++; IndexedRecord resultSetIndexedRecord = resultSetFactory.convertToAvro(rs); if (AvroUtils.isIncludeAllFields(outputSchema)) { successfulWrites.add(resultSetIndexedRecord); } else { IndexedRecord output = new GenericData.Record(outputSchema); for (Field outField : outputSchema.getFields()) { Field inputField = resultSetIndexedRecord.getSchema().getField(outField.name()); if (inputField != null) { output.put(outField.pos(), resultSetIndexedRecord.get(inputField.pos())); } } successfulWrites.add(output); } } } else { result.totalCount++; result.successCount++; IndexedRecord output = new GenericData.Record(outputSchema); for (Field outField : outputSchema.getFields()) { Field inputField = input.getSchema().getField(outField.name()); if (inputField != null) { output.put(outField.pos(), input.get(inputField.pos())); } } successfulWrites.add(output); } }

Target:
private void handleSuccess(IndexedRecord input) throws SQLException { Schema outputSchema = rowProperties.getSchema(); if (outputSchema == null || outputSchema.getFields().size() == 0) { return; } if (rowProperties.propagateQueryResultSet()) { if (rs == null || (!resultSetValidation && !validateResultSet())) { return; } if (resultSetFactory == null) { resultSetFactory = new SnowflakeResultSetIndexedRecordConverter(); resultSetFactory.setSchema(mainSchema); } while (rs.next()) { IndexedRecord resultSetIndexedRecord = resultSetFactory.convertToAvro(rs); if (AvroUtils.isIncludeAllFields(outputSchema)) { successfulWrites.add(resultSetIndexedRecord); } else { IndexedRecord output = new GenericData.Record(outputSchema); for (Field outField : outputSchema.getFields()) { Field inputField = resultSetIndexedRecord.getSchema().getField(outField.name()); if (inputField != null) { output.put(outField.pos(), resultSetIndexedRecord.get(inputField.pos())); } } result.totalCount++; result.successCount++; successfulWrites.add(output); } } } else { IndexedRecord output = new GenericData.Record(outputSchema); for (Field outField : outputSchema.getFields()) { Field inputField = input.getSchema().getField(outField.name()); if (inputField != null) { output.put(outField.pos(), input.get(inputField.pos())); } } result.totalCount++; result.successCount++; successfulWrites.add(output); } }
Source:
public BinaryContent transform( SourceResponse upstreamResponse, Map<String, Serializable> arguments) throws CatalogTransformerException { Set<String> hiddenFields = Optional.ofNullable((Set<String>) arguments.get(HIDDEN_FIELDS_KEY)) .orElse(Collections.emptySet()); List<String> attributeOrder = Optional.ofNullable((List<String>) arguments.get(COLUMN_ORDER_KEY)) .orElse(Collections.emptyList()); Map<String, String> columnAliasMap = Optional.ofNullable((Map<String, String>) arguments.get(COLUMN_ALIAS_KEY)) .orElse(Collections.emptyMap()); Set<AttributeDescriptor> allAttributeDescriptors = getAllRequestedAttributes( upstreamResponse.getResults(), hiddenFields, new HashSet<String>(attributeOrder)); List<AttributeDescriptor> sortedAttributeDescriptors = sortAttributes(allAttributeDescriptors, attributeOrder); Appendable csv = writeSearchResultsToCsv(upstreamResponse, columnAliasMap, sortedAttributeDescriptors); return createResponse(csv); }

Target:
public BinaryContent transform( SourceResponse upstreamResponse, Map<String, Serializable> arguments) throws CatalogTransformerException { Set<String> hiddenFields = Optional.ofNullable((Set<String>) arguments.get(HIDDEN_FIELDS_KEY)) .orElse(Collections.emptySet()); List<String> attributeOrder = Optional.ofNullable((List<String>) arguments.get(COLUMN_ORDER_KEY)) .orElse(Collections.emptyList()); Map<String, String> columnAliasMap = Optional.ofNullable((Map<String, String>) arguments.get(COLUMN_ALIAS_KEY)) .orElse(Collections.emptyMap()); Set<String> requestedFields = new HashSet<>(attributeOrder); Set<AttributeDescriptor> allAttributeDescriptors = getAllRequestedAttributes(upstreamResponse.getResults(), hiddenFields, requestedFields); List<AttributeDescriptor> sortedAttributeDescriptors = sortAttributes(allAttributeDescriptors, attributeOrder); Appendable csv = writeSearchResultsToCsv(upstreamResponse, columnAliasMap, sortedAttributeDescriptors); return createResponse(csv); }
Source:
protected int getTestTimeoutMillis() { return 3 * 180000; }

Target:
protected int getTestTimeoutMillis() { return 3 * super.getTestTimeoutMillis(); }
Source:
FileBlock getNextBlock( final FileBlock prevBlock, final FileMeta metadata) throws IOException { synchronized ( InfinispanJFS.this ) { UUID next = prevBlock.getNextBlockID(); FileBlock nextBlock = null; while ( nextBlock == null ) { nextBlock = blockCache.get( next ); if (nextBlock == null) { try { lockManager.reentrantSynchronous( metadata.getFilePath(), ( opLock ) -> { ClusterListener clusterListener = new ClusterListener( next, opLock ); clusterListener.listenToCache( blockCache ); opLock.await( WAIT_TIMEOUT ); return null; } ); } catch ( final InterruptedException e ) { return null; } } } return nextBlock; } }

Target:
FileBlock getNextBlock( final FileBlock prevBlock, final FileMeta metadata ) throws IOException { String next = prevBlock.getNextBlockID(); if ( next == null ) { return null; } try { lockManager.reentrantSynchronous( metadata.getFilePath(), ( opLock ) -> { FileBlock nextBlock = null; ClusterListener clusterListener = new ClusterListener( next, opLock ); while ( nextBlock == null ) { nextBlock = blockCache.get( next ); if ( nextBlock == null ) { clusterListener.listenToCache( blockCache ); } } return nextBlock; } ); } catch ( InterruptedException e ) { LoggerFactory.getLogger( getClass().getName() ) .error( "Interrupted while trying to get block with ID: " + next, e ); } return null; }
Source:
public static Key buildPrivateKey(final String base64EncodedKeyContent) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException { final KeyFactory kf = KeyFactory.getInstance("RSA"); final PKCS8EncodedKeySpec keysp = new PKCS8EncodedKeySpec(Base64.decodeBase64(base64EncodedKeyContent)); return kf.generatePrivate(keysp); }

Target:
public static Key buildPrivateKey(final String base64EncodedKeyContent) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException { Preconditions.checkNotNull(base64EncodedKeyContent); final KeyFactory kf = KeyFactory.getInstance("RSA"); final PKCS8EncodedKeySpec keysp = new PKCS8EncodedKeySpec(Base64.decodeBase64(base64EncodedKeyContent)); return kf.generatePrivate(keysp); }
Source:
public void setTitleText(final String title, final Serializable... args) { String currTitle = getTitleText(); if (!Objects.equals(title, currTitle)) { MessageModel model = getOrCreateComponentModel(); model.title = I18nUtilities.asMessage(title, args); } }

Target:
public void setTitleText(final String title, final Serializable... args) { Serializable currTitle = getComponentModel().title; Serializable titleToBeSet = I18nUtilities.asMessage(title, args); if (!Objects.equals(titleToBeSet, currTitle)) { MessageModel model = getOrCreateComponentModel(); model.title = titleToBeSet; } }
Source:
public void testConverter() throws Exception { String converterName = cs.getConverterName("text/plain", "application/pdf"); assertEquals("any2pdf", converterName); checkConverterAvailability(converterName); checkCommandAvailability("soffice"); BlobHolder result = convertTextBlob(converterName); checkPDFDocument(result); checkPDFDocument(result); }

Target:
public void testConverter() throws Exception { String converterName = cs.getConverterName("text/plain", "application/pdf"); assertEquals("any2pdf", converterName); checkConverterAvailability(converterName); checkCommandAvailability("soffice"); BlobHolder result = convertTextBlob(converterName); checkPDFDocument(result); }
Source:
public void create() { setPreviousScreen(Screens.PROJECT_MENU); super.root = new Group(); root.setVisible(false); toolBar = new ToolBar(skin); toolBar.right(); Button move = new TextButton("Mover", skin); paint = new DrawComponent(skin, "Pintar", "Herramienta de pincel", Color.BLACK, 350, 550); delete = new DrawComponent(skin, "Borrar", "Herramienta de goma", 350, 250); text = new DrawComponent(skin, "Texto", "Herramienta de escribir", Color.BLACK, 350, 550); Button inter = new TextButton("Zonas Int.", skin); Button add = new TextButton("Añadir", skin); Button effect = new TextButton("Efectos", skin); effect.setDisabled(true); Button more = new TextButton("...", skin); ImageButton frames = new ImageButton(skin); frames.setX(AbstractScreen.stagew - frames.getWidth()); toolBar.add(move); toolBar.add(paint.getButton()); toolBar.add(delete.getButton()); toolBar.add(text.getButton()); toolBar.add(inter); toolBar.add(add); toolBar.add(effect); toolBar.add(more); toolBar.invalidate(); toolBar.validate(); root.addActor(toolBar); root.addActor(frames); root.addActor(paint.getPanel()); delete.actCoordinates(); root.addActor(delete.getPanel()); paint.actCoordinates(); root.addActor(text.getPanel()); text.actCoordinates(); stage.addActor(root); }

Target:
public void create() { setPreviousScreen(Screens.PROJECT_MENU); super.root = new Group(); root.setVisible(false); toolBar = new ToolBar(skin); toolBar.right(); Button move = new TextButton("Mover", skin); paint = new DrawComponent(skin, "Pintar", "Herramienta de pincel", Type.BRUSH, 350, 550); delete = new DrawComponent(skin, "Borrar", "Herramienta de goma", Type.RUBBER, 350, 250); text = new DrawComponent(skin, "Texto", "Herramienta de escribir", Type.TEXT, 350, 550); Button inter = new TextButton("Zonas Int.", skin); Button add = new TextButton("Añadir", skin); Button effect = new TextButton("Efectos", skin); effect.setDisabled(true); Button more = new TextButton("...", skin); ImageButton frames = new ImageButton(skin); frames.setX(AbstractScreen.stagew - frames.getWidth()); toolBar.add(move); toolBar.add(paint.getButton()); toolBar.add(delete.getButton()); toolBar.add(text.getButton()); toolBar.add(inter); toolBar.add(add); toolBar.add(effect); toolBar.add(more); toolBar.invalidate(); toolBar.validate(); root.addActor(toolBar); root.addActor(frames); root.addActor(paint.getPanel()); delete.actCoordinates(); root.addActor(delete.getPanel()); paint.actCoordinates(); root.addActor(text.getPanel()); text.actCoordinates(); stage.addActor(root); }
Source:
public CopyObjectException(String sourcePath, String destinationPath, String message) { super(String.format("Either the source path %s or the destination path %s was not found. " + "(message: %s)", sourcePath, destinationPath, message)); this.sourcePath = sourcePath; this.destinationPath = destinationPath; }

Target:
public CopyObjectException(String sourcePath, String destinationPath, String message) { super(String.format("Either the source path '%s' or the destination path '%s' was not found. " + "(message: %s)", sourcePath, destinationPath, message)); this.sourcePath = sourcePath; this.destinationPath = destinationPath; }
Source:
public static void main(String[] args) throws Exception { Args searchArgs = new Args(); CmdLineParser parser = new CmdLineParser(searchArgs, ParserProperties.defaults().withUsageWidth(90)); try { parser.parseArgument(args); } catch (CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); System.err.println("Example command: "+ SearchRDF.class.getSimpleName() + parser.printExample(OptionHandlerFilter.REQUIRED)); return; } new SearchRDF(searchArgs.index).search(searchArgs.subject, searchArgs.property); }

Target:
public static void main(String[] args) throws Exception { Args searchArgs = new Args(); CmdLineParser parser = new CmdLineParser(searchArgs, ParserProperties.defaults().withUsageWidth(90)); try { parser.parseArgument(args); } catch (CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); System.err.println("Example command: "+ SearchRDF.class.getSimpleName() + parser.printExample(OptionHandlerFilter.REQUIRED)); return; } new SearchRDF(searchArgs.index).search(searchArgs.subject, searchArgs.predicate); }
Source:
public void visitAssignmentExpression(AssignmentExpressionTree tree) { if (tree.variable() instanceof BracketMemberExpressionTreeImpl) { if (((BracketMemberExpressionTreeImpl) tree.variable()).object().types().contains(Kind.ARRAY)) { if (((BracketMemberExpressionTreeImpl) tree.variable()).property() instanceof LiteralTreeImpl) { LiteralTreeImpl al = (LiteralTreeImpl) ((BracketMemberExpressionTreeImpl) tree.variable()).property(); if (!NumberUtils.isNumber(al.token().text())) { addLineIssue(tree, MESSAGE); } } else if (((BracketMemberExpressionTreeImpl) tree.variable()).property() instanceof IdentifierTreeImpl) { IdentifierTreeImpl idt= (IdentifierTreeImpl)((BracketMemberExpressionTreeImpl) tree.variable()).property(); if (!NumberUtils.isNumber(idt.name())) { addLineIssue(tree, MESSAGE); } } } } super.visitAssignmentExpression(tree); }

Target:
public void visitAssignmentExpression(AssignmentExpressionTree tree) { if (tree.variable().is(Tree.Kind.BRACKET_MEMBER_EXPRESSION)) { BracketMemberExpressionTree memberExpression = (BracketMemberExpressionTree) tree.variable(); if (memberExpression.object().types().containsOnly(Kind.ARRAY)) { ExpressionTree arrayIndex = memberExpression.property(); if (arrayIndex.types().containsOnly(Kind.STRING)) { addIssue(arrayIndex, String.format(MESSAGE, CheckUtils.asString(memberExpression.object()))); } } } super.visitAssignmentExpression(tree); }
Source:
private Object convertStringToInternal(String value, TypeInformation type) { if (type.equals(Types.INT)) { return Integer.parseInt(value); } else if (type.equals(Types.LONG)) { return Long.parseLong(value); } else if (type.equals(Types.STRING)) { return BinaryString.fromString(value); } else { throw new UnsupportedOperationException("Unsupported type: " + type); } }

Target:
private Object convertStringToInternal(String value, TypeInformation type) { if (type.equals(Types.INT)) { return Integer.parseInt(value); } else if (type.equals(Types.LONG)) { return Long.parseLong(value); } else if (type.equals(Types.STRING)) { return BinaryString.fromString(value); } else { throw new UnsupportedOperationException("Unsupported partition type: " + type); } }
Source:
public void copyToWithPermission(FilePath target) throws IOException, InterruptedException { if (this.channel == target.channel) { act(new SecureFileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { try { File targetFile = new File(target.remote).getAbsoluteFile(); mkdirs(targetFile.getParentFile()); Files.copy(reading(f).toPath(), writing(targetFile).toPath(), StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING); } catch (InvalidPathException e) { throw new IOException(e); } return null; } }); return; } copyTo(target); target.chmod(mode()); target.setLastModifiedIfPossible(lastModified()); }

Target:
public void copyToWithPermission(FilePath target) throws IOException, InterruptedException { if (this.channel == target.channel) { act(new SecureFileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { File targetFile = new File(target.remote); File targetDir = targetFile.getParentFile(); filterNonNull().mkdirs(targetDir); Files.createDirectories(Util.fileToPath(targetDir)); Files.copy(Util.fileToPath(reading(f)), Util.fileToPath(writing(targetFile)), StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING); return null; } }); return; } copyTo(target); target.chmod(mode()); target.setLastModifiedIfPossible(lastModified()); }
Source:
private static AddPartitionDesc getBaseAddPartitionDescFromPartition( Path fromPath, String dbName, ImportTableDesc tblDesc, Partition partition, ReplicationSpec replicationSpec, HiveConf conf) throws MetaException, SemanticException { AddPartitionDesc partsDesc = new AddPartitionDesc(dbName, tblDesc.getTableName(), EximUtil.makePartSpec(tblDesc.getPartCols(), partition.getValues()), partition.getSd().getLocation(), partition.getParameters()); AddPartitionDesc.OnePartitionDesc partDesc = partsDesc.getPartition(0); partDesc.setInputFormat(partition.getSd().getInputFormat()); partDesc.setOutputFormat(partition.getSd().getOutputFormat()); partDesc.setNumBuckets(partition.getSd().getNumBuckets()); partDesc.setCols(partition.getSd().getCols()); partDesc.setSerializationLib(partition.getSd().getSerdeInfo().getSerializationLib()); partDesc.setSerdeParams(partition.getSd().getSerdeInfo().getParameters()); partDesc.setBucketCols(partition.getSd().getBucketCols()); partDesc.setSortCols(partition.getSd().getSortCols()); if (replicationSpec.isInReplicationScope() && tblDesc.isExternal()) { if (replicationSpec.isInReplicationScope()) { String newLocation = ReplExternalTables .externalTableLocation(conf, partition.getSd().getLocation()); LOG.debug("partition has data location: {}", partition, newLocation); partDesc.setLocation(newLocation); } return partsDesc; } else { partDesc.setLocation(new Path(fromPath, Warehouse.makePartName(tblDesc.getPartCols(), partition.getValues())).toString()); return partsDesc; } }

Target:
private static AddPartitionDesc getBaseAddPartitionDescFromPartition( Path fromPath, String dbName, ImportTableDesc tblDesc, Partition partition, ReplicationSpec replicationSpec, HiveConf conf) throws MetaException, SemanticException { AddPartitionDesc partsDesc = new AddPartitionDesc(dbName, tblDesc.getTableName(), EximUtil.makePartSpec(tblDesc.getPartCols(), partition.getValues()), partition.getSd().getLocation(), partition.getParameters()); AddPartitionDesc.OnePartitionDesc partDesc = partsDesc.getPartition(0); partDesc.setInputFormat(partition.getSd().getInputFormat()); partDesc.setOutputFormat(partition.getSd().getOutputFormat()); partDesc.setNumBuckets(partition.getSd().getNumBuckets()); partDesc.setCols(partition.getSd().getCols()); partDesc.setSerializationLib(partition.getSd().getSerdeInfo().getSerializationLib()); partDesc.setSerdeParams(partition.getSd().getSerdeInfo().getParameters()); partDesc.setBucketCols(partition.getSd().getBucketCols()); partDesc.setSortCols(partition.getSd().getSortCols()); if (replicationSpec.isInReplicationScope() && tblDesc.isExternal() && !replicationSpec.isMigratingToExternalTable()) { String newLocation = ReplExternalTables .externalTableLocation(conf, partition.getSd().getLocation()); LOG.debug("partition has data location: {}", partition, newLocation); partDesc.setLocation(newLocation); } else { partDesc.setLocation(new Path(fromPath, Warehouse.makePartName(tblDesc.getPartCols(), partition.getValues())).toString()); } return partsDesc; }
Source:
public void setAway(final boolean onOrOff, final String... deviceNames) { neoHubConnector.sendMessage("{\"AWAY_" + (onOrOff ? "ON" : "OFF") + "\":[\"" + StringUtils.join(deviceNames, "\",\"") + "\"]}", null); }

Target:
public void setAway(final boolean onOrOff, final String... deviceNames) { neoHubConnector.sendMessage( String.format("{\"AWAY_%s\":[\"%s\"]}", onOrOff ? "ON" : "OFF", StringUtils.join(deviceNames, "\",\"")), null); }
Source:
public void validateDebitCreditField(String debitCredit) throws ValidationException { if(!StringUtils.equalsIgnoreCase(debitCredit, ConcurConstants.ConcurPdpConstants.CREDIT) && !StringUtils.equalsIgnoreCase(debitCredit, ConcurConstants.ConcurPdpConstants.DEBIT)) { LOG.debug("validateDebitCreditField, invalid debit or credit: " + debitCredit); throw new ValidationException(debitCredit + " is not a valid valuee for the debit or credit field."); } else { LOG.debug("validateDebitCreditField, found a valid debit/credit."); } }

Target:
public boolean validateDebitCreditField(String debitCredit) { boolean valid = StringUtils.equalsIgnoreCase(debitCredit, ConcurConstants.ConcurPdpConstants.CREDIT) || StringUtils.equalsIgnoreCase(debitCredit, ConcurConstants.ConcurPdpConstants.DEBIT); if (valid) { LOG.debug("validateDebitCreditField, found a valid debit/credit."); } else { LOG.error("validateDebitCreditField, invalid debit or credit: " + debitCredit); } return valid; }
Source:
boolean dispose() throws IOException { try { _out.close(); } finally { } return true; }

Target:
boolean dispose() throws IOException { _out.close(); return true; }
Source:
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue, List<String> newLabels) { List<String> originalLabels = issue.getLabels(); logger.info("Changing labels for " + issue + " on UI"); Optional<TurboIssue> replaceResult = models.replaceIssueLabels(issue.getRepoId(), issue.getId(), newLabels); if (!replaceResult.isPresent()) { return CompletableFuture.completedFuture(false); } refreshUI(); return updateIssueLabelsOnRepo(issue, newLabels) .thenApply((isUpdateSuccessful) -> { if (isUpdateSuccessful) { return true; } logger.error("Unable to update model on server"); revertLocalLabelsReplace(replaceResult.get(), originalLabels); return false; }); }

Target:
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue, List<String> newLabels) { List<String> originalLabels = issue.getLabels(); logger.info("Changing labels for " + issue + " on UI"); Optional<TurboIssue> localReplaceResult = models.replaceIssueLabels(issue.getRepoId(), issue.getId(), newLabels); if (!localReplaceResult.isPresent()) { return CompletableFuture.completedFuture(false); } refreshUI(); return updateIssueLabelsOnServer(issue, newLabels) .thenApply((isUpdateSuccessful) -> handleIssueLabelsUpdateOnServerResult( isUpdateSuccessful, localReplaceResult.get(), originalLabels)); }
Source:
private void disableWatchdog() { if (this.isEnabled) { writeWatchdogDevice("V"); this.isEnabled = false; } }

Target:
private void disableWatchdog() { if (this.enabled) { writeWatchdogDevice("V"); this.enabled = false; } }
Source:
public void createCommitStatus(GHCommitState state, String message) { GHRepository ghRepository = repo.getGitHubRepo(); GhprbTrigger trigger = helper.getTrigger(); Job<?, ?> actualProject = trigger.getActualProject(); for (GhprbExtension ext : Ghprb.getJobExtensions(trigger, GhprbCommitStatus.class)) { if (ext instanceof GhprbCommitStatus) { try { ((GhprbCommitStatus) ext).createCommitStatus(actualProject, id, head, state, ghRepository, message); } catch (GhprbCommitStatusException e) { repo.commentOnFailure(null, null, e); } } } }

Target:
public void createCommitStatus(GHCommitState state, String message) { GHRepository ghRepository = repo.getGitHubRepo(); GhprbTrigger trigger = helper.getTrigger(); Job<?, ?> actualProject = trigger.getActualProject(); for (GhprbExtension ext : Ghprb.getJobExtensions(trigger, GhprbSimpleStatus.class)) { if (ext instanceof GhprbSimpleStatus) { try { ((GhprbSimpleStatus) ext).createCommitStatus(actualProject, id, head, state, ghRepository, message); } catch (GhprbCommitStatusException e) { repo.commentOnFailure(null, null, e); } } } }
Source:
public int save(SqlStorage<FormDefRecord> formDefRecordStorage) { if (StringUtils.isEmpty(mFormFilePath)) { throw new SQLException("Can't save a form def with an empty form file path"); } File form = new File(mFormFilePath); if (StringUtils.isEmpty(mDisplayName)) { mDisplayName = form.getName(); } if (StringUtils.isEmpty(mFormMediaPath)) { mFormMediaPath = getMediaPath(mFormFilePath); } formDefRecordStorage.write(this); if (recordId == -1) { throw new SQLException("Failed to save the FormDefRecord " + toString()); } return recordId; }

Target:
public int save(SqlStorage<FormDefRecord> formDefRecordStorage) { if (StringUtils.isEmpty(mFormFilePath)) { Logger.log(LogTypes.SOFT_ASSERT, "Empty value for mFormFilePath while saving FormDefRecord"); } File form = new File(mFormFilePath); if (StringUtils.isEmpty(mDisplayName)) { mDisplayName = form.getName(); } if (StringUtils.isEmpty(mFormMediaPath)) { mFormMediaPath = getMediaPath(mFormFilePath); } formDefRecordStorage.write(this); if (recordId == -1) { throw new SQLException("Failed to save the FormDefRecord " + toString()); } return recordId; }
Source:
JSONArray getTurnServers(Client c, final boolean test) { JSONArray arr = new JSONArray(); if (!Strings.isEmpty(turnUrl)) { try { JSONObject turn = new JSONObject(); if ("rest".equalsIgnoreCase(turnMode)) { Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM); mac.init(new SecretKeySpec(turnSecret.getBytes(), HMAC_SHA1_ALGORITHM)); StringBuilder user = new StringBuilder() .append((test ? 60 : turnTtl * 60) + System.currentTimeMillis() / 1000L); final String uid = c.getUid(); if (uid != null && !Strings.isEmpty(uid)) { user.append(':').append(uid); } else if (!Strings.isEmpty(turnUser)) { user.append(':').append(turnUser); } turn.put("username", user) .put("credential", Base64.getEncoder().encodeToString(mac.doFinal(user.toString().getBytes()))); } else { turn.put("username", turnUser) .put("credential", turnSecret); } JSONArray urls = new JSONArray(); final String[] turnUrls = turnUrl.split(","); for (int i = 0; i < turnUrls.length; i++) { final String url = turnUrls[i]; if (!url.startsWith("stun:") && !url.startsWith("stuns:") && !url.startsWith("turn:") && !url.startsWith("turns:")) { urls.put("turn:" + url); } else { urls.put(url); } } turn.put("urls", urls); arr.put(turn); } catch (NoSuchAlgorithmException|InvalidKeyException e) { log.error("Unexpected error while creating turn", e); } } return arr; }

Target:
JSONArray getTurnServers(Client c, final boolean test) { JSONArray arr = new JSONArray(); if (!Strings.isEmpty(turnUrl)) { try { JSONObject turn = new JSONObject(); if ("rest".equalsIgnoreCase(turnMode)) { Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM); mac.init(new SecretKeySpec(turnSecret.getBytes(), HMAC_SHA1_ALGORITHM)); StringBuilder user = new StringBuilder() .append((test ? 60 : turnTtl * 60) + System.currentTimeMillis() / 1000L); final String uid = c == null ? null : c.getUid(); if (!Strings.isEmpty(uid)) { user.append(':').append(uid); } else if (!Strings.isEmpty(turnUser)) { user.append(':').append(turnUser); } turn.put("username", user) .put("credential", Base64.getEncoder().encodeToString(mac.doFinal(user.toString().getBytes()))); } else { turn.put("username", turnUser) .put("credential", turnSecret); } JSONArray urls = new JSONArray(); final String[] turnUrls = turnUrl.split(","); for (String url : turnUrls) { if (url.startsWith("stun:") || url.startsWith("stuns:") || url.startsWith("turn:") || url.startsWith("turns:")) { urls.put(url); } else { urls.put("turn:" + url); } } turn.put("urls", urls); arr.put(turn); } catch (NoSuchAlgorithmException|InvalidKeyException e) { log.error("Unexpected error while creating turn", e); } } return arr; }
Source:
public Optional<List> metacardValueToJsonValue( WorkspaceTransformer transformer, List metacardXMLStrings, Metacard workspaceMetacard) { final List<Map<String, Object>> listActions = getListActions(workspaceMetacard); final Optional<List> listMetacardOptional = super.metacardValueToJsonValue(transformer, metacardXMLStrings, workspaceMetacard); listMetacardOptional.ifPresent( listMetacards -> ((List<Object>) listMetacards) .stream() .filter(Map.class::isInstance) .map(Map.class::cast) .forEach(listMetacardMap -> listMetacardMap.put(ACTIONS_KEY, listActions))); return listMetacardOptional; }

Target:
public Optional<List> metacardValueToJsonValue( WorkspaceTransformer transformer, List metacardXMLStrings, Metacard workspaceMetacard) { final List<Map<String, Object>> listActions = getListActions(workspaceMetacard); final Optional<List> listMetacardsOptional = super.metacardValueToJsonValue(transformer, metacardXMLStrings, workspaceMetacard); listMetacardsOptional.ifPresent( listMetacards -> ((List<Object>) listMetacards) .stream() .filter(Map.class::isInstance) .map(Map.class::cast) .forEach(listMetacardMap -> listMetacardMap.put(ACTIONS_KEY, listActions))); return listMetacardsOptional; }
Source:
public ScalarFunctionImplementation(List<ScalarImplementationChoice> choices, boolean deterministic) { this.choices = choices; this.deterministic = deterministic; }

Target:
public ScalarFunctionImplementation(List<ScalarImplementationChoice> choices, boolean deterministic) { checkArgument(!choices.isEmpty(), "choices is an empty list"); this.choices = ImmutableList.copyOf(choices); this.deterministic = deterministic; }