auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static ParallelTransferOptions populateAndApplyDefaults(ParallelTransferOptions other) { other = other == null ? new ParallelTransferOptions(null, null, null, null) : other; if (other.getBlockSize() != null) { StorageImplUtils.assertInBounds("ParallelTransferOptions.blockSize", other.getBlockSize(), 1, MAX_APPEND_FILE_BYTES); } if (other.getMaxSingleUploadSize() != null) { StorageImplUtils.assertInBounds("ParallelTransferOptions.maxSingleUploadSize", other.getMaxSingleUploadSize(), 1, MAX_APPEND_FILE_BYTES); } return new ParallelTransferOptions( other.getBlockSize() == null ? Integer.valueOf(FILE_DEFAULT_UPLOAD_BLOCK_SIZE) : other.getBlockSize(), other.getNumBuffers() == null ? Integer.valueOf(FILE_DEFAULT_NUMBER_OF_BUFFERS) : other.getNumBuffers(), other.getProgressReceiver(), other.getMaxSingleUploadSize() == null ? Integer.valueOf(MAX_APPEND_FILE_BYTES) : other.getMaxSingleUploadSize(), other.getMaxConcurrency() == null ? Integer.valueOf(Queues.SMALL_BUFFER_SIZE) : other.getMaxConcurrency()); }

Target:
public static ParallelTransferOptions populateAndApplyDefaults(ParallelTransferOptions other) { other = other == null ? new ParallelTransferOptions(null, null, null, null) : other; if (other.getBlockSize() != null) { StorageImplUtils.assertInBounds("ParallelTransferOptions.blockSize", other.getBlockSize(), 1, MAX_APPEND_FILE_BYTES); } if (other.getMaxSingleUploadSize() != null) { StorageImplUtils.assertInBounds("ParallelTransferOptions.maxSingleUploadSize", other.getMaxSingleUploadSize(), 1, MAX_APPEND_FILE_BYTES); } return new ParallelTransferOptions( other.getBlockSize() == null ? Integer.valueOf(FILE_DEFAULT_UPLOAD_BLOCK_SIZE) : other.getBlockSize(), other.getMaxConcurrency() == null ? Integer.valueOf(FILE_DEFAULT_NUMBER_OF_BUFFERS) : other.getMaxConcurrency(), other.getProgressReceiver(), other.getMaxSingleUploadSize() == null ? Integer.valueOf(MAX_APPEND_FILE_BYTES) : other.getMaxSingleUploadSize()); }
Source:
public void testCreateIncludesRequestValidatorInterceptorOutcome() throws IOException { RequestValidatingInterceptor interceptor = new RequestValidatingInterceptor(); assertTrue(interceptor.isAddValidationResultsToResponseOperationOutcome()); interceptor.setFailOnSeverity(null); ourRestServer.registerInterceptor(interceptor); try { Observation obs = new Observation(); obs.addIdentifier().setSystem("urn:foo").setValue("bar"); IBaseResource outcome = ourClient.create().resource(obs).execute().getOperationOutcome(); String encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome); ourLog.info(encodedOo); assertThat(encodedOo, containsString("The content of element 'Observation' is not complete")); assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/")); interceptor.setAddValidationResultsToResponseOperationOutcome(false); outcome = ourClient.create().resource(obs).execute().getOperationOutcome(); encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome); ourLog.info(encodedOo); assertThat(encodedOo, not(containsString("The content of element 'Observation' is not complete"))); assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/")); } finally { ourRestServer.unregisterInterceptor(interceptor); } }

Target:
public void testCreateIncludesRequestValidatorInterceptorOutcome() throws IOException { RequestValidatingInterceptor interceptor = new RequestValidatingInterceptor(); assertTrue(interceptor.isAddValidationResultsToResponseOperationOutcome()); interceptor.setFailOnSeverity(null); ourRestServer.registerInterceptor(interceptor); try { Observation obs = new Observation(); obs.addIdentifier().setSystem("urn:foo").setValue("bar"); IBaseResource outcome = ourClient.create().resource(obs).execute().getOperationOutcome(); String encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome); ourLog.info(encodedOo); assertThat(encodedOo, containsString("cvc-complex-type.2.4.b")); assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/")); interceptor.setAddValidationResultsToResponseOperationOutcome(false); outcome = ourClient.create().resource(obs).execute().getOperationOutcome(); encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome); ourLog.info(encodedOo); assertThat(encodedOo, not(containsString("cvc-complex-type.2.4.b"))); assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/")); } finally { ourRestServer.unregisterInterceptor(interceptor); } }
Source:
public static SortedMap<String, Object> allDefaults(){ final SortedMap<String, Object> result = new TreeMap<>(); result.put("CREATE_INDEX", CREATE_INDEX); result.put("CREATE_MD5", CREATE_MD5); result.put("USE_ASYNC_IO_READ_FOR_SAMTOOLS", USE_ASYNC_IO_READ_FOR_SAMTOOLS); result.put("USE_ASYNC_IO_WRITE_FOR_SAMTOOLS", USE_ASYNC_IO_WRITE_FOR_SAMTOOLS); result.put("USE_ASYNC_IO_WRTIE_FOR_TRIBBLE", USE_ASYNC_IO_WRITE_FOR_TRIBBLE); result.put("COMPRESSION_LEVEL", COMPRESSION_LEVEL); result.put("BUFFER_SIZE", BUFFER_SIZE); result.put("NON_ZERO_BUFFER_SIZE", NON_ZERO_BUFFER_SIZE); result.put("REFERENCE_FASTA", REFERENCE_FASTA); result.put("USE_CRAM_REF_DOWNLOAD", USE_CRAM_REF_DOWNLOAD); result.put("EBI_REFERENCE_SERVICE_URL_MASK", EBI_REFERENCE_SERVICE_URL_MASK); result.put("CUSTOM_READER_FACTORY", CUSTOM_READER_FACTORY); result.put("SAM_FLAG_FIELD_FORMAT", SAM_FLAG_FIELD_FORMAT); return Collections.unmodifiableSortedMap(result); }

