auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected String getDomain(User user) { if (user.isSetDomain() && user.getDomain().isSetName()) { return user.getDomain().getName(); } else if (user.isSetDomain() && user.getDomain().isSetId()) { List<String> domains = getBackendCollection( String.class, VdcQueryType.GetDomainList, new VdcQueryParametersBase()); for (String domain :domains) { Guid domainId = asGuid(domain.getBytes(), true); if (domainId.toString().equals(user.getDomain().getId())) { return domain; } } throw new WebFaultException(null, "Domain: '" + user.getDomain().getId().toString() + "' does not exist.", Response.Status.BAD_REQUEST); } else if (user.isSetUserName() && user.getUserName().contains("@")) { return user.getUserName().substring(user.getUserName().lastIndexOf("@") + 1); } return null; }

Target:
protected String getDomain(User user) { if (user.isSetDomain() && user.getDomain().isSetName()) { return user.getDomain().getName(); } else if (user.isSetDomain() && user.getDomain().isSetId()) { List<String> domains = getBackendCollection( String.class, VdcQueryType.GetDomainList, new VdcQueryParametersBase()); for (String domain :domains) { Guid domainId = asGuid(domain.getBytes(), true); if (domainId.toString().equals(user.getDomain().getId())) { return domain; } } throw new WebFaultException(null, "Domain: '" + user.getDomain().getId().toString() + "' does not exist.", Response.Status.BAD_REQUEST); } else if (isNameContainsDomain(user)) { return user.getUserName().substring(user.getUserName().lastIndexOf("@") + 1); } return null; }
Source:
@Override public IgniteFuture<Void> changeMasterKey(String masterKeyName) { if (ctx.clientNode()) throw new UnsupportedOperationException("Client and daemon nodes can not perform this operation."); if (!ctx.state().clusterState().active()) throw new IgniteException("Master key change was rejected. The cluster is inactive."); checkMasterKeyChangeSupported(); if (masterKeyName.equals(getMasterKeyName())) return new IgniteFutureImpl<>(new GridFinishedFuture<>()); byte[] digest = masterKeyDigest(masterKeyName); PendingMasterKey request = new PendingMasterKey(UUID.randomUUID(), encryptKeyName(masterKeyName), digest); synchronized (opsMux) { if (disconnected) { throw new IgniteClientDisconnectedException(ctx.cluster().clientReconnectFuture(), "Master key change was rejected. Client node disconnected."); } if (stopped) throw new IgniteException("Master key change was rejected. Node is stopping."); if (masterKeyChangeFut != null && !masterKeyChangeFut.isDone()) throw new IgniteException("Master key change was rejected. Previous change was not completed."); masterKeyChangeFut = new MasterKeyChangeFuture(request.requestId()); } prepareProc.start(request.requestId(), request); return new IgniteFutureImpl<>(masterKeyChangeFut); }

Target:
@Override public IgniteFuture<Void> changeMasterKey(String masterKeyName) { if (ctx.clientNode()) { return new IgniteFinishedFutureImpl<>(new UnsupportedOperationException("Client and daemon nodes can not " + "perform this operation.")); } if (!IgniteFeatures.allNodesSupports(ctx.grid().cluster().nodes(), MASTER_KEY_CHANGE)) { return new IgniteFinishedFutureImpl<>(new IllegalStateException("Not all nodes in the cluster support " + "the master key change process.")); } if (!ctx.state().clusterState().active()) { return new IgniteFinishedFutureImpl<>(new IgniteException("Master key change was rejected. " + "The cluster is inactive.")); } if (masterKeyName.equals(getMasterKeyName())) { return new IgniteFinishedFutureImpl<>(new IgniteException("Master key change was rejected. " + "New name equal to the current.")); } byte[] digest; try { digest = masterKeyDigest(masterKeyName); } catch (Exception e) { return new IgniteFinishedFutureImpl<>(new IgniteException("Master key change was rejected. " + "Unable to get the master key digest.")); } MasterKeyChangeRequest request = new MasterKeyChangeRequest(UUID.randomUUID(), encryptKeyName(masterKeyName), digest); synchronized (opsMux) { if (disconnected) { return new IgniteFinishedFutureImpl<>(new IgniteClientDisconnectedException( ctx.cluster().clientReconnectFuture(), "Master key change was rejected. Client node disconnected.")); } if (stopped) { return new IgniteFinishedFutureImpl<>(new IgniteException("Master key change was rejected. " + "Node is stopping.")); } if (masterKeyChangeFut != null && !masterKeyChangeFut.isDone()) { return new IgniteFinishedFutureImpl<>(new IgniteException("Master key change was rejected. " + "The previous change was not completed.")); } masterKeyChangeFut = new MasterKeyChangeFuture(request.requestId()); prepareMKChangeProc.start(request.requestId(), request); return new IgniteFutureImpl<>(masterKeyChangeFut); } }
Source:
protected void showFileChooser() { final DCFileChooser fileChooser = new DCFileChooser(_userPreferences.getOpenDatastoreDirectory()); fileChooser.addChoosableFileFilter(FileFilters.ALL); fileChooser.setFileFilter(FileFilters.allDataFiles()); final int result = fileChooser.showOpenDialog(Dropzone.this); if (result == JFileChooser.APPROVE_OPTION) { final File file = fileChooser.getSelectedFile(); if (file.exists()) { final Datastore datastore; final String filename = file.getName(); if (_datastoreCatalog.containsDatastore(filename)) { datastore = _datastoreCatalog.getDatastore(filename); } else { datastore = DatastoreCreationUtil.createAndAddUniqueDatastoreFromFile(_datastoreCatalog, file); } _datastoreSelectListener.datastoreSelected(datastore); final File directory; if (file.isFile()) { directory = file.getParentFile(); } else if (file.isDirectory()) { directory = file; } else { directory = _userPreferences.getOpenDatastoreDirectory(); } _userPreferences.setOpenDatastoreDirectory(directory); } } }

