auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected URL retrieve(Channel channel, long sum1, long sum2) throws IOException, InterruptedException { File target = map(sum1, sum2); File parent = target.getParentFile(); if (target.exists()) { LOGGER.fine(String.format("Jar file already exists: %16X%16X", sum1, sum2)); return target.toURI().toURL(); } parent.mkdirs(); try { File tmp = File.createTempFile(target.getName(), "tmp", parent); try { RemoteOutputStream o = new RemoteOutputStream(new FileOutputStream(tmp)); try { LOGGER.log(Level.FINE, String.format("Retrieving jar file %16X%16X",sum1,sum2)); getJarLoader(channel).writeJarTo(sum1, sum2, o); } finally { o.close(); } Checksum expected = new Checksum(sum1, sum2); Checksum actual = Checksum.forFile(tmp); if (!expected.equals(actual)) { throw new IOException(String.format( "Incorrect checksum of retrieved jar: %s%nExpected: %s\nActual: %s", tmp.getAbsolutePath(), expected, actual)); } if (!tmp.renameTo(target)) { if (!target.exists()) { throw new IOException("Unable to create " + target + " from " + tmp); } actual = Checksum.forFile(target); if (!expected.equals(actual)) { throw new IOException(String.format( "Incorrect checksum of previous jar: %s%nExpected: %s\nActual: %s", target.getAbsolutePath(), expected, actual)); } } return target.toURI().toURL(); } finally { tmp.delete(); } } catch (IOException e) { throw (IOException)new IOException("Failed to write to "+target).initCause(e); } }

Target:
protected URL retrieve(Channel channel, long sum1, long sum2) throws IOException, InterruptedException { File target = map(sum1, sum2); File parent = target.getParentFile(); if (target.exists()) { LOGGER.fine(String.format("Jar file already exists: %16X%16X", sum1, sum2)); return target.toURI().toURL(); } parent.mkdirs(); try { File tmp = File.createTempFile(target.getName(), "tmp", parent); try { RemoteOutputStream o = new RemoteOutputStream(new FileOutputStream(tmp)); try { LOGGER.log(Level.FINE, String.format("Retrieving jar file %16X%16X",sum1,sum2)); getJarLoader(channel).writeJarTo(sum1, sum2, o); } finally { o.close(); } Checksum expected = new Checksum(sum1, sum2); Checksum actual = Checksum.forFile(tmp); if (!expected.equals(actual)) { throw new IOException(String.format( "Incorrect checksum of retrieved jar: %s%nExpected: %s%nActual: %s", tmp.getAbsolutePath(), expected, actual)); } if (!tmp.renameTo(target)) { if (!target.exists()) { throw new IOException("Unable to create " + target + " from " + tmp); } actual = Checksum.forFile(target); if (!expected.equals(actual)) { throw new IOException(String.format( "Incorrect checksum of previous jar: %s%nExpected: %s%nActual: %s", target.getAbsolutePath(), expected, actual)); } } return target.toURI().toURL(); } finally { tmp.delete(); } } catch (IOException e) { throw (IOException)new IOException("Failed to write to "+target).initCause(e); } }
Source:
public void onSendToConsole(final SendToConsoleEvent event) { server_.adaptToLanguage( event.getLanguage(), new ServerRequestCallback<Void>() { @Override public void onResponseReceived(Void response) { sendToConsoleImpl(event); } @Override public void onError(ServerError error) { Debug.logError(error); } }); }

Target:
public void onSendToConsole(final SendToConsoleEvent event) { if (!StringUtil.equals(event.getLanguage(), language_)) { server_.adaptToLanguage( event.getLanguage(), new ServerRequestCallback<Void>() { @Override public void onResponseReceived(Void response) { language_ = event.getLanguage(); sendToConsoleImpl(event); } @Override public void onError(ServerError error) { Debug.logError(error); sendToConsoleImpl(event); } }); } else { sendToConsoleImpl(event); } }
Source:
public void actionPerformed(final ActionEvent e) { final Controller controller = Controller.getCurrentController(); final MapStyle mapStyle = controller.getModeController().getExtension(MapStyle.class); final MapModel model = controller.getMap(); mapStyle.setProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE, MapStyle.CLEAR_BACKGROUND_IMAGE); }

Target:
public void actionPerformed(final ActionEvent e) { final Controller controller = Controller.getCurrentController(); final MapStyle mapStyle = controller.getModeController().getExtension(MapStyle.class); final MapModel model = controller.getMap(); mapStyle.setProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE, null); }
Source:
public static Tuple testTuple(List<Object> values, MkTupleParam param) { String stream = param.getStream(); if (stream == null) { stream = Utils.DEFAULT_STREAM_ID; } String component = param.getComponent(); if (component == null) { component = "component"; } int task = 1; List<String> fields = param.getFields(); if (fields == null) { fields = new ArrayList<>(values.size()); for (int i = 1; i <= values.size(); i++) { fields.add("field" + i); } } CustomIndexArray<String> taskToComp = new CustomIndexArray<>(task,task+1); taskToComp.set(task, component); Map<String, Map<String, Fields>> compToStreamToFields = new HashMap<>(); Map<String, Fields> streamToFields = new HashMap<>(); streamToFields.put(stream, new Fields(fields)); compToStreamToFields.put(component, streamToFields); TopologyContext context = new TopologyContext(null, ConfigUtils.readStormConfig(), taskToComp, null, compToStreamToFields, null, "test-storm-id", null, null, 1, null, null, new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>(), new AtomicBoolean(false)); return new TupleImpl(context, values, component, 1, stream); }