Target:
public static SortedMap<String, Object> allDefaults(){ final SortedMap<String, Object> result = new TreeMap<>(); result.put("CREATE_INDEX", CREATE_INDEX); result.put("CREATE_MD5", CREATE_MD5); result.put("USE_ASYNC_IO_READ_FOR_SAMTOOLS", USE_ASYNC_IO_READ_FOR_SAMTOOLS); result.put("USE_ASYNC_IO_WRITE_FOR_SAMTOOLS", USE_ASYNC_IO_WRITE_FOR_SAMTOOLS); result.put("USE_ASYNC_IO_WRITE_FOR_TRIBBLE", USE_ASYNC_IO_WRITE_FOR_TRIBBLE); result.put("COMPRESSION_LEVEL", COMPRESSION_LEVEL); result.put("BUFFER_SIZE", BUFFER_SIZE); result.put("NON_ZERO_BUFFER_SIZE", NON_ZERO_BUFFER_SIZE); result.put("REFERENCE_FASTA", REFERENCE_FASTA); result.put("USE_CRAM_REF_DOWNLOAD", USE_CRAM_REF_DOWNLOAD); result.put("EBI_REFERENCE_SERVICE_URL_MASK", EBI_REFERENCE_SERVICE_URL_MASK); result.put("CUSTOM_READER_FACTORY", CUSTOM_READER_FACTORY); result.put("SAM_FLAG_FIELD_FORMAT", SAM_FLAG_FIELD_FORMAT); return Collections.unmodifiableSortedMap(result); }
Source:
public int hashCode() { return Objects.hashCode(value); }

Target:
public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(value)); }
Source:
public String toString() { if(sb == null) sb = new StringBuilder(length()); else sb.delete(0, sb.length()); for (String cb : bufferList) { sb.append(cb); } return sb.toString(); }

Target:
public String toString() { if(sb == null) sb = new StringBuilder(length()); else sb.setLength(0); for (String cb : bufferList) { sb.append(cb); } return sb.toString(); }
Source:
public void shutdown() { log.info("Shutting down TableMonitorThread"); shutdownLatch.countDown(); }

Target:
public void shutdown() { log.info("Shutting down thread monitoring tables."); shutdownLatch.countDown(); }
Source:
static String getFieldWithPrimaryKeyAnnotation(Class<?> cls) { Field[] fs = cls.getDeclaredFields(); for (Field f : fs) { if (f.isAnnotationPresent(PrimaryKey.class)) { return f.getName(); } } return ""; }

Target:
protected static String getFieldWithPrimaryKeyAnnotation(Class<?> cls) { Field[] fs = cls.getDeclaredFields(); for (Field f : fs) { if (f.isAnnotationPresent(PrimaryKey.class)) { return f.getName(); } } Assumption.fail("There should be a field annotated with @PrimaryKey"); return null; }
Source:
protected List<NuxeoOAuth2Token> findTokens(QueryBuilder queryBuilder) { return Framework.doPrivileged(() -> { DirectoryService ds = Framework.getService(DirectoryService.class); try (Session session = ds.open(TOKEN_DIR)) { List<DocumentModel> documents = session.query(queryBuilder, false); return documents.stream().distinct().map(NuxeoOAuth2Token::new).collect(Collectors.toList()); } }); }

Target:
protected List<NuxeoOAuth2Token> findTokens(QueryBuilder queryBuilder) { return findTokens(queryBuilder, null); }
Source:
public int numberOfUsers() { try (Connection conn = getConnection(); PreparedStatement select = conn.prepareStatement(GET_ALL_QUOTAS)) { ResultSet rs = select.executeQuery(); int count = 0; while (rs.next()) { count++; } return count; } catch (SQLException sqe) { LOG.log(Level.WARNING, sqe.getMessage(), sqe); throw new IllegalStateException(sqe); } }

Target:
public int numberOfUsers() { try (Connection conn = getConnection(); PreparedStatement select = conn.prepareStatement(COUNT_USERS)) { ResultSet rs = select.executeQuery(); rs.next(); return rs.getInt(1); } catch (SQLException sqe) { LOG.log(Level.WARNING, sqe.getMessage(), sqe); throw new IllegalStateException(sqe); } }
Source:
private void fetchAndDisplayCaption(DisplayableContribution contribution) { if ((contribution.getState() != Contribution.STATE_COMPLETED)) { titleView.setText(contribution.getDisplayTitle()); } else { Timber.d("Fetching caption for %s", contribution.getFilename()); compositeDisposable.add(mediaClient.getCaptionByFilename(contribution.getFilename()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS) .subscribe(subscriber -> { if (!subscriber.trim().equals("No caption")) { titleView.setText(subscriber); } else titleView.setText(contribution.getDisplayTitle()); })); } }

Target:
private void fetchAndDisplayCaption(DisplayableContribution contribution) { if ((contribution.getState() != Contribution.STATE_COMPLETED)) { titleView.setText(contribution.getDisplayTitle()); } else { Timber.d("Fetching caption for %s", contribution.getFilename()); String wikibaseMediaId = "M"+contribution.getPageId(); compositeDisposable.add(mediaClient.getCaptionByWikibaseIdentifier(wikibaseMediaId) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS) .subscribe(subscriber -> { if (!subscriber.trim().equals(NO_CAPTION)) { titleView.setText(subscriber); } else titleView.setText(contribution.getDisplayTitle()); })); } }
Source:
public void serialize(SliceOutput out) { out.appendInt(bucketCount); out.appendDouble(min); out.appendDouble(max); out.appendInt(indices.length); int i = 0; for (i = 0; i < bucketCount; ++i) { out.appendDouble(indices[i]); } for (i = 0; i < bucketCount; ++i) { out.appendDouble(weights[i]); } for (i = 0; i < bucketCount; ++i) { out.appendDouble(counts[i]); } }

Target:
public void serialize(SliceOutput out) { out.appendInt(bucketCount); out.appendDouble(min); out.appendDouble(max); out.appendInt(indices.length); IntStream.range(0, indices.length).forEach(i -> out.appendInt(indices[i])); IntStream.range(0, indices.length).forEach(i -> out.appendDouble(weights[i])); IntStream.range(0, indices.length).forEach(i -> out.appendLong(counts[i])); }
Source:
public static CompositeType camelRoutePropertiesCompositeType() throws OpenDataException { return new CompositeType("routeProperties", "Route Properties", new String[]{"name", "value"}, new String[]{"Name", "Value"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING}); }