Target:
protected void showFileChooser() { final DCFileChooser fileChooser = new DCFileChooser(_userPreferences.getOpenDatastoreDirectory()); fileChooser.addChoosableFileFilter(FileFilters.ALL); fileChooser.setFileFilter(FileFilters.allDataFiles()); final int result = fileChooser.showOpenDialog(Dropzone.this); if (result == JFileChooser.APPROVE_OPTION) { final File file = fileChooser.getSelectedFile(); if (file.exists()) { Datastore datastore = null; final String filename = file.getName(); final String filePath = file.getAbsolutePath(); final String[] datastoreNames = _datastoreCatalog.getDatastoreNames(); for (int i = 0; i < datastoreNames.length; i++) { final Datastore existingDatastore = _datastoreCatalog.getDatastore(datastoreNames[i]); if (existingDatastore instanceof FileDatastore) { FileDatastore fileDatastore = (FileDatastore) existingDatastore; final String datastoreFilename = fileDatastore.getFilename(); if (filename.equals(datastoreFilename) || filePath.equals(datastoreFilename)) { datastore = _datastoreCatalog.getDatastore(filename); } } } if (datastore == null) { datastore = DatastoreCreationUtil.createAndAddUniqueDatastoreFromFile(_datastoreCatalog, file); } _datastoreSelectListener.datastoreSelected(datastore); final File directory; if (file.isFile()) { directory = file.getParentFile(); } else if (file.isDirectory()) { directory = file; } else { directory = _userPreferences.getOpenDatastoreDirectory(); } _userPreferences.setOpenDatastoreDirectory(directory); } } }
Source:
private SourceSystemId parseSource(String lahdeJarjestelmaId) { if (StringUtils.isNotBlank(lahdeJarjestelmaId) && lahdeJarjestelmaId.contains(":")) { KoskiStudyProgrammeHandler handler = KoskiStudyProgrammeHandler.valueOf(StringUtils.substringBefore(lahdeJarjestelmaId, ":")); Long studentId = Long.valueOf(StringUtils.substringAfter(lahdeJarjestelmaId, ":")); return new SourceSystemId(handler, studentId); } return null; }

Target:
private SourceSystemId parseSource(String lahdeJarjestelmaId) { if (StringUtils.contains(lahdeJarjestelmaId, ":")) { KoskiStudyProgrammeHandler handler = KoskiStudyProgrammeHandler.valueOf(StringUtils.substringBefore(lahdeJarjestelmaId, ":")); Long studentId = Long.valueOf(StringUtils.substringAfter(lahdeJarjestelmaId, ":")); return new SourceSystemId(handler, studentId); } return null; }
Source:
private void handleRestoreInstanceStateRequest(InstanceControlMsg instanceControlMsg) { CheckpointManager.RestoreInstanceStateRequest request = instanceControlMsg.getRestoreInstanceStateRequest(); LOG.info("Restoring state to checkpoint id: " + request.getState().getCheckpointId()); isStatefulProcessingStarted = false; streamInCommunicator.clear(); metricsCollector.forceGatherAllMetrics(); slaveLooper.clearTasksOnWakeup(); slaveLooper.clearTimers(); slaveLooper.addTasksOnWakeup(this); metricsCollector = new MetricsCollector(slaveLooper, metricsOutCommunicator); if (instance != null) { instance.stop(); } instanceState.clear(); if (request.getState().hasState() && !request.getState().getState().isEmpty()) { @SuppressWarnings("unchecked") Map<byte[], byte[]> stateToRestore = (Map<byte[], byte[]>) Utils.deserialize( request.getState().getState().toByteArray()); instanceState.putAll(stateToRestore); } else { LOG.info("The restore request does not have an actual state"); } LOG.info("Instance state restored for checkpoint id: " + request.getState().getCheckpointId()); if (isInstanceStarted && helper != null) { LOG.info("Restarting instance"); resetCurrentAssignment(); } LOG.info("Acknowledge back the restore instance state response"); CheckpointManager.RestoreInstanceStateResponse response = CheckpointManager.RestoreInstanceStateResponse.newBuilder() .setCheckpointId(request.getState().getCheckpointId()) .build(); streamOutCommunicator.offer(response); }

Target:
private void handleRestoreInstanceStateRequest(InstanceControlMsg instanceControlMsg) { CheckpointManager.RestoreInstanceStateRequest request = instanceControlMsg.getRestoreInstanceStateRequest(); LOG.info("Restoring state to checkpoint id: " + request.getState().getCheckpointId()); isStatefulProcessingStarted = false; streamInCommunicator.clear(); metricsCollector.forceGatherAllMetrics(); slaveLooper.clearTasksOnWakeup(); slaveLooper.clearTimers(); slaveLooper.addTasksOnWakeup(this); metricsCollector = new MetricsCollector(slaveLooper, metricsOutCommunicator); if (instance != null) { instance.stop(); } if (instanceState != null) { instanceState.clear(); } if (request.getState().hasState() && !request.getState().getState().isEmpty()) { @SuppressWarnings("unchecked") State<? extends Serializable, ? extends Serializable> stateToRestore = (State<? extends Serializable, ? extends Serializable>) serializer.deserialize( request.getState().getState().toByteArray()); instanceState = stateToRestore; } else { LOG.info("The restore request does not have an actual state"); } LOG.info("Instance state restored for checkpoint id: " + request.getState().getCheckpointId()); if (isInstanceStarted && helper != null) { LOG.info("Restarting instance"); resetCurrentAssignment(); } LOG.info("Acknowledge back the restore instance state response"); CheckpointManager.RestoreInstanceStateResponse response = CheckpointManager.RestoreInstanceStateResponse.newBuilder() .setCheckpointId(request.getState().getCheckpointId()) .build(); streamOutCommunicator.offer(response); }
Source:
public static String getWikiOwnerFromWikiId(String wikiId) { if(PortalConfig.USER_TYPE.equals(getWikiTypeFromWikiId(wikiId)) || PortalConfig.PORTAL_TYPE.equals(getWikiTypeFromWikiId(wikiId))) { wikiId = wikiId.substring(wikiId.lastIndexOf('/') + 1); } return wikiId; }