Target:
public static Tuple testTuple(List<Object> values, MkTupleParam param) { String stream = param.getStream(); if (stream == null) { stream = Utils.DEFAULT_STREAM_ID; } String component = param.getComponent(); if (component == null) { component = "component"; } int task = 1; List<String> fields = param.getFields(); if (fields == null) { fields = new ArrayList<>(values.size()); for (int i = 1; i <= values.size(); i++) { fields.add("field" + i); } } CustomIndexArray<String> taskToComp = new CustomIndexArray<>(task,task); taskToComp.set(task, component); Map<String, Map<String, Fields>> compToStreamToFields = new HashMap<>(); Map<String, Fields> streamToFields = new HashMap<>(); streamToFields.put(stream, new Fields(fields)); compToStreamToFields.put(component, streamToFields); TopologyContext context = new TopologyContext(null, ConfigUtils.readStormConfig(), taskToComp, null, compToStreamToFields, null, "test-storm-id", null, null, 1, null, null, new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>(), new AtomicBoolean(false)); return new TupleImpl(context, values, component, 1, stream); }
Source:
private void refreshView() { Spinner spinner = (Spinner) findViewById(R.id.app_selection_spinner); TextView message = (TextView) findViewById(R.id.welcome_msg); ArrayList<ApplicationRecord> readyApps = CommCareApplication._().getReadyAppRecords(); if (readyApps.size() <= 1) { spinner.setVisibility(View.GONE); message.setText(R.string.login_welcome_single); return; } message.setText(R.string.login_welcome_multiple); ArrayList<String> appNames = new ArrayList<>(); ArrayList<String> appIds = new ArrayList<>(); for (ApplicationRecord r : readyApps) { String name = r.getDisplayName(); appNames.add(name); appIds.add(r.getUniqueId()); namesToRecords.put(name, r); } ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.spinner_text_view, appNames); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); spinner.setOnItemSelectedListener(this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); String lastApp = prefs.getString(KEY_LAST_APP,""); int position = 0; if (!"".equals(lastApp)) { position = appIds.indexOf(lastApp); if (position == -1) { position = 0; } } spinner.setSelection(position); spinner.setVisibility(View.VISIBLE); }

Target:
private void refreshView() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { refreshActionBar(); } ArrayList<ApplicationRecord> readyApps = CommCareApplication._().getUsableAppRecords(); if (readyApps.size() == 1) { spinner.setVisibility(View.GONE); welcomeMessage.setText(Localization.get("login.welcome.single")); ApplicationRecord r = readyApps.get(0); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); prefs.edit().putString(KEY_LAST_APP, r.getUniqueId()).commit(); } else { welcomeMessage.setText(Localization.get("login.welcome.multiple")); ArrayList<String> appNames = new ArrayList<>(); ArrayList<String> appIds = new ArrayList<>(); for (ApplicationRecord r : readyApps) { appNames.add(r.getDisplayName()); appIds.add(r.getUniqueId()); appRecordDropdownList.add(r); } ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.spinner_text_view, appNames); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); spinner.setOnItemSelectedListener(this); String currAppId = CommCareApplication._().getCurrentApp().getUniqueId(); int position = appIds.indexOf(currAppId); spinner.setSelection(position); spinner.setVisibility(View.VISIBLE); } }
Source:
public ICompletableFuture<ReadResultSet<E>> readManyAsync(long startSequence, int minCount, int maxCount, IFunction<E, Boolean> filter) { checkSequence(startSequence); checkNotNegative(minCount, "minCount can't be smaller than 0"); checkTrue(maxCount >= minCount, "maxCount should be equal or larger than minCount"); try { checkTrue(minCount <= capacity(), "the minCount should be smaller than or equal to the capacity"); } catch (Throwable e) { e = new ExecutionException(e); ExecutorService userExecutor = getContext().getExecutionService().getUserExecutor(); return new CompletedFuture<ReadResultSet<E>>(getSerializationService(), e, userExecutor); } checkTrue(maxCount <= MAX_BATCH_SIZE, "maxCount can't be larger than " + MAX_BATCH_SIZE); ClientMessage request = RingbufferReadManyCodec.encodeRequest( name, startSequence, minCount, maxCount, toData(filter)); try { ClientInvocationFuture invocationFuture = new ClientInvocation(getClient(), request, getName(), partitionId).invoke(); return new ClientDelegatingFuture<ReadResultSet<E>>(invocationFuture, getSerializationService(), readManyAsyncResponseDecoder); } catch (Exception e) { throw rethrow(e); } }

Target:
public ICompletableFuture<ReadResultSet<E>> readManyAsync(long startSequence, int minCount, int maxCount, IFunction<E, Boolean> filter) { checkSequence(startSequence); checkNotNegative(minCount, "minCount can't be smaller than 0"); checkTrue(maxCount >= minCount, "maxCount should be equal or larger than minCount"); try { capacity(); } catch (Throwable e) { e = new ExecutionException(e); ExecutorService userExecutor = getContext().getExecutionService().getUserExecutor(); return new CompletedFuture<ReadResultSet<E>>(getSerializationService(), e, userExecutor); } checkTrue(minCount <= capacity, "the minCount should be smaller than or equal to the capacity"); checkTrue(maxCount <= MAX_BATCH_SIZE, "maxCount can't be larger than " + MAX_BATCH_SIZE); ClientMessage request = RingbufferReadManyCodec.encodeRequest( name, startSequence, minCount, maxCount, toData(filter)); try { ClientInvocationFuture invocationFuture = new ClientInvocation(getClient(), request, getName(), partitionId).invoke(); return new ClientDelegatingFuture<ReadResultSet<E>>(invocationFuture, getSerializationService(), readManyAsyncResponseDecoder); } catch (Exception e) { throw rethrow(e); } }
Source:
protected boolean canDoAction() { storage_pool dc = DbFacade.getInstance().getStoragePoolDAO().get(getParameters().getStoragePoolId()); if (dc == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST); return false; } if (!StorageHelperDirector.getInstance() .getItem(getParameters().getStorageServerConnection().getstorage_type()) .ValidateStoragePoolConnectionsInHost(getVds(), Arrays.asList(getConnection()), getParameters().getStoragePoolId())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION); return false; } return true; }