Target:
public static CompositeType camelRoutePropertiesCompositeType() throws OpenDataException { return new CompositeType("routeProperties", "Route Properties", new String[]{"key", "value"}, new String[]{"Key", "Value"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING}); }
Source:
protected EObject getTargetEObject() { View view = getTargetView(); return view.getElement(); }

Target:
protected Optional<EObject> getTargetEObject() { Optional<View> view = getTargetView(); if (view.isPresent()) { EObject element = view.get().getElement(); if (element != null) return Optional.of(element); } return Optional.empty(); }
Source:
public void testRegisterAction_IllegalArgument() { CompositeViewAction viewAction = new CompositeViewAction(1, TriggerType.CLICK); ViewAction action1 = mock(ViewAction.class); ViewAction action2 = mock(ViewAction.class); when(action1.getViewId()).thenReturn(2); when(action2.getViewId()).thenReturn(1); when(action1.getTriggerType()).thenReturn(TriggerType.CLICK); when(action2.getTriggerType()).thenReturn(TriggerType.TOUCH); try { viewAction.registerAction(action1); viewAction.registerAction(action2); } catch (IllegalArgumentException e) { Log.d(TAG,"Exception thrown..."); } when(action1.getViewId()).thenReturn(1); try { viewAction.registerAction(action1); viewAction.registerAction(action2); } catch (IllegalArgumentException e) { } Mockito.verify(action1, Mockito.times(3)).getViewId(); Mockito.verify(action2, Mockito.times(2)).getViewId(); }

Target:
public void testRegisterAction_IllegalArgument() { CompositeViewAction viewAction = new CompositeViewAction(1, TriggerType.CLICK); ViewAction clickActionView2 = createAction(2, TriggerType.CLICK); ViewAction touchActionView1 = createAction(1, TriggerType.TOUCH); try { viewAction.registerAction(clickActionView2); viewAction.registerAction(touchActionView1); } catch (IllegalArgumentException e) { } catch (Exception e) { fail("Exception other than expected IllegalArgumentException thrown"); e.printStackTrace(); } Mockito.verify(clickActionView2, Mockito.times(2)).getViewId(); Mockito.verifyZeroInteractions(touchActionView1); ViewAction clickActionView1 = createAction(1, TriggerType.CLICK); try { viewAction.registerAction(clickActionView1); viewAction.registerAction(touchActionView1); } catch (IllegalArgumentException e) { } catch (Exception e) { fail("Exception other than expected IllegalArgumentException thrown"); e.printStackTrace(); } Mockito.verify(clickActionView1, Mockito.times(1)).getViewId(); Mockito.verify(touchActionView1, Mockito.times(2)).getViewId(); }
Source:
public CatalogContext( long transactionId, long uniqueId, Catalog catalog, DbSettings settings, byte[] catalogBytes, byte[] catalogBytesHash, byte[] deploymentBytes, int version, HostMessenger messenger) { this(transactionId, uniqueId, catalog, settings, catalogBytes, catalogBytesHash, deploymentBytes, version, messenger, true, null, null, -1L); }

Target:
public CatalogContext( long transactionId, long uniqueId, Catalog catalog, DbSettings settings, byte[] catalogBytes, byte[] catalogBytesHash, byte[] deploymentBytes, int version, HostMessenger messenger) { this(transactionId, uniqueId, catalog, settings, catalogBytes, catalogBytesHash, deploymentBytes, version, messenger, true, null, null, uniqueId); }
Source:
private FileResource createResource(String filenamePrefix, String extension) { final File directory = _userPreferences.getSaveDatastoreDirectory(); int attempt = 0; while (true) { final String filename; if (attempt == 0) { filename = filenamePrefix + extension; } else { filename = filenamePrefix + "_" + attempt + extension; } final File file = new File(directory, filename); FileResource resourceCandidate = new FileResource(file); if (!resourceCandidate.isExists()) { return resourceCandidate; } attempt++; } }

Target:
private FileResource createResource(String filenamePrefix, String extension) { final File directory = _userPreferences.getSaveDatastoreDirectory(); int attempt = 0; while (true) { final String filename; if (attempt == 0) { filename = filenamePrefix + extension; } else { filename = filenamePrefix + "_" + attempt + extension; } final File file = new File(directory, filename); final FileResource resourceCandidate = new FileResource(file); if (!resourceCandidate.isExists()) { return resourceCandidate; } attempt++; } }
Source:
public UUID execute(BranchContext context) { try { File file = doExport(toExportModel(context)); UUID fileId = UUID.randomUUID(); context.service(FileRegistry.class).upload(fileId, new FileInputStream(file)); return fileId; } catch (Exception e) { throw new RuntimeException("Error occurred during DSV export.", e); } }

Target:
public UUID execute(BranchContext context) { File file = null; try { file = doExport(toExportModel(context)); UUID fileId = UUID.randomUUID(); context.service(FileRegistry.class).upload(fileId, new FileInputStream(file)); return fileId; } catch (Exception e) { throw new RuntimeException("Error occurred during DSV export.", e); } finally { if (file != null) { file.delete(); } } }
Source:
public void close() { final State state = this.state; if (State.CLOSED != state) { final AeronArchive.Context context = archive.context(); final Aeron aeron = context.aeron(); if (!aeron.isClosed()) { final ErrorHandler errorHandler = context.errorHandler(); if (State.MERGED != state && State.STOP_REPLAY != state) { AeronCloseHelper.close(errorHandler, () -> subscription.removeDestination(replayDestination)); } if (isReplayActive) { isReplayActive = false; final long correlationId = aeron.nextCorrelationId(); AeronCloseHelper.close(errorHandler, () -> archive.archiveProxy() .stopReplay(replaySessionId, correlationId, archive.controlSessionId())); } } state(State.CLOSED); } }

Target:
public void close() { final State state = this.state; if (State.CLOSED != state) { if (!archive.context().aeron().isClosed()) { if (State.MERGED != state) { subscription.asyncRemoveDestination(replayDestination); } if (isReplayActive && archive.archiveProxy().publication().isConnected()) { stopReplay(); } } state(State.CLOSED); } }
Source:
public XDOM getXDOM() { if (!this.stack.isEmpty()) { throw new IllegalStateException("Unbalanced begin/end Block events, missing " + this.stack.size() + " calls to endBlockList()."); } List<Block> blocks = endBlockList(); if (!blocks.isEmpty() && blocks.get(0) instanceof XDOM) { return (XDOM) blocks.get(0); } else { return new XDOM(blocks); } }