Target:
public static String getWikiOwnerFromWikiId(String wikiId) { String wikiType = getWikiTypeFromWikiId(wikiId); if(PortalConfig.USER_TYPE.equals(wikiType) || PortalConfig.PORTAL_TYPE.equals(wikiType)) { wikiId = wikiId.substring(wikiId.lastIndexOf('/') + 1); } return wikiId; }
Source:
private static String propget(final File file, final String name) { final ProcessBuilder builder = new ProcessBuilder( "svn", "propget", name, file.getAbsolutePath() ); builder.redirectErrorStream(true); try { final Process process = builder.start(); process.waitFor(); return IOUtils.toString( process.getInputStream(), Charset.defaultCharset() ).trim(); } catch (final java.io.IOException ex) { throw new IllegalArgumentException(ex); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException(ex); } }

Target:
private static String propget(final File file, final String name) { final ProcessBuilder builder = new ProcessBuilder( "svn", "propget", name, file.getAbsolutePath() ); builder.redirectErrorStream(true); try { final Process process = builder.start(); process.waitFor(); return new UncheckedText( new TrimmedText( new TextOf( process.getInputStream() ) ) ).asString(); } catch (final java.io.IOException ex) { throw new IllegalArgumentException(ex); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException(ex); } }
Source:
public byte[] encrypt(byte[] plainTextBytes, String cipherTransformation, boolean returnSelfContainedCipherText) throws CryptoException { if (plainTextBytes == null) { throw new CryptoException("Plaintext can't be null."); } byte[] encryptedKey; try { CryptoService cryptoService = CarbonCoreDataHolder.getInstance().getCryptoService(); if(cryptoService == null){ throw new CryptoException("A crypto service implementation has not been registered."); } boolean isSymmetricKeyEncryptionEnabled = isSymmetricKeyEncryptionEnabled(); String algorithm = getDefaultEncryptionAlgorithm(isSymmetricKeyEncryptionEnabled); if (!StringUtils.isBlank(cipherTransformation)) { algorithm = cipherTransformation; if (log.isDebugEnabled()) { log.debug(String.format("Cipher transformation is enabled. Crypto algorithm: '%s'", algorithm)); } } if (StringUtils.isNotBlank(cipherTransformation) && plainTextBytes.length == 0) { if (log.isDebugEnabled()) { log.debug("Plaintext is empty. An empty array will be used as the ciphertext bytes."); } encryptedKey = StringUtils.EMPTY.getBytes(); } else { encryptedKey = cryptoService.encrypt(plainTextBytes, algorithm, CRYPTO_API_PROVIDER_BC); } if (StringUtils.isNotBlank(cipherTransformation) && returnSelfContainedCipherText && !isSymmetricKeyEncryptionEnabled) { Certificate certificate = cryptoService.getCertificate(CryptoContext .buildEmptyContext(MultitenantConstants.SUPER_TENANT_ID, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)); encryptedKey = createSelfContainedCiphertext(encryptedKey, algorithm, certificate); } } catch (Exception e) { throw new CryptoException("An error occurred while encrypting data.", e); } return encryptedKey; }

Target:
public byte[] encrypt(byte[] plainTextBytes, String cipherTransformation, boolean returnSelfContainedCipherText) throws CryptoException { if (plainTextBytes == null) { throw new CryptoException("Plaintext can't be null."); } byte[] encryptedKey; try { CryptoService cryptoService = CarbonCoreDataHolder.getInstance().getCryptoService(); if(cryptoService == null){ throw new CryptoException("A crypto service implementation has not been registered."); } String algorithm = null; if (!StringUtils.isBlank(cipherTransformation)) { algorithm = cipherTransformation; if (log.isDebugEnabled()) { log.debug(String.format("Cipher transformation is enabled. Crypto algorithm: '%s'", algorithm)); } } if (StringUtils.isNotBlank(cipherTransformation) && plainTextBytes.length == 0) { if (log.isDebugEnabled()) { log.debug("Plaintext is empty. An empty array will be used as the ciphertext bytes."); } encryptedKey = StringUtils.EMPTY.getBytes(); } else { encryptedKey = cryptoService .encrypt(plainTextBytes, algorithm, CRYPTO_API_PROVIDER_BC, returnSelfContainedCipherText); } } catch (Exception e) { throw new CryptoException("An error occurred while encrypting data.", e); } return encryptedKey; }
Source:
private void createTopic(final String topic, final int partitionsNum, final int replicaFactor, final long retentionMs, final long rotationMs) throws TopicCreationException { try { doWithZkUtils(zkUtils -> { final Properties topicConfig = new Properties(); topicConfig.setProperty("retention.ms", Long.toString(retentionMs)); topicConfig.setProperty("segment.ms", Long.toString(rotationMs)); AdminUtils.createTopic(zkUtils, topic, partitionsNum, replicaFactor, topicConfig); }); } catch (final TopicExistsException e) { throw new TopicCreationException("Topic with name " + topic + " already exists (or wasn't completely removed yet)", e); } catch (final Exception e) { throw new TopicCreationException("Unable to create topic " + topic, e); } final long timeoutMillis = TimeUnit.SECONDS.toMillis(5); final long borderTime = System.currentTimeMillis() + timeoutMillis; boolean creationConfirmed = false; while (!creationConfirmed && borderTime >= System.currentTimeMillis()) { try (Consumer<byte[], byte[]> consumer = kafkaFactory.getConsumer()) { final List<PartitionInfo> partitions = consumer.partitionsFor(topic); creationConfirmed = null != partitions; } } if (!creationConfirmed) { throw new TopicCreationException("Failed to confirm topic creation within " + timeoutMillis + " millis"); } }