Target:
protected boolean canDoAction() { storage_pool dc = getStoragePoolDAO().get(getParameters().getStoragePoolId()); if (dc == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST); return false; } if (!StorageHelperDirector.getInstance() .getItem(getParameters().getStorageServerConnection().getstorage_type()) .ValidateStoragePoolConnectionsInHost(getVds(), Arrays.asList(getConnection()), getParameters().getStoragePoolId())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION); return false; } return true; }
Source:
void generateCode() throws IOException { ClassName hashMap = ClassName.get( "java.util", "HashMap"); ClassName str = ClassName.get( String.class ); ParameterizedTypeName mainType = ParameterizedTypeName.get( hashMap, str, str ); Set<CodeBlock> contents = new HashSet<>( ); varResults.forEach( ( key, value ) -> contents.add( CodeBlock.builder().addStatement( "allConfigValues.put($S, $S);", key, value ).build() ) ); TypeSpec ConfigList = TypeSpec.classBuilder( "ConfigList" ) .addModifiers( Modifier.PUBLIC, Modifier.FINAL ) .addField( FieldSpec.builder ( mainType, "allConfigValues", Modifier.STATIC, Modifier.FINAL, Modifier.PUBLIC ) .initializer( "new HashMap<>()" ) .build() ) .addStaticBlock( CodeBlock.join( contents, " " ) ) .build(); JavaFile javaFile = JavaFile.builder( processingEnv.getOptions().get( PACKAGE_NAME ), ConfigList ).build(); javaFile.writeTo( new File( processingEnv.getOptions().get( GENERATION_DIR ) ) ); StringBuilder propertyIndex = new StringBuilder(); indexResults.forEach( (key, value) -> propertyIndex.append( " * [" ). append( key ).append( "](" ).append( value ).append( ")" ).append( System.lineSeparator() ) ); FileUtils.writeStringToFile( new File(processingEnv.getOptions().get( ROOT_DIR ) + File.separator + "target" + File.separator + "property-index-subset.md"), propertyIndex.toString(), Charset.defaultCharset()); }

Target:
void generateCode() throws IOException { ClassName hashMap = ClassName.get( "java.util", "HashMap"); ClassName str = ClassName.get( String.class ); ParameterizedTypeName mainType = ParameterizedTypeName.get( hashMap, str, str ); Set<CodeBlock> contents = new HashSet<>( ); varResults.forEach( ( key, value ) -> contents.add( CodeBlock.builder().addStatement( "allConfigValues.put($S, $S)", key, value ).build() ) ); TypeSpec ConfigList = TypeSpec.classBuilder( "ConfigList" ) .addModifiers( Modifier.PUBLIC, Modifier.FINAL ) .addField( FieldSpec.builder ( mainType, "allConfigValues", Modifier.STATIC, Modifier.FINAL, Modifier.PUBLIC ) .initializer( "new HashMap<>(" + indexResults.size() + ')') .build() ) .addStaticBlock( CodeBlock.join( contents, " " ) ) .build(); JavaFile javaFile = JavaFile.builder( processingEnv.getOptions().get( PACKAGE_NAME ), ConfigList ).build(); javaFile.writeTo( new File( processingEnv.getOptions().get( GENERATION_DIR ) ) ); StringBuilder propertyIndex = new StringBuilder(); indexResults.forEach( (key, value) -> propertyIndex.append( " * [" ). append( key ).append( "](" ).append( value ).append( ")" ).append( System.lineSeparator() ) ); FileUtils.writeStringToFile( new File(processingEnv.getOptions().get( ROOT_DIR ) + File.separator + "target" + File.separator + "property-index-subset.md"), propertyIndex.toString(), Charset.defaultCharset()); }
Source:
public static void notNaN(final double value, final String message, final Object... values) { if (value != value) { throw new IllegalArgumentException(String.format(message, values)); } }

Target:
public static void notNaN(final double value, final String message, final Object... values) { if (Double.isNaN(value)) { throw new IllegalArgumentException(String.format(message, values)); } }
Source:
public static void getVideoDownloadFolder(Context context) { getFolder(context, R.string.download_path_key, Environment.DIRECTORY_MOVIES); }

Target:
public static File getVideoDownloadFolder(Context context) { return getFolder(context, R.string.download_path_key, Environment.DIRECTORY_MOVIES); }
Source:
public void fetchMetadataOfPreciousResults() { if (metadataRequest != null) { metadataRequest.cancel(); metadataRequest = null; } Integer jobId = model.getSelectedJob().getId(); SchedulerServiceAsync scheduler = Scheduler.getSchedulerService(); metadataRequest = scheduler.getPreciousTaskName(LoginModel.getInstance().getSessionId(), jobId.toString(), new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { String msg = JSONUtils.getJsonErrorMessage(caught); if (msg.equals("HTTP 403 Forbidden")) { getModel().preciousTaskNamesNotAuthorized(); LogModel.getInstance() .logImportantMessage(JobResultView.NOT_AUTHORIZED); } else { LogModel.getInstance() .logImportantMessage("Error while fetching metadata of precious results:\n" + JSONUtils.getJsonErrorMessage(caught)); } } @Override public void onSuccess(String jsonString) { try { JSONArray array = parseJSON(jsonString).isArray(); List<String> preciousTaskNames = new ArrayList<>(array.size()); for (int i = 0; i < array.size(); ++i) { String taskName = array.get(i) .isString() .stringValue(); preciousTaskNames.add(taskName); } getModel().setPreciousTaskNamesLoaded(preciousTaskNames); } catch (JSONException e) { LogModel.getInstance() .logCriticalMessage(e.getMessage()); } } }); }

Target:
public void fetchMetadataOfPreciousResults() { if (metadataRequest != null) { metadataRequest.cancel(); metadataRequest = null; } Integer jobId = model.getSelectedJob().getId(); SchedulerServiceAsync scheduler = Scheduler.getSchedulerService(); metadataRequest = scheduler.getPreciousTaskName(LoginModel.getInstance().getSessionId(), jobId.toString(), new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { String msg = JSONUtils.getJsonErrorMessage(caught); if (msg.contains("HTTP 403 Forbidden")) { getModel().preciousTaskNamesNotAuthorized(); LogModel.getInstance() .logImportantMessage(JobResultView.NOT_AUTHORIZED); } else { LogModel.getInstance() .logImportantMessage("Error while fetching metadata of precious results:\n" + JSONUtils.getJsonErrorMessage(caught)); } } @Override public void onSuccess(String jsonString) { try { JSONArray array = parseJSON(jsonString).isArray(); List<String> preciousTaskNames = new ArrayList<>(array.size()); for (int i = 0; i < array.size(); ++i) { String taskName = array.get(i) .isString() .stringValue(); preciousTaskNames.add(taskName); } getModel().setPreciousTaskNamesLoaded(preciousTaskNames); } catch (JSONException e) { LogModel.getInstance() .logCriticalMessage(e.getMessage()); } } }); }
Source:
public int hashCode(){ int hash = 1; hash = hash * 31 + type.hashCode(); hash = hash * 31 + result.hashCode(); return hash; }