Target:
public XDOM getXDOM() { if (!this.stack.size()==1) { throw new IllegalStateException("Unbalanced begin/end Block events, missing " + this.stack.size() + " calls to endBlockList()."); } List<Block> blocks = endBlockList(); if (!blocks.isEmpty() && blocks.get(0) instanceof XDOM) { return (XDOM) blocks.get(0); } else { return new XDOM(blocks); } }
Source:
public void testRenameSymref() throws IOException { ObjectId id = db.resolve("HEAD"); RefRename r = db.renameRef("HEAD", "KOPF"); assertEquals(IO_FAILURE, r.rename()); }

Target:
public void testRenameSymref() throws IOException { db.resolve("HEAD"); RefRename r = db.renameRef("HEAD", "KOPF"); assertEquals(IO_FAILURE, r.rename()); }
Source:
public LibraryPropertiesDialogViewModel(BasePanel panel, DialogService dialogService, PreferencesService preferencesService) { this.dialogService = dialogService; MetaData metaData = panel.getBibDatabaseContext().getMetaData(); DatabaseLocation location = panel.getBibDatabaseContext().getLocation(); boolean isShared = (location == DatabaseLocation.SHARED); encodingDisableProperty.setValue(isShared); protectDisableProperty.setValue(isShared); directoryDialogConfiguration = new DirectoryDialogConfiguration.Builder() .withInitialDirectory(preferencesService.getWorkingDir()).build(); Optional<Charset> charset = metaData.getEncoding(); selectedEncodingPropety.setValue(charset.orElse(preferencesService.getDefaultEncoding())); Optional<String> fileD = metaData.getDefaultFileDirectory(); fileD.ifPresent(path -> generalFileDirectoryProperty.setValue(path.trim())); Optional<String> fileDI = metaData.getUserFileDirectory(preferencesService.getUser()); fileDI.ifPresent(userSpecificFileDirectoryProperty::setValue); Optional<Path> fileDL = metaData.getLaTexFileDirectory(preferencesService.getUser()); Optional<String> laTexFile = Optional.ofNullable(fileDL.toString()); laTexFile.ifPresent(laTexFileDirectoryProperty::setValue); oldUserSpecificFileDir = generalFileDirectoryProperty.getValue(); oldGeneralFileDir = userSpecificFileDirectoryProperty.getValue(); oldLaTexFileDir = laTexFileDirectoryProperty.getValue(); libraryProtectedProperty.setValue(metaData.isProtected()); oldLibraryProtected = libraryProtectedProperty.getValue(); }

Target:
public LibraryPropertiesDialogViewModel(BasePanel panel, DialogService dialogService, PreferencesService preferencesService) { this.dialogService = dialogService; MetaData metaData = panel.getBibDatabaseContext().getMetaData(); DatabaseLocation location = panel.getBibDatabaseContext().getLocation(); boolean isShared = (location == DatabaseLocation.SHARED); encodingDisableProperty.setValue(isShared); protectDisableProperty.setValue(isShared); directoryDialogConfiguration = new DirectoryDialogConfiguration.Builder() .withInitialDirectory(preferencesService.getWorkingDir()).build(); Optional<Charset> charset = metaData.getEncoding(); selectedEncodingPropety.setValue(charset.orElse(preferencesService.getDefaultEncoding())); Optional<String> fileD = metaData.getDefaultFileDirectory(); fileD.ifPresent(path -> generalFileDirectoryProperty.setValue(path.trim())); Optional<String> fileDI = metaData.getUserFileDirectory(preferencesService.getUser()); fileDI.ifPresent(userSpecificFileDirectoryProperty::setValue); metaData.getLaTexFileDirectory(preferencesService.getUser()).map(Path::toString).ifPresent(laTexFileDirectoryProperty::setValue); oldUserSpecificFileDir = generalFileDirectoryProperty.getValue(); oldGeneralFileDir = userSpecificFileDirectoryProperty.getValue(); oldLaTexFileDir = laTexFileDirectoryProperty.getValue(); libraryProtectedProperty.setValue(metaData.isProtected()); oldLibraryProtected = libraryProtectedProperty.getValue(); }
Source:
public static Object charValue(Object obj) { if (obj instanceof Character) { return obj; } if (obj instanceof Integer) { int value = (Integer) obj; return (char) value; } if (obj instanceof Long) { long value = (Long) obj; return (char) value; } if (obj instanceof Double) { double value = (Double) obj; return (char) value; } if (obj instanceof Float) { float value = (Float) obj; return (char) value; } if (obj instanceof String) { return ((String) obj).charAt(0); } throw new IllegalArgumentException("Expected a number or a string, but got: " + obj); }

Target:
public static Object charValue(Object obj) throws IllegalArgumentException { if (obj instanceof Character) { return obj; } if (obj instanceof Integer) { int value = (Integer) obj; return (char) value; } if (obj instanceof Long) { long value = (Long) obj; return (char) value; } if (obj instanceof Double) { double value = (Double) obj; return (char) value; } if (obj instanceof Float) { float value = (Float) obj; return (char) value; } if (obj instanceof String) { return ((String) obj).charAt(0); } throw new IllegalArgumentException("Expected a number or a string, but got: " + obj); }
Source:
private IStatus getStatus(IEvaluationResult evaluationResult) { Object result = evaluationResult.getValue(); String defaultMessage = this.getDefaultMessage(result); String message = defaultMessage; Diagnostic diagnostic = evaluationResult.getDiagnostic(); int statusCode = this.getStatusCodeFromDiagnostic(diagnostic); IStatus status = new Status(statusCode, Activator.PLUGIN_ID, message); if (Diagnostic.OK != diagnostic.getSeverity() && diagnostic.getChildren().size() > 0) { MultiStatus multiStatus = new MultiStatus(Activator.PLUGIN_ID, statusCode, message, null); List<Diagnostic> children = diagnostic.getChildren(); for (Diagnostic childDiagnostic : children) { int childStatusCode = this.getStatusCodeFromDiagnostic(childDiagnostic); String childMessage = childDiagnostic.getMessage(); IStatus childStatus = new Status(childStatusCode, Activator.PLUGIN_ID, childMessage); multiStatus.add(childStatus); } status = multiStatus; } return status; }