Target:
private void createTopic(final String topic, final int partitionsNum, final int replicaFactor, final long retentionMs, final long rotationMs) throws TopicCreationException { try { doWithZkUtils(zkUtils -> { final Properties topicConfig = new Properties(); topicConfig.setProperty("retention.ms", Long.toString(retentionMs)); topicConfig.setProperty("segment.ms", Long.toString(rotationMs)); AdminUtils.createTopic(zkUtils, topic, partitionsNum, replicaFactor, topicConfig); }); } catch (final TopicExistsException e) { throw new TopicCreationException("Topic with name " + topic + " already exists (or wasn't completely removed yet)", e); } catch (final Exception e) { throw new TopicCreationException("Unable to create topic " + topic, e); } final long timeoutMillis = TimeUnit.SECONDS.toMillis(5); final Boolean allowsConsumption = Retryer.executeWithRetry(() -> { try (Consumer<byte[], byte[]> consumer = kafkaFactory.getConsumer()) { return null != consumer.partitionsFor(topic); } }, new RetryForSpecifiedTimeStrategy<Boolean>(timeoutMillis) .withWaitBetweenEachTry(100L) .withResultsThatForceRetry(Boolean.FALSE)); if (!Boolean.TRUE.equals(allowsConsumption)) { throw new TopicCreationException("Failed to confirm topic creation within " + timeoutMillis + " millis"); } }
Source:
private void ensureCallbackOrder(ChannelWriter channelWriter, int expectedCallbackId) { for (int i = expectedCallbackId; i < channelWriter.writes.size(); i++) { WriteCallback writeCallback = channelWriter.writes.get(i).writeCallback; if (expectedCallbackId == i) { assertTrue("Callback for the expected oldest chunk not invoked", writeCallback.callbackInvoked.get()); } else { assertFalse("Callback for a chunk younger than the expected is invoked", writeCallback.callbackInvoked.get()); } } }

Target:
private void ensureCallbackOrder(ChannelWriter channelWriter, int expectedCallbackId) { WriteCallback writeCallback = channelWriter.writes.get(expectedCallbackId).writeCallback; assertTrue("Callback for the expected oldest chunk not invoked", writeCallback.callbackInvoked.get()); for (int i = expectedCallbackId + 1; i < channelWriter.writes.size(); i++) { writeCallback = channelWriter.writes.get(i).writeCallback; assertFalse("Callback for a chunk younger than the expected is invoked", writeCallback.callbackInvoked.get()); } }
Source:
public DeleteSubRecord getDeleteSubRecord() { if (subRecord.getType().equals(SubRecord.Type.DELETE)) return (DeleteSubRecord) subRecord; return null; }

Target:
public DeleteSubRecord getDeleteSubRecord() { if (subRecord.getType().equals(SubRecord.Type.DELETE)) { return (DeleteSubRecord) subRecord; } return null; }
Source:
private void closeGroups(hdf5.Group[] groupArray) { for (int i = 0; i < groupArray.length; i++) { groupArray[i].deallocate(); } }

Target:
private void closeGroups(hdf5.Group[] groupArray) { for (int i = groupArray.length - 1; i >= 0; i--) { groupArray[i].deallocate(); } }
Source:
public UserAPI(@NonNull Config config, @NonNull OkHttpClient client) { Gson gson = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create(); RestAdapter restAdapter = new RestAdapter.Builder() .setClient(new OkClient(client)) .setEndpoint(config.getApiHostURL()) .setConverter(new GsonConverter(gson)) .setErrorHandler(new RetroHttpExceptionHandler()) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); userService = restAdapter.create(UserService.class); }

Target:
public UserAPI(@NonNull Config config, @NonNull OkHttpClient client) { Gson gson = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .setDateFormat(DateUtil.ISO_8601_DATE_TIME_FORMAT) .create(); RestAdapter restAdapter = new RestAdapter.Builder() .setClient(new OkClient(client)) .setEndpoint(config.getApiHostURL()) .setConverter(new GsonConverter(gson)) .setErrorHandler(new RetroHttpExceptionHandler()) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); userService = restAdapter.create(UserService.class); }
Source:
@Override public void onStateFinishMessage(ChangeGlobalStateFinishMessage msg) { DiscoveryDataClusterState state = globalState; if (msg.requestId().equals(state.transitionRequestId())) { log.info("Received state change finish message: " + msg.clusterActive()); globalState = state.finish(msg.success()); afterStateChangeFinished(msg.id(), msg.success()); ctx.cache().onStateChangeFinish(msg); boolean prev = ctx.cache().context().readOnlyMode(); if (prev != globalState.readOnly()) { ctx.cache().context().readOnlyMode(globalState.readOnly()); log.info("Read-only mode was changed! Was enabled: " + prev + ", now enabled: " + globalState.readOnly()); } TransitionOnJoinWaitFuture joinFut = this.joinFut; if (joinFut != null) joinFut.onDone(false); GridFutureAdapter<Void> transitionFut = transitionFuts.remove(state.transitionRequestId()); if (transitionFut != null) { state.setTransitionResult(msg.requestId(), msg.clusterActive()); transitionFut.onDone(); } } else U.warn(log, "Received state finish message with unexpected ID: " + msg); }

Target:
@Override public void onStateFinishMessage(ChangeGlobalStateFinishMessage msg) { DiscoveryDataClusterState state = globalState; if (msg.requestId().equals(state.transitionRequestId())) { log.info("Received state change finish message: " + msg.clusterActive()); globalState = state.finish(msg.success()); afterStateChangeFinished(msg.id(), msg.success()); ctx.cache().onStateChangeFinish(msg); boolean prev = ctx.cache().context().readOnlyMode(); if (prev != globalState.readOnly()) { ctx.cache().context().readOnlyMode(globalState.readOnly()); if (globalState.readOnly()) log.info("Read-only mode is enabled"); else log.info("Read-only mode is disabled"); } TransitionOnJoinWaitFuture joinFut = this.joinFut; if (joinFut != null) joinFut.onDone(false); GridFutureAdapter<Void> transitionFut = transitionFuts.remove(state.transitionRequestId()); if (transitionFut != null) { state.setTransitionResult(msg.requestId(), msg.clusterActive()); transitionFut.onDone(); } } else U.warn(log, "Received state finish message with unexpected ID: " + msg); }
Source:
@Override public void stop(boolean cancel) { if (jobAlwaysActivate) activeJobs.clear(); else activeJobs = new JobsMap(1024, 0.75f, 256); activeJobsMetric.reset(); cancelledJobs.clear(); cancelReqs = new GridBoundedConcurrentLinkedHashMap<>(FINISHED_JOBS_COUNT, FINISHED_JOBS_COUNT < 128 ? FINISHED_JOBS_COUNT : 128, 0.75f, 16); if (log.isDebugEnabled()) log.debug("Job processor stopped."); }