Target:
public int hashCode(){ int hash = 1; hash *= 31 + type.hashCode(); hash *= 31 + result.hashCode(); return hash; }
Source:
public Collection<String> getDataKeys() { if (data != null) { return data.keySet(); } return Collections.EMPTY_SET; }

Target:
public Collection<String> getDataKeys() { if (data != null) { return data.keySet(); } return Collections.emptySet(); }
Source:
public String getCommaSeparatedPatientIds() { StringBuilder sb = new StringBuilder(); for (CohortMember member : getMembers()) { sb.append(member.getPatientId().getPatientId().toString()); sb.append(","); } return sb.length() > 0 ? sb.substring(0, sb.length() - 1) : ""; }

Target:
public String getCommaSeparatedPatientIds() { StringBuilder sb = new StringBuilder(); for (CohortMembership member : getMembers()) { sb.append(member.getPatient().getPatientId()); sb.append(","); } return sb.toString(); }
Source:
public ValidationResult validate(Object fileObject) { if ( (fileObject == null && isRequired()) || (fileObject instanceof Collection && isRequired() && ((Collection) fileObject).isEmpty()) ) { return new ValidationResult(ValidationResult.Level.ERROR, getLabel() + " must be specified."); } else if (fileObject == null) { return ValidationResult.SUCCESS; } if (fileObject instanceof Iterable && !(fileObject instanceof Path)) { for (Object listItem : (Iterable) fileObject) { ValidationResult result = validatePath(castToPath(listItem)); if (result.getLevel() != ValidationResult.Level.SUCCESS) return result; } return ValidationResult.SUCCESS; } return validatePath(castToPath(fileObject)); }

Target:
public ValidationResult validate(Object fileObject) { if ( (fileObject == null && isRequired()) || (fileObject instanceof Collection && isRequired() && ((Collection) fileObject).isEmpty()) ) { return new ValidationResult(ValidationResult.Level.ERROR, getName() + " must be specified."); } else if (fileObject == null) { return ValidationResult.SUCCESS; } if (fileObject instanceof Iterable && !(fileObject instanceof Path)) { for (Object listItem : (Iterable) fileObject) { ValidationResult result = validatePath(castToPath(listItem)); if (result.getLevel() != ValidationResult.Level.SUCCESS) return result; } return ValidationResult.SUCCESS; } return validatePath(castToPath(fileObject)); }
Source:
private Serializable computeCacheKey( final MasterReport report ) throws BeanException { final ResourceKey definitionSource = report.getDefinitionSource(); final ResourceKey parent = definitionSource.getParent(); final List<String> sourceKey; if ( parent != null ) { sourceKey = computeDefSourceKey( report, parent ); } else { sourceKey = computeDefSourceKey( report, definitionSource ); } final HashMap<String, String> params = new HashMap<>(); params.put("report-locale", report.getReportEnvironment().getLocale().toString() ); params.put( "query-limit", String.valueOf( report.getQueryLimit() ) ); final ReportParameterDefinition parameterDefinition = report.getParameterDefinition(); final ReportParameterValues parameterValues = report.getParameterValues(); for ( final ParameterDefinitionEntry p : parameterDefinition.getParameterDefinitions() ) { final String name = p.getName(); final Object o = parameterValues.get( name ); if ( o == null ) { params.put( name, null ); } else { params.put( name, ConverterRegistry.toAttributeValue( o ) ); } } final ArrayList<Object> key = new ArrayList<>(); key.add( sourceKey ); key.add( params ); return key; }

Target:
private Serializable computeCacheKey( final MasterReport report ) throws BeanException { final ResourceKey definitionSource = report.getDefinitionSource(); final ResourceKey parent = definitionSource.getParent(); final List<String> sourceKey; if ( parent != null ) { sourceKey = computeDefSourceKey( report, parent ); } else { sourceKey = computeDefSourceKey( report, definitionSource ); } final HashMap<String, String> params = new HashMap<>(); params.put( "query-limit", String.valueOf( report.getQueryLimit() ) ); final ReportParameterDefinition parameterDefinition = report.getParameterDefinition(); final ReportParameterValues parameterValues = report.getParameterValues(); for ( final ParameterDefinitionEntry p : parameterDefinition.getParameterDefinitions() ) { final String name = p.getName(); final Object o = parameterValues.get( name ); if ( o == null ) { params.put( name, null ); } else { params.put( name, ConverterRegistry.toAttributeValue( o ) ); } } final ArrayList<Object> key = new ArrayList<>(); key.add( sourceKey ); key.add( params ); key.add( report.getReportEnvironment().getLocale().toString() ); return key; }
Source:
public Object getSampleValue(Integer maxLength, Integer arrayLength) { Preconditions.checkArgument(maxLength == null || maxLength >= 0); char[] key = new char[4]; char[] value = new char[4]; int length = maxLength != null ? maxLength : 1; if (length > (key.length + value.length)) { key = new char[length + 2]; value = new char[length - key.length]; } int j = 1; key[0] = '"'; key[j++] = 'k'; for (int i = 2; i < key.length - 1; i++) { key[j++] = (char) ('0' + RANDOM.get().nextInt(Byte.MAX_VALUE) % 10); } key[j] = '"'; int k = 1; value[0] = '"'; value[k++] = 'v'; for (int i = 2; i < value.length - 1; i++) { value[k++] = (char) ('0' + RANDOM.get().nextInt(Byte.MAX_VALUE) % 10); } value[k] = '"'; StringBuilder sbr = new StringBuilder(); sbr.append("{").append(key).append(":").append(value).append("}"); byte[] bytes = Bytes.toBytes(sbr.toString()); return getPhoenixJson(bytes, 0, bytes.length); }