Target:
private IStatus getStatus(IEvaluationResult evaluationResult) { Object result = evaluationResult.getValue(); String message = this.getDefaultMessage(result); Diagnostic diagnostic = evaluationResult.getDiagnostic(); int statusCode = this.getStatusCodeFromDiagnostic(diagnostic); IStatus status = new Status(statusCode, InterpreterViewPlugin.PLUGIN_ID, message); if (Diagnostic.OK != diagnostic.getSeverity() && diagnostic.getChildren().size() > 0) { MultiStatus multiStatus = new MultiStatus(InterpreterViewPlugin.PLUGIN_ID, statusCode, message, null); List<Diagnostic> children = diagnostic.getChildren(); for (Diagnostic childDiagnostic : children) { int childStatusCode = this.getStatusCodeFromDiagnostic(childDiagnostic); String childMessage = childDiagnostic.getMessage(); IStatus childStatus = new Status(childStatusCode, InterpreterViewPlugin.PLUGIN_ID, childMessage); multiStatus.add(childStatus); } status = multiStatus; } return status; }
Source:
public void conceptListHelper_shouldReturnListOfConceptsWithGivenNameInDescriptor() { List<Concept> helperList = OpenmrsUtil.conceptListHelper("name:YES|name:NO|name:DIED|set:25|set:26"); List<Concept> serviceList = new ArrayList<>(); List<Concept> aux; Concept con; ConceptService cs = Context.getConceptService(); serviceList.add(cs.getConceptByName("YES")); serviceList.add(cs.getConceptByName("NO")); serviceList.add(cs.getConceptByName("DIED")); con = cs.getConcept(25); aux = cs.getConceptsByConceptSet(con); serviceList.addAll(aux); con = cs.getConcept(26); aux = cs.getConceptsByConceptSet(con); serviceList.addAll(aux); assertTrue("List should be same size to be equal",helperList.size() == serviceList.size()); Set<Concept> serviceSet = new HashSet<>(serviceList); helperList.stream() .forEach(concept -> { serviceSet.remove(concept); }); assertTrue("The set should be empty" ,serviceSet.size() == 0); }

Target:
public void conceptListHelper_shouldReturnListOfConceptsWithGivenNameInDescriptor() { List<Concept> helperList = OpenmrsUtil.conceptListHelper("name:YES|name:NO|name:DIED|set:25|set:26"); List<Concept> serviceList = new ArrayList<>(); Concept concept_auxiliar; serviceList.add(cs.getConceptByName("YES")); serviceList.add(cs.getConceptByName("NO")); serviceList.add(cs.getConceptByName("DIED")); concept_auxiliar = cs.getConcept(25); serviceList.addAll(cs.getConceptsByConceptSet(concept_auxiliar)); concept_auxiliar = cs.getConcept(26); serviceList.addAll(cs.getConceptsByConceptSet(concept_auxiliar)); assertTrue("List should be same size to be equal",helperList.size() == serviceList.size()); Set<Concept> serviceSet = new HashSet<>(serviceList); helperList.stream() .forEach(concept -> { serviceSet.remove(concept); }); assertTrue("The set should be empty" ,serviceSet.isEmpty()); }
Source:
public void calculatorReturnsNonMaximumForPriorityTable_thenProviderStillSelectsIt() { givenPriority(table("table1"), 1.0); givenPriority(table("table2"), 10_000.0); whenGettingNextTableToSweepWithOverrides(ImmutableSweepPriorityOverrideConfig.builder() .addPriorityTables(table("table1").getQualifiedName()) .build()); thenTableChosenIs(table("table1")); }

Target:
public void calculatorReturnsNonMaximumForPriorityTable_thenProviderStillSelectsIt() { givenPriority(table("table1"), 1.0); givenPriority(table("table2"), 10_000.0); givenPriorityOverride(table("table1")); whenGettingNextTableToSweep(); thenTableChosenIs(table("table1")); }
Source:
public void addTableColumnReferences(AccessControl accessControl, Identity identity, Multimap<QualifiedObjectName, String> tableColumnMap) { AccessControlInfo accessControlInfo = new AccessControlInfo(accessControl, identity); Map<QualifiedObjectName, Set<String>> references = tableColumnReferences.computeIfAbsent(accessControlInfo, (k) -> new LinkedHashMap<>()); tableColumnMap.asMap() .forEach((key, value) -> references.computeIfAbsent(key, k -> new HashSet<>()).addAll(value)); }

Target:
public void addTableColumnReferences(AccessControl accessControl, Identity identity, Multimap<QualifiedObjectName, String> tableColumnMap) { AccessControlInfo accessControlInfo = new AccessControlInfo(accessControl, identity); Map<QualifiedObjectName, Set<String>> references = tableColumnReferences.computeIfAbsent(accessControlInfo, k -> new LinkedHashMap<>()); tableColumnMap.asMap() .forEach((key, value) -> references.computeIfAbsent(key, k -> new HashSet<>()).addAll(value)); }
Source:
public Object evaluate(final Object knowledgeBase, Map<String, Object> requestData) { logger.trace("evaluate {}", knowledgeBase, requestData); if (!(knowledgeBase instanceof KieBase)) { throw new KiePMMLException(String.format("Expecting KieBase, received %s", knowledgeBase.getClass().getName())); } final PMML4Result toReturn = getPMML4Result(targetField); KiePMMLSessionUtils.Builder builder = KiePMMLSessionUtils.builder((InternalKnowledgeBase)knowledgeBase, name, toReturn) .withObjectsInSession(requestData, fieldTypeMap) .withOutputFieldsMap(outputFieldsMap); if (logger.isDebugEnabled()) { builder = builder.withAgendaEventListener(agendaEventListener); } final KiePMMLSessionUtils kiePMMLSessionUtils = builder.build(); kiePMMLSessionUtils.fireAllRules(); return toReturn; }