Target:
@Override public void stop(boolean cancel) { activeJobs = initJobsMap(jobAlwaysActivate); activeJobsMetric.reset(); cancelledJobs.clear(); cancelReqs = new GridBoundedConcurrentLinkedHashMap<>(FINISHED_JOBS_COUNT, FINISHED_JOBS_COUNT < 128 ? FINISHED_JOBS_COUNT : 128, 0.75f, 16); if (log.isDebugEnabled()) log.debug("Job processor stopped."); }
Source:
public boolean isLive(BindableService service) { return !isShutdown() && isScheduledForDeployment(service); }

Target:
public boolean isLive(BindableService service) { final boolean inShutdownState = isShutdown(); final boolean scheduledForDeployment = isScheduledForDeployment(service); final boolean result = !inShutdownState && scheduledForDeployment; return result; }
Source:
public void testSetNotesOnVirtualGuestWhenResponseIs2xx() { HttpRequest setNodesOnVirtualGuest = HttpRequest.builder().method("POST") .endpoint("<LINK_0>") .addHeader("Accept", "application/json") .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==") .payload(payloadFromResourceWithContentType("/virtual_guest_set_notes.json", MediaType.APPLICATION_JSON)) .build(); HttpResponse setNotesOnVirtualGuestResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResource("/virtual_guest_set_notes_response.json")).build(); SoftLayerApi api = requestSendsResponse(setNodesOnVirtualGuest, setNotesOnVirtualGuestResponse); VirtualGuest virtualGuest = createVirtualGuest(); assertTrue(api.getVirtualGuestApi().setNotes(virtualGuest.getId(), "some notes")); }

Target:
public void testSetNotesOnVirtualGuestWhenResponseIs2xx() { HttpRequest setNodesOnVirtualGuest = HttpRequest.builder().method("POST") .endpoint("<LINK_0>") .addHeader("Accept", "application/json") .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==") .payload(payloadFromResourceWithContentType("/virtual_guest_set_notes.json", MediaType.APPLICATION_JSON)) .build(); HttpResponse setNotesOnVirtualGuestResponse = HttpResponse.builder().statusCode(200) .payload("true").build(); SoftLayerApi api = requestSendsResponse(setNodesOnVirtualGuest, setNotesOnVirtualGuestResponse); VirtualGuest virtualGuest = createVirtualGuest(); assertTrue(api.getVirtualGuestApi().setNotes(virtualGuest.getId(), "some notes")); }
Source:
public BaseResponseDto findUserPointsOrders(BaseParamDto baseParamDto) { Integer index = baseParamDto.getIndex(); Integer pageSize = baseParamDto.getPageSize(); if (index == null || pageSize == null || index <= 0 || pageSize <= 0) { return new BaseResponseDto<>(ReturnMessage.REQUEST_PARAM_IS_WRONG.getCode(), ReturnMessage.REQUEST_PARAM_IS_WRONG.getMsg()); } index = (baseParamDto.getIndex() - 1) * pageSize; List<ProductOrderViewDto> productOrderListByLoginName = productOrderMapper.findProductOrderListByLoginName(baseParamDto.getBaseParam().getUserId(), index, pageSize); ProductListOrderResponseDto productListOrderResponseDto = new ProductListOrderResponseDto(); if (CollectionUtils.isNotEmpty(productOrderListByLoginName)) { Iterator<ProductOrderResponseDto> transform = Iterators.transform(productOrderListByLoginName.iterator(), new Function<ProductOrderViewDto, ProductOrderResponseDto>() { @Override public ProductOrderResponseDto apply(ProductOrderViewDto input) { return new ProductOrderResponseDto(input); } }); productListOrderResponseDto.setOrders(Lists.newArrayList(transform)); productListOrderResponseDto.setIndex(baseParamDto.getIndex()); productListOrderResponseDto.setPageSize(baseParamDto.getPageSize()); productListOrderResponseDto.setTotalCount((int) productOrderMapper.findProductOrderListByLoginNameCount(baseParamDto.getBaseParam().getUserId())); } BaseResponseDto baseResponseDto = new BaseResponseDto(); baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); baseResponseDto.setData(productListOrderResponseDto); return baseResponseDto; }

Target:
public BaseResponseDto findUserPointsOrders(BaseParamDto baseParamDto) { Integer index = baseParamDto.getIndex(); Integer pageSize = baseParamDto.getPageSize(); if (index == null || pageSize == null || index <= 0 || pageSize <= 0) { index = 0; pageSize = 10; } index = (index - 1) * pageSize; List<ProductOrderViewDto> productOrderListByLoginName = productOrderMapper.findProductOrderListByLoginName(baseParamDto.getBaseParam().getUserId(), index, pageSize); ProductListOrderResponseDto productListOrderResponseDto = new ProductListOrderResponseDto(); if (CollectionUtils.isNotEmpty(productOrderListByLoginName)) { Iterator<ProductOrderResponseDto> transform = Iterators.transform(productOrderListByLoginName.iterator(), new Function<ProductOrderViewDto, ProductOrderResponseDto>() { @Override public ProductOrderResponseDto apply(ProductOrderViewDto input) { return new ProductOrderResponseDto(input); } }); productListOrderResponseDto.setOrders(Lists.newArrayList(transform)); productListOrderResponseDto.setIndex(baseParamDto.getIndex()); productListOrderResponseDto.setPageSize(baseParamDto.getPageSize()); productListOrderResponseDto.setTotalCount(Integer.parseInt(String.valueOf(productOrderMapper.findProductOrderListByLoginNameCount(baseParamDto.getBaseParam().getUserId())))); } BaseResponseDto baseResponseDto = new BaseResponseDto(); baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); baseResponseDto.setData(productListOrderResponseDto); baseResponseDto.setMessage(ReturnMessage.SUCCESS.getMsg()); return baseResponseDto; }
Source:
private List<String> getOcspUrlsFromCert(X509Certificate cert) { List<String> ocspUrls = new ArrayList<>(); try { byte[] authorityInfoAccess = cert.getExtensionValue(Extension.authorityInfoAccess.getId()); if (authorityInfoAccess == null) { return ocspUrls; } AuthorityInformationAccess authorityInformationAccess = AuthorityInformationAccess.getInstance( X509ExtensionUtil.fromExtensionValue(authorityInfoAccess)); if (authorityInformationAccess == null) { return ocspUrls; } for (AccessDescription description : authorityInformationAccess.getAccessDescriptions()) { GeneralName accessLocation = description.getAccessLocation(); if (accessLocation.getTagNo() == GeneralName.uniformResourceIdentifier) ocspUrls.add(((DERIA5String) accessLocation.getName()).getString()); } } catch (IOException ignore) { } return ocspUrls; }