Target:
public Object getSampleValue(Integer maxLength, Integer arrayLength) { Preconditions.checkArgument(maxLength == null || maxLength >= 0); char[] key = new char[4]; char[] value = new char[4]; int length = maxLength != null ? maxLength : 1; if (length > (key.length + value.length)) { key = new char[length + 2]; value = new char[length - key.length]; } int j = 1; key[0] = '"'; key[j++] = 'k'; for (int i = 2; i < key.length - 1; i++) { key[j++] = (char) ('0' + RANDOM.get().nextInt(Byte.MAX_VALUE) % 10); } key[j] = '"'; int k = 1; value[0] = '"'; value[k++] = 'v'; for (int i = 2; i < value.length - 1; i++) { value[k++] = (char) ('0' + RANDOM.get().nextInt(Byte.MAX_VALUE) % 10); } value[k] = '"'; StringBuilder sbr = new StringBuilder(); sbr.append("{").append(key).append(":").append(value).append("}"); return getPhoenixJson(sbr.toString()); }
Source:
public String getCheckpoint(String replicatorIdentifier) { logger.entering(this.getClass().getName(),"getCheckpoint" + replicatorIdentifier); BasicDocumentRevision doc = dbCore.getLocalDocument(getCheckpointDocumentId(replicatorIdentifier)); if(doc == null) { return null; } Map<String, Object> checkpointDoc = JSONUtils.deserialize(doc.asBytes(), Map.class); if(checkpointDoc == null) { return null; } else { return (String)checkpointDoc.get("lastSequence"); } }

Target:
public String getCheckpoint(String replicatorIdentifier) { logger.entering("DatastoreWrapper","getCheckpoint" + replicatorIdentifier); BasicDocumentRevision doc = dbCore.getLocalDocument(getCheckpointDocumentId(replicatorIdentifier)); if(doc == null) { return null; } Map<String, Object> checkpointDoc = JSONUtils.deserialize(doc.asBytes(), Map.class); if(checkpointDoc == null) { return null; } else { return (String)checkpointDoc.get("lastSequence"); } }
Source:
public void updateDownloadProgress(int newProgress) { progress = newProgress; for (int i = progress; i <= newProgress; i++) { dialog.setProgress(i); } }

Target:
public void updateDownloadProgress(int newProgress) { progress = newProgress; dialog.setProgress(newProgress); }
Source:
public SSAInstruction[] getStatements() { if (statements == null) { return NO_STATEMENTS; } else { SSAInstruction[] result = new SSAInstruction[statements.size()]; Iterator<SSAInstruction> it = statements.iterator(); Arrays.setAll(result, i -> it.next()); return result; } }

Target:
public SSAInstruction[] getStatements() { return statements == null ? NO_STATEMENTS : statements.toArray(new SSAInstruction[0]); }
Source:
public void testCopyChildren() throws OperationException { DocumentModel folder = session.createDocumentModel(ROOT, "SourceFolder", "Folder"); folder = session.createDocument(folder); DocumentModel childDoc = session.createDocumentModel(folder.getPathAsString(), "childDoc", FILE); session.createDocument(childDoc); OperationContext context = new OperationContext(session); context.setInput(folder); Map<String, Serializable> params = Map.of(TARGET_PROPERTY_KEY, ROOT, NAME_PROPERTY_KEY, "CopyFolder"); DocumentModel result = (DocumentModel) automationService.run(context, CopyDocument.ID, params); result = session.getDocument(result.getRef()); assertEquals(1, session.getChildren(result.getRef()).size()); }

Target:
public void testCopyChildren() throws OperationException { DocumentModel folder = session.createDocumentModel(ROOT, "SourceFolder", "Folder"); folder = session.createDocument(folder); DocumentModel childDoc = session.createDocumentModel(folder.getPathAsString(), "childDoc", FILE); session.createDocument(childDoc); try (OperationContext context = new OperationContext(session)) { context.setInput(folder); Map<String, Serializable> params = Map.of(TARGET_PROPERTY_KEY, ROOT, NAME_PROPERTY_KEY, COPY_FOLDER_NAME); DocumentModel result = (DocumentModel) automationService.run(context, CopyDocument.ID, params); result = session.getDocument(result.getRef()); assertNotEquals(folder.getId(), result.getId()); assertEquals(COPY_FOLDER_NAME, result.getName()); DocumentModel childCopy = session.getChild(result.getRef(), childDoc.getName()); assertNotEquals(childDoc.getId(), childCopy.getId()); assertEquals(1, session.getChildren(result.getRef()).size()); } }
Source:
public final HSQuery targetedTypes(List<CustomTypeMetadata> types) { if ( types == null ) { return targetedEntities( null ); } List<IndexedTypeIdentifier> entityTypes = types.stream() .map( CustomTypeMetadata::getEntityType ).collect( toList() ); IndexedTypesSet typesSet = IndexedTypesSets.fromIdentifiers( entityTypes ); setTargetedEntities( typesSet ); this.customTypeMetadata = new ArrayList<>( types ); return this; }

Target:
public final HSQuery targetedTypes(List<CustomTypeMetadata> types) { if ( types == null ) { return targetedEntities( null ); } IndexedTypeSet typesSet = types.stream() .map( CustomTypeMetadata::getEntityType ) .collect( IndexedTypesSets.streamCollector() ); setTargetedEntities( typesSet ); this.customTypeMetadata = new ArrayList<>( types ); return this; }
Source:
public void editProblemDescription(String newDescription) { driver.findElement(PROBLEM_DESCRIPTION).click(); driver.findElement(EDIT_PROBLEM_DESCRIPTION).clear(); driver.findElement(EDIT_PROBLEM_DESCRIPTION).sendKeys(newDescription); clickAtVisibleMapCenter(0); System.out.println("ddddddddddddddddddddddddddddddddddddd"); }

Target:
public void editProblemDescription(String newDescription) { driver.findElement(PROBLEM_DESCRIPTION).click(); driver.findElement(EDIT_PROBLEM_DESCRIPTION).clear(); driver.findElement(EDIT_PROBLEM_DESCRIPTION).sendKeys(newDescription); clickAtVisibleMapCenter(0); }
Source:
private static void save(String table, Person person, SQLiteDatabase database) { ContentValues values = new ContentValues(); values.put("person_id", person.getPersonID()); values.put("local_blog_id", person.getLocalTableBlogId()); values.put("display_name", person.getDisplayName()); values.put("avatar_url", person.getAvatarUrl()); switch (table) { case TEAM_TABLE: values.put("user_name", person.getUsername()); values.put("role", person.getRole().toString()); break; case FOLLOWERS_TABLE: values.put("user_name", person.getUsername()); values.put("subscribed", person.getSubscribed()); break; case EMAIL_FOLLOWERS_TABLE: values.put("subscribed", person.getSubscribed()); break; case VIEWERS_TABLE: values.put("user_name", person.getUsername()); break; } database.insertWithOnConflict(table, null, values, SQLiteDatabase.CONFLICT_REPLACE); }