Target:
public Object evaluate(final Object knowledgeBase, Map<String, Object> requestData) { logger.trace("evaluate {}", knowledgeBase, requestData); if (!(knowledgeBase instanceof KieBase)) { throw new KiePMMLException(String.format("Expecting KieBase, received %s", knowledgeBase.getClass().getName())); } final PMML4Result toReturn = getPMML4Result(targetField); KiePMMLSessionUtils.Builder builder = KiePMMLSessionUtils.builder((KieBase)knowledgeBase, name, toReturn) .withObjectsInSession(requestData, fieldTypeMap) .withOutputFieldsMap(outputFieldsMap); if (logger.isDebugEnabled()) { builder = builder.withAgendaEventListener(agendaEventListener); } final KiePMMLSessionUtils kiePMMLSessionUtils = builder.build(); kiePMMLSessionUtils.fireAllRules(); return toReturn; }
Source:
public Variable(String name, VariableType variableType, int positionScore, char[] triggerChars, ImageDescriptor descriptor) { this.name = name; this.variableType = variableType; this.positionScore = positionScore; this.triggerChars = triggerChars; this.descriptor = descriptor; this.alreadyMatched = false; }

Target:
public Variable(String name, VariableType variableType, int positionScore, char[] triggerChars, ImageDescriptor descriptor) { this.name = name; this.variableType = variableType; this.positionScore = positionScore; this.triggerChars = triggerChars; this.descriptor = descriptor; }
Source:
public boolean loadUrl(final String url, final int timeout) { browser.getShell().open(); this.state = ReadyState.LOADING; browser.addProgressListener(readyStateListener); this.syncExec( () -> { browser.setUrl(url); }); boolean successful = waitForPageLoaded(timeout); browser.removeProgressListener(readyStateListener); return successful; }

Target:
public boolean loadUrl(final String url, final int timeout) { syncExec(() -> browser.getShell().open()); state = ReadyState.LOADING; syncExec( () -> { browser.addProgressListener(readyStateListener); browser.setUrl(url); }); boolean successful = waitForPageLoaded(timeout); syncExec(() -> browser.removeProgressListener(readyStateListener)); return successful; }
Source:
public void testJobsDontRunWhenSchedulerPaused() throws Throwable { int initialJobsNumber = refreshAndGetTotalJobCount(); Scheduler schedAdminInterface = schedulerHelper.getSchedulerInterface(); assertTrue(schedAdminInterface.pause()); JobId jobId1 = schedulerHelper.submitJob(new File(simpleJobUrl.toURI()).getAbsolutePath()); JobId jobId2 = schedulerHelper.submitJob(new File(simpleJobUrl.toURI()).getAbsolutePath()); schedulerHelper.waitForEventJobSubmitted(jobId1, EVENT_TIMEOUT); schedulerHelper.waitForEventJobSubmitted(jobId2, EVENT_TIMEOUT); Thread.sleep(5000); JobState js1 = schedulerHelper.getSchedulerInterface().getJobState(jobId1); assertEquals(JobStatus.PENDING, js1.getStatus()); JobState js2 = schedulerHelper.getSchedulerInterface().getJobState(jobId2); assertEquals(JobStatus.PENDING, js2.getStatus()); schedulerHelper.killJob(jobId1.toString()); schedulerHelper.killJob(jobId2.toString()); schedulerHelper.removeJob(jobId1); schedulerHelper.removeJob(jobId2); schedulerHelper.waitForEventJobRemoved(jobId1, EVENT_TIMEOUT); schedulerHelper.waitForEventJobRemoved(jobId2, EVENT_TIMEOUT); assertEquals(initialJobsNumber, refreshAndGetTotalJobCount()); schedulerHelper.checkNodesAreClean(); assertTrue(schedAdminInterface.resume()); }

Target:
public void testJobsDontRunWhenSchedulerPaused() throws Throwable { int initialJobsNumber = refreshAndGetTotalJobCount(); Scheduler schedAdminInterface = schedulerHelper.getSchedulerInterface(); assertTrue(schedAdminInterface.pause()); JobId jobId1 = schedulerHelper.submitJob(new File(simpleJobUrl.toURI()).getAbsolutePath()); JobId jobId2 = schedulerHelper.submitJob(new File(simpleJobUrl.toURI()).getAbsolutePath()); schedulerHelper.waitForEventJobSubmitted(jobId1, EVENT_TIMEOUT); schedulerHelper.waitForEventJobSubmitted(jobId2, EVENT_TIMEOUT); Thread.sleep(10000); JobState js1 = schedulerHelper.getSchedulerInterface().getJobState(jobId1); assertEquals(JobStatus.PENDING, js1.getStatus()); JobState js2 = schedulerHelper.getSchedulerInterface().getJobState(jobId2); assertEquals(JobStatus.PENDING, js2.getStatus()); schedulerHelper.killJob(jobId1.toString()); schedulerHelper.killJob(jobId2.toString()); schedulerHelper.removeJob(jobId1); schedulerHelper.removeJob(jobId2); schedulerHelper.waitForEventJobRemoved(jobId1, EVENT_TIMEOUT); schedulerHelper.waitForEventJobRemoved(jobId2, EVENT_TIMEOUT); assertEquals(initialJobsNumber, refreshAndGetTotalJobCount()); schedulerHelper.checkNodesAreClean(); assertTrue(schedAdminInterface.resume()); }
Source:
public QuorumServer(long id, InetSocketAddress addr) { this.id = id; this.addr = addr; this.electionAddr = null; String checkIPReachableValue = System.getProperty("zookeeper.checkIPTimeout"); if(checkIPReachableValue != null){ this.checkIPReachableTO = Integer.parseInt(checkIPReachableValue); } }

Target:
public QuorumServer(long id, InetSocketAddress addr) { this.id = id; this.addr = addr; this.electionAddr = null; }
Source:
private void initPreferenceDefaults() { getPreferenceStore().setDefault(CHANGE_SET_MANAGE, true); getPreferenceStore().setDefault(COMMIT_TEMPLATE, DEFAULT_COMMIT_TEMPLATE); if (getPreferenceStore().getString(COMMIT_TEMPLATE).equals(OLD_DEFAULT_COMMIT_TEMPLATE) || getPreferenceStore().getString(COMMIT_TEMPLATE).equals(OLD_DEFAULT_COMMIT_TEMPLATE2) || getPreferenceStore().getString(COMMIT_TEMPLATE).equals(OLD_DEFAULT_COMMIT_TEMPLATE3)) { getPreferenceStore().setValue(COMMIT_TEMPLATE, DEFAULT_COMMIT_TEMPLATE); } }