Target:
private List<String> getOcspUrlsFromCert(X509Certificate cert) { List<String> ocspUrls = new ArrayList<>(); try { byte[] authorityInfoAccess = cert.getExtensionValue(Extension.authorityInfoAccess.getId()); if (authorityInfoAccess == null) { return ocspUrls; } AuthorityInformationAccess authorityInformationAccess = AuthorityInformationAccess.getInstance( X509ExtensionUtil.fromExtensionValue(authorityInfoAccess)); if (authorityInformationAccess == null) { return ocspUrls; } for (AccessDescription description : authorityInformationAccess.getAccessDescriptions()) { GeneralName accessLocation = description.getAccessLocation(); if (accessLocation.getTagNo() == GeneralName.uniformResourceIdentifier) ocspUrls.add(((DERIA5String) accessLocation.getName()).getString()); } } catch (IOException e) { LOGGER.debug( "Problem retrieving the OCSP server url(s) from the certificate." + CONTINUING_MSG, e); } return ocspUrls; }
Source:
private void stopProxyServer(ProxyServer proxyServer) { log.info("Stopping alt proxy server: " + proxyServer.getProxyParam().getProxyIp()); Control.getSingleton().getExtensionLoader().getExtension(ExtensionHistory.class).unregisterProxy(proxyServer); proxyServer.stopServer(); }

Target:
private void stopProxyServer(ProxyServer proxyServer) { log.info( "Stopping alt proxy server: " + proxyServer.getProxyParam().getProxyIp() + ":" + proxyServer.getProxyParam().getProxyPort()); Control.getSingleton().getExtensionLoader().getExtension(ExtensionHistory.class).unregisterProxy(proxyServer); proxyServer.stopServer(); }
Source:
public void createArtifact(@Nullable ArtifactToken parent, ArtifactToken artifact) { ArtifactToken art = createArtifact(artifact); addChild(parent, art); }

Target:
public void createArtifact(@Nullable ArtifactToken parent, ArtifactToken artifact) { ArtifactToken art = createArtifact(artifact); if (parent != null) { addChild(parent, art); } }
Source:
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue, List<String> newLabels) { CompletableFuture<Boolean> result = new CompletableFuture<>(); List<String> originalLabels = issue.getLabels(); logger.info("Changing labels for " + issue + " on UI"); CompletableFuture<Optional<TurboIssue>> localLabelsReplaceFuture = repoOpControl.replaceIssueLabelsLocally(issue, newLabels); localLabelsReplaceFuture.thenRun(this::refreshUI); updateIssueLabelsOnServer(issue, newLabels) .exceptionally((e) -> { result.completeExceptionally(e); return false; }) .thenCombine(localLabelsReplaceFuture, (isUpdateSuccessful, locallyModifiedIssue) -> handleIssueLabelsUpdateResult(isUpdateSuccessful, locallyModifiedIssue, originalLabels)) .thenAccept((isReplacementSuccessful) -> { if (!result.isCompletedExceptionally()) { result.complete(isReplacementSuccessful); } }); return result; }