Target:
private static void save(String table, Person person, SQLiteDatabase database) { ContentValues values = new ContentValues(); values.put("person_id", person.getPersonID()); values.put("local_blog_id", person.getLocalTableBlogId()); values.put("display_name", person.getDisplayName()); values.put("avatar_url", person.getAvatarUrl()); switch (table) { case TEAM_TABLE: values.put("user_name", person.getUsername()); if (person.getRole() != null) { values.put("role", person.getRole().toString()); } break; case FOLLOWERS_TABLE: values.put("user_name", person.getUsername()); values.put("subscribed", person.getSubscribed()); break; case EMAIL_FOLLOWERS_TABLE: values.put("subscribed", person.getSubscribed()); break; case VIEWERS_TABLE: values.put("user_name", person.getUsername()); break; } database.insertWithOnConflict(table, null, values, SQLiteDatabase.CONFLICT_REPLACE); }
Source:
public Viewer createViewer(final Composite parent, CompareConfiguration config) { return new Viewer() { @Override public void setSelection(ISelection selection, boolean reveal) { } @Override public void setInput(Object input) { } @Override public void refresh() { } @Override public ISelection getSelection() { return StructuredSelection.EMPTY; } @Override public Object getInput() { return null; } @Override public Control getControl() { Composite control = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); control.setLayout(layout); Label label = new Label(control, SWT.NONE); label.setText(EMFCompareIDEUIMessages.getString("wait.viewer.desc")); label.setFont(JFaceResources.getBannerFont()); label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true)); control.setData(CompareUI.COMPARE_VIEWER_TITLE, EMFCompareIDEUIMessages .getString("wait.viewer.title")); return control; } }; }