Target:
private void initPreferenceDefaults() { getPreferenceStore().setDefault(CHANGE_SET_MANAGE, true); getPreferenceStore().setDefault(COMMIT_TEMPLATE, DEFAULT_COMMIT_TEMPLATE); }
Source:
public ResponseEntity<List<Commit>> listCommits( @PathVariable("projectId") long projectId, @PathVariable("branchName") String branchName) { return new ResponseEntity<>( getCommitsInProjectUseCase.get(projectId, branchName), HttpStatus.OK); }

Target:
public ResponseEntity<List<GetCommitResponse>> listCommits( @PathVariable("projectId") long projectId, @PathVariable("branchName") String branchName) { List<Commit> commits = getCommitsInProjectUseCase.get(projectId, branchName); List<GetCommitResponse> result = new ArrayList<>(commits.size()); for (Commit commit : commits) { result.add( new GetCommitResponse() .setName(commit.getName()) .setAnalyzed(commit.isAnalyzed()) .setAuthor(commit.getAuthor()) .setComment(commit.getComment()) .setTimestamp(commit.getTimestamp())); } return new ResponseEntity<>(result, HttpStatus.OK); }
Source:
public void testBug548456_concurrentElementInfoAccess() throws Exception { int iterations = 20; int numberOfThreads = 2; for (int i = 0; i < iterations; ++i) { doTestBug548456_concurrentCallBinaryTypeExists(numberOfThreads); } }

Target:
public void testBug548456_concurrentElementInfoAccess() throws Exception { int iterations = 20; int numberOfThreads = 10; for (int i = 0; i < iterations; ++i) { doTestBug548456_concurrentCallBinaryTypeExists(numberOfThreads); } }
Source:
public InternalIndexState getInitialState( long indexId, IndexDescriptor descriptor ) { try { NativeSchemaIndexHeaderReader headerReader = new NativeSchemaIndexHeaderReader(); GBPTree.readHeader( pageCache, nativeIndexFileFromIndexId( indexId ), new ReadOnlyMetaNumberLayout(), headerReader ); switch ( headerReader.state ) { case BYTE_FAILED: return InternalIndexState.FAILED; case BYTE_ONLINE: return InternalIndexState.ONLINE; case BYTE_POPULATING: return InternalIndexState.POPULATING; default: throw new IllegalStateException( "Unexpected initial state byte value " + headerReader.state ); } } catch ( IOException e ) { return InternalIndexState.POPULATING; } }

Target:
public InternalIndexState getInitialState( long indexId, IndexDescriptor descriptor ) { try { NativeSchemaIndexHeaderReader headerReader = new NativeSchemaIndexHeaderReader(); GBPTree.readHeader( pageCache, nativeIndexFileFromIndexId( indexId ), new ReadOnlyMetaNumberLayout(), headerReader ); switch ( headerReader.state ) { case BYTE_FAILED: return InternalIndexState.FAILED; case BYTE_ONLINE: return InternalIndexState.ONLINE; case BYTE_POPULATING: return InternalIndexState.POPULATING; default: throw new IllegalStateException( "Unexpected initial state byte value " + headerReader.state ); } } catch ( IOException e ) { log.error( "Failed to open index:" + indexId + ", requesting re-population.", e ); return InternalIndexState.POPULATING; } }
Source:
public BibRecord parseRecord(String line) { String regEx = "\\[([0-9]+)\\] (" + authInitialsLastList + ")\\. ([^\\.]+)\\. (?:(?:I|i)n )?(.*) ([1-2][0-9]{3})\\.( .*)?"; Matcher m = Pattern.compile(regEx).matcher(line.trim()); if(m.matches()) { BibRecord out = new BibRecord(m.group(3), authorStringToList(m.group(2)), m.group(4), Pattern.compile(m.group(1)), extractRefYear(m.group(5))); return out; } else return null; }

Target:
public BibRecord parseRecord(String line) { Matcher m = pattern.matcher(line.trim()); if(m.matches()) { return new BibRecord( m.group(3), authorStringToList(m.group(2)), m.group(4), Pattern.compile(m.group(1)), extractRefYear(m.group(5))); } else { return null; } }
Source:
public PlainIntegerDictionary(DictionaryPage dictionaryPage) throws IOException { super(dictionaryPage); final ByteBuffer dictionaryByteBuf = dictionaryPage.getBytes().toByteBuffer(); intDictionaryContent = new int[dictionaryPage.getDictionarySize()]; IntegerPlainValuesReader intReader = new IntegerPlainValuesReader(); intReader.initFromPage(dictionaryPage.getDictionarySize(), dictionaryByteBuf, dictionaryByteBuf.position()); for (int i = 0; i < intDictionaryContent.length; i++) { intDictionaryContent[i] = intReader.readInteger(); } }

Target:
public PlainIntegerDictionary(DictionaryPage dictionaryPage) throws IOException { super(dictionaryPage); final ByteBuffer dictionaryByteBuf = dictionaryPage.getBytes().toByteBuffer(); intDictionaryContent = new int[dictionaryPage.getDictionarySize()]; IntegerPlainValuesReader intReader = new IntegerPlainValuesReader(); intReader.initFromPage(dictionaryPage.getDictionarySize(), dictionaryByteBuf, 0); for (int i = 0; i < intDictionaryContent.length; i++) { intDictionaryContent[i] = intReader.readInteger(); } }
Source:
public Response start(Action action) { if (isStartRunOnce(action)) { RunVmOnceParams params = map(map(getEntity(entityType, VdcQueryType.GetVmByVmId, new IdQueryParameters(guid), id, true), new VM()), new RunVmOnceParams(guid)); if (action.isSetVm()) { validateEnums(VM.class, action.getVm()); VM vm = action.getVm(); params = map(vm, params); if (vm.isSetPlacementPolicy() && vm.getPlacementPolicy().isSetHost()) { validateParameters(vm.getPlacementPolicy(), "host.id|name"); params.setDestinationVdsId(getHostId(vm.getPlacementPolicy().getHost())); } } if (action.isSetPause() && action.isPause()) { params.setRunAndPause(true); } return doAction(VdcActionType.RunVmOnce, params, action); } else { RunVmParams params = new RunVmParams(guid); if (action.isSetPause() && action.isPause()) { params.setRunAndPause(true); } return doAction(VdcActionType.RunVm, params, action); } }