Target:
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue, List<String> newLabels) { CompletableFuture<Boolean> result = new CompletableFuture<>(); List<String> originalLabels = issue.getLabels(); logger.info("Changing labels for " + issue + " on UI"); CompletableFuture<Optional<TurboIssue>> localLabelsReplaceFuture = repoOpControl.replaceIssueLabelsLocally(issue, newLabels); localLabelsReplaceFuture.thenRun(this::refreshUI); updateIssueLabelsOnServer(issue, newLabels) .exceptionally((e) -> { result.completeExceptionally(e); return false; }) .thenCombine(localLabelsReplaceFuture, (isUpdateSuccessful, locallyModifiedIssue) -> handleIssueLabelsUpdateResult(isUpdateSuccessful, locallyModifiedIssue, originalLabels)) .thenAccept(result::complete); return result; }
Source:
public void createPullRequest() throws Exception { String projectUrl = testAuxiliaryRepo.getHtmlUrl() + ".git"; projectExplorer.waitProjectExplorer(); menu.runCommand(WORKSPACE, IMPORT_PROJECT); importWidget.waitAndTypeImporterAsGitInfo(projectUrl, PROJECT_NAME); configureTypeOfProject(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.openItemByPath(PROJECT_NAME); openFileAndChangeContent(PATH_TO_README_FILE, generate("", 12)); pullRequestPanel.clickPullRequestBtn(); pullRequestPanel.enterComment(COMMENT); pullRequestPanel.enterTitle(TITLE); pullRequestPanel.clickCreatePRBtn(); pullRequestPanel.clickOkCommitBtn(); pullRequestPanel.waitStatusOk(FORK_CREATED); pullRequestPanel.waitStatusOk(BRANCH_PUSHED_ON_YOUR_FORK); pullRequestPanel.waitMessage(PULL_REQUEST_CREATED); }

Target:
public void createPullRequest() throws Exception { projectExplorer.waitProjectExplorer(); git.importJavaApp(testGitHubRepository.getHtmlUrl(), PROJECT_NAME, MAVEN); projectExplorer.openItemByPath(PROJECT_NAME); openFileAndChangeContent(PATH_TO_README_FILE, generate("", 12)); pullRequestPanel.clickPullRequestBtn(); pullRequestPanel.enterComment(COMMENT); pullRequestPanel.enterTitle(TITLE); pullRequestPanel.clickCreatePRBtn(); pullRequestPanel.clickOkCommitBtn(); pullRequestPanel.waitStatusOk(FORK_CREATED); pullRequestPanel.waitStatusOk(BRANCH_PUSHED_ON_YOUR_FORK); pullRequestPanel.waitMessage(PULL_REQUEST_CREATED); }
Source:
private void sendIfEnabled(MetricAttribute type, String name, double value, long timestamp) throws IOException { if (isMetricAttributeDisabled(type)){ return; } graphite.send(prefix(name, type.getCode()), format(value), timestamp); }

Target:
private void sendIfEnabled(MetricAttribute type, String name, double value, long timestamp) throws IOException { if (getDisabledMetricAttributes().contains(type)){ return; } graphite.send(prefix(name, type.getCode()), format(value), timestamp); }
Source:
private void makeAttributesModifiable() { if (!attributesCanBeModified) { this.attributesCanBeModified = true; final Map<String, Object> tempAttributes = attributes; this.attributes = new HashMap<>(); if (tempAttributes != null) { this.attributes = new HashMap<>(tempAttributes); } } }

Target:
private void makeAttributesModifiable() { if (!attributesCanBeModified) { this.attributesCanBeModified = true; final Map<String, Object> tempAttributes = attributes; if (tempAttributes != null) { this.attributes = new HashMap<>(tempAttributes); } else { this.attributes = new HashMap<>(); } } }
Source:
public TransportDataMessage(byte[] data) { try { this.version = data[0]; this.messageType = data[1]; this.channelName = new String(data, 4, 16, "UTF-8"); if (messageType == 5) { byte[] logicalTimestampMsBytes = Arrays.copyOfRange(data, 20, 28); this.logicalTimestampMs = ByteBuffer.wrap(logicalTimestampMsBytes).getLong(); byte[] payload = Arrays.copyOfRange(data, 32, data.length); for (int element = 0; element < (payload.length / 17); element++) { int index = element * 17; byte[] tsIdBytes = Arrays.copyOfRange(payload, index + 1, index + 9); String encodedTsId = StringUtils .remove(DatatypeConverter.printBase64Binary(tsIdBytes), "="); Map<String, Object> elementMap = new HashMap<String, Object>(4); elementMap.put("tsId", encodedTsId); byte[] valueBytes = Arrays.copyOfRange(payload, index + 9, index + 17); switch (payload[index]) { case 1: elementMap.put("value", ByteBuffer.wrap(valueBytes).getLong()); break; case 2: elementMap.put("value", ByteBuffer.wrap(valueBytes).getDouble()); break; default: log.warn("ignoring data message with unknown value type {}", payload[index]); continue; } this.data.add(elementMap); } } else { log.warn("Unsupported binary message type {}", messageType); } } catch (Exception ex) { log.error("failed to construct transport data message", ex); } }

Target:
public TransportDataMessage(byte[] data) { try { ByteBuffer buffer = ByteBuffer.wrap(data); this.version = buffer.get(0); this.kind = Kind.fromBinaryType(buffer.get(1)); this.channelName = new String(data, 4, 16, "UTF-8"); if (this.kind == Kind.DATA) { this.logicalTimestampMs = buffer.getLong(20); byte[] payload = Arrays.copyOfRange(data, 32, data.length); for (int element = 0; element < (payload.length / 17); element++) { int index = element * 17; byte[] tsIdBytes = Arrays.copyOfRange(payload, index + 1, index + 9); String encodedTsId = StringUtils .remove(DatatypeConverter.printBase64Binary(tsIdBytes), "="); Map<String, Object> elementMap = new HashMap<String, Object>(4); elementMap.put("tsId", encodedTsId); switch (payload[index]) { case 1: elementMap.put("value", buffer.getLong(index + 41)); break; case 2: elementMap.put("value", buffer.getDouble(index + 41)); break; default: log.warn("ignoring data message with unknown value type {}", payload[index]); continue; } this.data.add(elementMap); } } else { log.warn("Unsupported binary message type {}", this.kind); } } catch (Exception ex) { log.error("failed to construct transport data message", ex); } }
Source:
public VoltCSVFormatter create(String formatName, Properties props) { VoltCSVFormatter formatter = new VoltCSVFormatter(formatName, props); return formatter; }

Target:
public Formatter<String> create(String formatName, Properties props) { if(useSuperCsv(props)){ return new VoltSuperCSVFormatter(formatName, props); } return new VoltCSVFormatter(formatName, props); }
Source:
private String computeRelativePathToRoot(){ if (this.root.equals(this.f)) { return ""; } LinkedList<String> relativePath = new LinkedList<>(); FilePath current = this.f; while (current != null && !current.equals(this.root)) { relativePath.addFirst(current.getName()); current = current.getParent(); } return String.join("/", relativePath) + "/"; }

Target:
private String computeRelativePathToRoot(){ if (this.root.equals(this.f)) { return ""; } LinkedList<String> relativePath = new LinkedList<>(); FilePath current = this.f; while (current != null && !current.equals(this.root)) { relativePath.addFirst(current.getName()); current = current.getParent(); } return joinWithForwardSlashes(relativePath); }
Source:
public dClass(String s) { path=s; dclass_index=0; isDClassInitialized = ( init() >= 0); }

Target:
public dClass(String s) { path=s; dclass_index=0; isDClassInitialized = ( init(s) >= 0); }
Source:
public void syncPostBatch(final String topicId, final List<BatchItem> batch) throws EventPublishingException { final CountDownLatch done = new CountDownLatch(batch.size()); for (final BatchItem item : batch) { final ProducerRecord<String, String> record = new ProducerRecord<>(topicId, toKafkaPartition(item.getPartition()), item.getPartition(), item.getEvent().toString()); item.setStep(EventPublishingStep.PUBLISHING); try { kafkaProducer.send(record, kafkaSendCallback(item, done)); } catch (InterruptException | SerializationException | BufferExhaustedException e) { item.safeFail("internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } } try { final boolean isSuccessful = done.await(settings.getKafkaSendTimeoutMs(), TimeUnit.MILLISECONDS); if (!isSuccessful) { for (final BatchItem item : batch) { item.safeFail("timed out"); } throw new EventPublishingException("Timeout publishing events"); } } catch (InterruptedException e) { for (final BatchItem item : batch) { item.safeFail("internal error"); } throw new EventPublishingException("Error publishing message to kafka", e); } }

Target:
public void syncPostBatch(final String topicId, final List<BatchItem> batch) throws EventPublishingException { final CountDownLatch done = new CountDownLatch(batch.size()); for (final BatchItem item : batch) { final ProducerRecord<String, String> record = new ProducerRecord<>(topicId, toKafkaPartition(item.getPartition()), item.getPartition(), item.getEvent().toString()); item.setStep(EventPublishingStep.PUBLISHING); try { kafkaProducer.send(record, kafkaSendCallback(item, done)); } catch (InterruptException | SerializationException | BufferExhaustedException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } } try { final boolean isSuccessful = done.await(settings.getKafkaSendTimeoutMs(), TimeUnit.MILLISECONDS); if (!isSuccessful) { failBatch(batch, "timed out"); throw new EventPublishingException("Timeout publishing events"); } } catch (InterruptedException e) { failBatch(batch, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } }
Source:
private Geometry standardizeGeometry(Geometry geometry) { if (geometry instanceof GeometryCollection && !(geometry instanceof MultiPolygon)) { return standardizeGeometryCollection((GeometryCollection) geometry); } if (geometry instanceof LinearRing) { return linearRingToLineString(geometry); } return geometry; }

Target:
private Geometry standardizeGeometry(Geometry geometry) { if (geometry instanceof GeometryCollection) { return standardizeGeometryCollection((GeometryCollection) geometry); } if (geometry instanceof LinearRing) { return linearRingToLineString((LinearRing) geometry); } return geometry; }
Source:
default boolean acquirePatiently(Duration timeout) { long timeWaited = 0L; while (timeWaited < timeout.toMillis()) { final OptionalLong waitTime = getWaitTimeForPermit(); if (!waitTime.isPresent()) { return true; } else { final long timeToSleep = Math.max(100, waitTime.getAsLong()); try { Thread.sleep(timeToSleep); timeWaited += timeToSleep; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw Throwables.propagate(e); } } } return false; }

Target:
default boolean acquirePatiently(Duration timeout) { long timeWaited = 0L; while (timeWaited < timeout.toMillis()) { final OptionalLong waitTime = getWaitTimeForPermit(); if (!waitTime.isPresent()) { return true; } else { final long timeAvailableToWait = timeout.toMillis() - timeWaited; final long timeToSleep = Math.min(timeAvailableToWait, waitTime.getAsLong()); try { Thread.sleep(timeToSleep); timeWaited += timeToSleep; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw Throwables.propagate(e); } } } return false; }
Source:
private List<? extends ResourceTag> getResourceTags(final List<String> resourceIds, ResourceObjectType resourceType) { List<String> uuids = new ArrayList<String>(); List<String> internalIds = new ArrayList<String>(); for(String resourceId : resourceIds){ if(resourceId.matches("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")){ uuids.add(resourceId); }else{ Long internalId = null; try { internalId = Long.parseLong(resourceId); } catch (final NumberFormatException e) { internalId = null; } if (internalId != null) { internalIds.add(resourceId); }else{ throw new InvalidParameterValueException("Invalid resourceId"); } } } SearchBuilder<ResourceTagVO> sb = _resourceTagDao.createSearchBuilder(); if(!uuids.isEmpty() && !internalIds.isEmpty()){ throw new InvalidParameterValueException("Expecting only uuids or Ids"); }else if (!uuids.isEmpty()){ sb.and("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.IN); }else if (!internalIds.isEmpty()){ sb.and("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.IN); } sb.and("resourceType", sb.entity().getResourceType(), SearchCriteria.Op.EQ); SearchCriteria<ResourceTagVO> sc = sb.create(); if (!uuids.isEmpty()){ sc.setParameters("resourceUuid", resourceIds.toArray()); }else if (!internalIds.isEmpty()){ sc.setParameters("resourceId", resourceIds.toArray()); } sc.setParameters("resourceType", resourceType); return _resourceTagDao.search(sc, null); }

Target:
private List<? extends ResourceTag> getResourceTags(final List<String> resourceIds, ResourceObjectType resourceType) { List<String> uuids = new ArrayList<String>(); List<String> internalIds = new ArrayList<String>(); for(String resourceId : resourceIds){ if(resourceId.matches("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")){ uuids.add(resourceId); }else{ try { Long.parseLong(resourceId); } catch (final NumberFormatException e) { throw new InvalidParameterValueException("Invalid resourceId"); } internalIds.add(resourceId); } } SearchBuilder<ResourceTagVO> sb = _resourceTagDao.createSearchBuilder(); if(!uuids.isEmpty() && !internalIds.isEmpty()){ throw new InvalidParameterValueException("Expecting only uuids or Ids"); }else if (!uuids.isEmpty()){ sb.and("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.IN); }else if (!internalIds.isEmpty()){ sb.and("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.IN); } sb.and("resourceType", sb.entity().getResourceType(), SearchCriteria.Op.EQ); SearchCriteria<ResourceTagVO> sc = sb.create(); if (!uuids.isEmpty()){ sc.setParameters("resourceUuid", resourceIds.toArray()); }else if (!internalIds.isEmpty()){ sc.setParameters("resourceId", resourceIds.toArray()); } sc.setParameters("resourceType", resourceType); return _resourceTagDao.search(sc, null); }
Source:
public void setMaxSize( int maxSize ) { this.maxSize = maxSize; }

Target:
void setMaxSize( int maxSize ) { this.maxSize = maxSize; }
Source:
public CommandProvider() { }

Target:
public CommandProvider() { idToCommand = new HashMap<>(); }
Source:
public static Certificate map(CertificateInfo entity, Certificate template) { Certificate model = template != null ? template : new Certificate(); model.setContent(entity.getPayload()); model.setSubject(entity.getDescription()); return model; }

Target:
public static Certificate map(CertificateInfo entity, Certificate template) { Certificate model = template != null ? template : new Certificate(); model.setContent(entity.getPayload()); model.setSubject(entity.getSubject()); model.setDescription(entity.getDescription()); return model; }
Source:
public Set<Type> getImportTypes() { Set<Type> imported = new HashSet(super.getImportTypes()); imported.addAll( importTypes ); if ( assignment != null ) { imported.addAll( assignment.getImportTypes() ); } return imported; }

Target:
public Set<Type> getImportTypes() { Set<Type> imported = org.mapstruct.ap.util.Collections.asSet( importTypes, super.getImportTypes() ); if ( assignment != null ) { imported.addAll( assignment.getImportTypes() ); } return imported; }