Target:
public Viewer createViewer(final Composite parent, CompareConfiguration config) { return new WaitViewer(parent); }
Source:
public void testUrlToFile() throws Exception { handleFile(System.getProperty("user.home")); handleFile(System.getProperty("user.dir")); if (URLs.IS_WINDOWS_OS) { handleFile("C:\\"); handleFile("C:\\one"); handleFile("C:\\one\\two"); handleFile("C:\\one\\two\\and three"); handleFile("D:\\"); assertURL("\\one", "file:/one"); assertURL("\\.\\one", "file:/./one"); assertURL("one", "file://one"); assertURL("./one", "file://./one"); handleFile("\\\\host\\share\\file"); URL url = new URL("file", " File windowsShareFile = URLs.urlToFile(url); assertNotNull(windowsShareFile); } else { handleFile("/one"); handleFile("one"); handleFile("/one/two/and three"); handleFile("/hello world/this++().file"); } assertURL("one", "file:one"); assertURL("/one", "file:/ assertURL(replaceSlashes("C:\\"), "file://C:/"); assertURL(replaceSlashes("C:\\one"), "file://C:/one"); assertURL(replaceSlashes("C:\\one\\two"), "file://C:/one/two"); assertURL(replaceSlashes("C:\\one\\two\\and three"), "file://C:/one/two/and three"); assertEquals("sample", URLs.urlToFile(new URL("file:sample?query")).toString()); assertEquals("sample", URLs.urlToFile(new URL("file:sample#ref")).toString()); File file = File.createTempFile("hello", "world"); handleFile(file.getAbsolutePath()); handleFile(file.getPath()); URL url = new URL("file", " File windowsShareFile = URLs.urlToFile(url); assertNotNull(windowsShareFile); assertEquals("file café", URLs.urlToFile(new URL("file:file%20caf%C3%A9")).toString()); }

Target:
public void testUrlToFile() throws Exception { handleFile(System.getProperty("user.home")); handleFile(System.getProperty("user.dir")); if (URLs.IS_WINDOWS_OS) { handleFile("C:\\"); handleFile("C:\\one"); handleFile("C:\\one\\two"); handleFile("C:\\one\\two\\and three"); handleFile("D:\\"); assertURL("\\one", "file:/one"); assertURL("\\.\\one", "file:/./one"); assertURL("one", "file://one"); assertURL("./one", "file://./one"); handleFile("\\\\host\\share\\file"); URL url = new URL("file", " File windowsShareFile = URLs.urlToFile(url); assertNotNull(windowsShareFile); } else { handleFile("/one"); handleFile("one"); handleFile("/one/two/and three"); handleFile("/hello world/this++().file"); } assertURL("one", "file:one"); assertURL("/one", "file:/ assertURL(replaceSlashes("C:\\"), "file://C:/"); assertURL(replaceSlashes("C:\\one"), "file://C:/one"); assertURL(replaceSlashes("C:\\one\\two"), "file://C:/one/two"); assertURL(replaceSlashes("C:\\one\\two\\and three"), "file://C:/one/two/and three"); assertEquals("sample", URLs.urlToFile(new URL("file:sample?query")).toString()); assertEquals("sample", URLs.urlToFile(new URL("file:sample#ref")).toString()); File file = File.createTempFile("hello", "world"); handleFile(file.getAbsolutePath()); handleFile(file.getPath()); URL url = new URL("file", " File windowsShareFile = URLs.urlToFile(url); assertNotNull(windowsShareFile); assertEquals("file café", URLs.urlToFile(new URL("file:file%20caf%C3%A9")).toString()); assertEquals("/file café", URLs.urlToFile(new URL("file:/file%20caf%C3%A9")).toString()); assertEquals("file café", URLs.urlToFile(new URL("file://file%20caf%C3%A9")).toString()); }
Source:
public void importManifest( @PathParam("owner_key") @Verify(Owner.class) String ownerKey, @QueryParam("force") String[] overrideConflicts, MultipartInput input) { ConflictOverrides overrides = createConflictOverrides(overrideConflicts); Owner owner = findOwner(ownerKey); Map<String, Object> data = new HashMap<String, Object>(); String filename = ""; try { InputPart part = input.getParts().get(0); filename = extractFileNameFromHeaders(part); File archive = part.getBody(new GenericType<File>() {}); log.info("Importing archive " + archive.getAbsolutePath() + " for owner " + owner.getDisplayName()); data = importer.loadExport(owner, archive, overrides); sink.emitImportCreated(owner); recordImportSuccess(owner, data, overrides, filename); } catch (IOException e) { recordImportFailure(owner, data, e, filename); throw new IseException(i18n.tr("Error reading export archive"), e); } catch (SyncDataFormatException e) { recordImportFailure(owner, data, e, filename); throw new BadRequestException(e.getMessage(), e); } catch (ImporterException e) { recordImportFailure(owner, data, e, filename); throw new IseException(e.getMessage(), e); } catch (CandlepinException e) { recordImportFailure(owner, data, e, filename); throw e; } finally { log.info("Import attempt completed for owner " + owner.getDisplayName()); } }

Target:
public void importManifest( @PathParam("owner_key") @Verify(Owner.class) String ownerKey, @QueryParam("force") String[] overrideConflicts, MultipartInput input) { ConflictOverrides overrides = createConflictOverrides(overrideConflicts); Owner owner = findOwner(ownerKey); Map<String, Object> data = new HashMap<String, Object>(); String filename = ""; try { InputPart part = input.getParts().get(0); filename = extractFileNameFromHeaders(part); File archive = part.getBody(new GenericType<File>() {}); log.info("Importing archive for owner {}", archive.getAbsolutePath(), owner.getDisplayName()); data = importer.loadExport(owner, archive, overrides); sink.emitImportCreated(owner); recordImportSuccess(owner, data, overrides, filename); } catch (IOException e) { recordImportFailure(owner, data, e, filename); throw new IseException(i18n.tr("Error reading export archive"), e); } catch (SyncDataFormatException e) { recordImportFailure(owner, data, e, filename); throw new BadRequestException(e.getMessage(), e); } catch (ImporterException e) { recordImportFailure(owner, data, e, filename); throw new IseException(e.getMessage(), e); } catch (CandlepinException e) { recordImportFailure(owner, data, e, filename); throw e; } finally { log.info("Import attempt completed for owner {}", owner.getDisplayName()); } }
Source:
static boolean handleIMEIDisplay(Context context, String input, boolean useSystemWindow) { if (input.equals(MMI_IMEI_DISPLAY)) { int networkType = ((TelephonyManager)context.getSystemService( Context.TELEPHONY_SERVICE)).getNetworkType(); if (networkType == TelephonyManager.NETWORK_TYPE_CDMA) { showNotSupportedPanel(context, useSystemWindow); return false; } else { showIMEIPanel(context, useSystemWindow); return true; } } return false; }

Target:
static boolean handleIMEIDisplay(Context context, String input, boolean useSystemWindow) { if (input.equals(MMI_IMEI_DISPLAY)) { int networkType = ((TelephonyManager)context.getSystemService( Context.TELEPHONY_SERVICE)).getNetworkType(); if(networkType == TelephonyManager.NETWORK_TYPE_GPRS || networkType == TelephonyManager.NETWORK_TYPE_EDGE || networkType == TelephonyManager.NETWORK_TYPE_UMTS ) { showIMEIPanel(context, useSystemWindow); return true; } } return false; }
Source:
private PyExpressionTree getExpression(PyExpressionTree expr) { if (expr.is(Tree.Kind.MODULO) || expr.is(Tree.Kind.PLUS)) { return getExpression(((PyBinaryExpressionTree) expr).leftOperand()); } return expr; }

Target:
private static PyExpressionTree getExpression(PyExpressionTree expr) { if (expr.is(Tree.Kind.MODULO) || expr.is(Tree.Kind.PLUS)) { return getExpression(((PyBinaryExpressionTree) expr).leftOperand()); } return expr; }
Source:
public void testQueryElementNoFollowingSibling() throws Exception { final String xpath = " final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); assertEquals("Invalid number of nodes", 0, actual.length); }

Target:
public void testQueryElementNoFollowingSibling() throws Exception { final String xpath = " final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); assertThat("Invalid number of nodes", actual.length, equalTo(0)); }
Source:
public void setUnmanagedDeviceList(List<VmDevice> list) { mVmStatic.setUnmanagedDeviceList(list); }

Target:
public void setUnmanagedDeviceList(List<VmDevice> list) { if (mVmStatic == null) { mVmStatic = new VmStatic(); } mVmStatic.setUnmanagedDeviceList(list); }
Source:
public BigInteger computeHash() { final Funnel<StructNode> nodeFunnel = (StructNode node, PrimitiveSink into) -> { if(lastChild != -2L) { into.putLong(node.getChildCount()).putLong(node.getDescendantCount()).putLong(node.getLeftSiblingKey()).putLong( node.getRightSiblingKey()).putLong(node.getFirstChildKey()); } else { into.putLong(node.getChildCount()).putLong(node.getDescendantCount()).putLong(node.getLeftSiblingKey()).putLong( node.getRightSiblingKey()).putLong(node.getFirstChildKey()).putLong(node.getLastChildKey()); } }; final BigInteger hash = new BigInteger(1, nodeDelegate.getHashFunction().hashObject(this, nodeFunnel).asBytes()); return Node.to128BitsAtMaximumBigInteger(hash); }

Target:
public BigInteger computeHash() { final Funnel<StructNode> nodeFunnel = (StructNode node, PrimitiveSink into) -> { if(lastChild != Fixed.INVALID_KEY_FOR_TYPE_CHECK.getStandardProperty()) { into.putLong(node.getChildCount()).putLong(node.getDescendantCount()).putLong(node.getLeftSiblingKey()).putLong( node.getRightSiblingKey()).putLong(node.getFirstChildKey()); } else { into.putLong(node.getChildCount()).putLong(node.getDescendantCount()).putLong(node.getLeftSiblingKey()).putLong( node.getRightSiblingKey()).putLong(node.getFirstChildKey()).putLong(node.getLastChildKey()); } }; final BigInteger hash = new BigInteger(1, nodeDelegate.getHashFunction().hashObject(this, nodeFunnel).asBytes()); return Node.to128BitsAtMaximumBigInteger(hash); }
Source:
public void removeMemberWaitsForStartManager() throws Exception { CountDownLatch latch = new CountDownLatch(1); CyclicBarrier barrier = new CyclicBarrier(2); ExecutorService executorService = mock(ExecutorService.class); List<Future<InternalDistributedMember>> futureTaskList = Collections.emptyList(); when(executorService.invokeAll(any())).thenAnswer(invocation -> { awaitCyclicBarrier(barrier); awaitCountDownLatch(latch); return futureTaskList; }); FederatingManager federatingManager = spy(new FederatingManager(repo, system, service, cache, statisticsFactory, statisticsClock, proxyFactory, messenger, cancelCriterion, executorService)); executorServiceRule.submit(() -> { federatingManager.startManager(); }); executorServiceRule.submit(() -> { awaitCyclicBarrier(barrier); federatingManager.removeMember(member(), true); }); await().untilAsserted(() -> { assertThat(federatingManager.pendingTasks()).hasSize(1); }); latch.countDown(); await().untilAsserted(() -> { assertThat(federatingManager.pendingTasks()).isEmpty(); }); }

Target:
public void removeMemberWaitsForStartManager() throws Exception { CountDownLatch latch = new CountDownLatch(1); CyclicBarrier barrier = new CyclicBarrier(2); ExecutorService executorService = mock(ExecutorService.class); List<Future<InternalDistributedMember>> futureTaskList = Collections.emptyList(); when(executorService.invokeAll(any())).thenAnswer(invocation -> { awaitCyclicBarrier(barrier); awaitCountDownLatch(latch); return futureTaskList; }); FederatingManager federatingManager = new FederatingManager(repo, system, service, cache, statisticsFactory, statisticsClock, proxyFactory, messenger, cancelCriterion, executorService); executorServiceRule.submit(() -> { federatingManager.startManager(); }); executorServiceRule.submit(() -> { awaitCyclicBarrier(barrier); federatingManager.removeMember(member(), true); }); await().untilAsserted(() -> { assertThat(federatingManager.pendingTasks()).hasSize(1); }); latch.countDown(); await().untilAsserted(() -> { assertThat(federatingManager.pendingTasks()).isEmpty(); }); }
Source:
public void renderText(float renderCoordX, float renderCoordY) { for (int i = 0; i < text.length; i++) { typeFont.drawString(renderCoordX, renderCoordY + i * 50, text[i], controller.decideColor(severities[i])); } }

Target:
private void renderText(float renderCoordX, float renderCoordY) { for (int i = 0; i < text.length; i++) { typeFont.drawString(renderCoordX, renderCoordY + i * 50, text[i], controller.decideColor(severities[i])); } }
Source:
private HttpUriRequest toApacheRequest(final HttpRequest httpRequest) throws UnsupportedEncodingException { final String method = httpRequest.getHttpMethod().toString(); final String uri = httpRequest.getUrl(); final RequestBuilder builder = RequestBuilder .create(method) .setUri(uri); httpRequest.getHeaders().getHeadersAsMap().forEach((name, values) -> values.forEach(value -> builder.addHeader(name, value))); if (httpRequest.getBody() != null) { final HttpRequestBody body = httpRequest.getBody(); final HttpEntity httpEntity; if (body instanceof StringHttpRequestBody) { StringEntity stringEntity = new StringEntity(((StringHttpRequestBody) body).getString(),"UTF-8"); stringEntity.setContentType(ContentType.APPLICATION_JSON.toString()); httpEntity = stringEntity; } else if (body instanceof FileHttpRequestBody) { httpEntity = new FileEntity(((FileHttpRequestBody)body).getFile()); } else if (body instanceof FormUrlEncodedHttpRequestBody) { httpEntity = urlEncodedOf((FormUrlEncodedHttpRequestBody) body); } else { throw new HttpException("Cannot interpret request " + httpRequest); } builder.setEntity(httpEntity); } return builder.build(); }

Target:
private HttpUriRequest toApacheRequest(final HttpRequest httpRequest) throws UnsupportedEncodingException { final String method = httpRequest.getHttpMethod().toString(); final String uri = httpRequest.getUrl(); final RequestBuilder builder = RequestBuilder .create(method) .setUri(uri); httpRequest.getHeaders().getHeadersAsMap().forEach((name, values) -> values.forEach(value -> builder.addHeader(name, value))); if (httpRequest.getBody() != null) { final HttpRequestBody body = httpRequest.getBody(); final HttpEntity httpEntity; if (body instanceof StringHttpRequestBody) { final StringEntity stringEntity = new StringEntity(((StringHttpRequestBody) body).getString(), StandardCharsets.UTF_8); stringEntity.setContentType(ContentType.APPLICATION_JSON.toString()); httpEntity = stringEntity; } else if (body instanceof FileHttpRequestBody) { httpEntity = new FileEntity(((FileHttpRequestBody)body).getFile()); } else if (body instanceof FormUrlEncodedHttpRequestBody) { httpEntity = urlEncodedOf((FormUrlEncodedHttpRequestBody) body); } else { throw new HttpException("Cannot interpret request " + httpRequest); } builder.setEntity(httpEntity); } return builder.build(); }
Source:
public CDPStructuredFlowEvent createStructuredFlowEvent(Long resourceId, FlowDetails flowDetails, Boolean detailed) { Optional<Environment> environmentOptional = environmentService.findEnvironmentById(resourceId); Environment environment = environmentOptional.orElseThrow(notFound("Environment", resourceId)); String resourceType = CDPStructuredFlowEvent.class.getSimpleName(); CDPOperationDetails operationDetails = new CDPOperationDetails(clock.getCurrentTimeMillis(), FLOW, resourceType, environment.getId(), environment.getName(), nodeConfig.getId(), serviceVersion, environment.getAccountId(), environment.getResourceCrn(), environment.getCreator(), environment.getResourceCrn(), null); return new CDPStructuredFlowEvent(resourceType, operationDetails, flowDetails, null); }

Target:
public CDPStructuredFlowEvent createStructuredFlowEvent(Long resourceId, FlowDetails flowDetails, Boolean detailed) { return createStructuredFlowEvent(resourceId, flowDetails, detailed, null); }