Target:
public Response start(Action action) { if (action.isSetVm()) { validateEnums(VM.class, action.getVm()); RunVmOnceParams params = map(map(getEntity(entityType, VdcQueryType.GetVmByVmId, new IdQueryParameters(guid), id, true), new VM()), new RunVmOnceParams(guid)); VM vm = action.getVm(); params = map(vm, params); if (vm.isSetPlacementPolicy() && vm.getPlacementPolicy().isSetHost()) { validateParameters(vm.getPlacementPolicy(), "host.id|name"); params.setDestinationVdsId(getHostId(vm.getPlacementPolicy().getHost())); } if (action.isSetPause() && action.isPause()) { params.setRunAndPause(true); } return doAction(VdcActionType.RunVmOnce, params, action); } else { RunVmParams params = new RunVmParams(guid); if (action.isSetPause() && action.isPause()) { params.setRunAndPause(true); } return doAction(VdcActionType.RunVm, params, action); } }
Source:
protected boolean validate() { if (!super.validate()) { return false; } StorageDomain dom = getStorageDomain(); if (dom == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } boolean localFs = isLocalFs(dom); VDS vds = getVds(); StorageDomainToPoolRelationValidator domainPoolValidator = createDomainToPoolValidator(dom); if (!checkStorageDomain()) { return false; } if (!localFs && !validate(domainPoolValidator.isStorageDomainNotInAnyPool())) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false)) { return false; } if (getParameters().getDoFormat() && !localFs && isStorageDomainAttached(dom)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_FORMAT_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN); } if (vds == null) { if (localFs) { if (!initializeVds()) { return false; } } else { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); } } if (dom.getStorageType().isOpenStackDomain()) { return failValidation(EngineMessage.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN); } return true; }

Target:
protected boolean validate() { if (!super.validate()) { return false; } StorageDomain dom = getStorageDomain(); if (dom == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } VDS vds = getVds(); StorageDomainToPoolRelationValidator domainPoolValidator = createDomainToPoolValidator(dom); if (!checkStorageDomain()) { return false; } boolean localFs = isLocalFs(dom); if (!localFs && !validate(domainPoolValidator.isStorageDomainNotInAnyPool())) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false)) { return false; } if (getParameters().getDoFormat() && !localFs && isStorageDomainAttached(dom)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_FORMAT_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN); } if (vds == null) { if (localFs) { if (!initializeVds()) { return false; } } else { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); } } if (dom.getStorageType().isOpenStackDomain()) { return failValidation(EngineMessage.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN); } return true; }
Source:
public static StatsWidgetPromoDialogFragment newInstance() { StatsWidgetPromoDialogFragment frag = new StatsWidgetPromoDialogFragment(); return frag; }

Target:
public static StatsWidgetPromoDialogFragment newInstance() { return new StatsWidgetPromoDialogFragment(); }
Source:
private void setExtendedData(Placemark placemark, Metacard metacard) { final ExtendedData extendedData = new ExtendedData(); final Set<AttributeDescriptor> attributeDescriptors = metacard.getMetacardType().getAttributeDescriptors(); for (AttributeDescriptor attributeDescriptor : attributeDescriptors) { final String attributeName = attributeDescriptor.getName(); final Attribute attribute = metacard.getAttribute(attributeName); if (attribute != null) { String attributeValue = convertAttribute(attribute, attributeDescriptor) .toString() .replace("[", "") .replace("]", ""); final Data data = getData(attributeName, attributeValue); extendedData.addToData(data); } } placemark.setExtendedData(extendedData); }

Target:
private void setExtendedData(Placemark placemark, Metacard metacard) { final ExtendedData extendedData = new ExtendedData(); final Set<AttributeDescriptor> attributeDescriptors = metacard.getMetacardType().getAttributeDescriptors(); for (AttributeDescriptor attributeDescriptor : attributeDescriptors) { final String attributeName = attributeDescriptor.getName(); final Attribute attribute = metacard.getAttribute(attributeName); if (attribute != null) { Serializable attributeValue = convertAttribute(attribute, attributeDescriptor); if (attributeValue == null) { LOGGER.debug("Attribute converted to null value.", attributeName); } else { final Data data = getData(attributeName, attributeValue.toString()); extendedData.addToData(data); } } } placemark.setExtendedData(extendedData); }
Source:
public synchronized RealmFunctions getFunctions() { checkLoggedIn(); if (functions == null) { functions = new RealmFunctions(); } return functions; }

Target:
public synchronized Functions getFunctions() { checkLoggedIn(); if (functions == null) { functions = new FunctionsImpl(this); } return functions; }
Source:
public static void main(String[] args) { new Super(); new Constructor().new Inner(); new InnerStatic(); new PublicDefault(); new PackageLocalDefault(); new PrivateDefault(); new PrivateEmptyNoArg(); }

Target:
public static void main(String[] args) { new Super(); new Constructor().new Inner(); new InnerStatic(); new PublicDefault(); new PackageLocalDefault(); new PrivateDefault(); new PrivateNonEmptyNoArg(); new PrivateEmptyNoArg(); }
Source:
public CompletableFuture<JobDetails> requestJobDetails(Time timeout) { synchronized (lock) { if (isRunning()) { return getJobMasterGateway().thenCompose(jobMasterGateway -> jobMasterGateway.requestJobDetails( timeout)); } else { int[] tasksPerState = new int[ExecutionState.values().length]; return CompletableFuture.completedFuture(new JobDetails( jobId, jobName, initializationTimestamp, 0, 0, jobStatus, 0, tasksPerState, 0)); } } }

Target:
public CompletableFuture<JobDetails> requestJobDetails(Time timeout) { return requestJobStatus(timeout).thenApply(status -> { int[] tasksPerState = new int[ExecutionState.values().length]; synchronized (lock) { return new JobDetails( jobId, jobName, initializationTimestamp, 0, 0, status, 0, tasksPerState, 0); } }); }
Source:
public static String getImplementationDataStringForSpec(RegisteredType item) { if (item==null || item.getPlan()==null) return null; Object data = item.getPlan().getPlanData(); if (!(data instanceof String)) return null; return (String)data; }

Target:
public static String getImplementationDataStringForSpec(RegisteredType item) { if (item==null || item.getPlan()==null) return null; Object data = item.getPlan().getPlanData(); if (!(data instanceof String)) throw new IllegalStateException("Expected plan data for "+item+" to be a string"); return (String)data; }