auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Object extractPlanningId(Object externalObject) { Object planningId = planningIdMemberAccessor.executeGetter(externalObject); if (planningId == null) { throw new IllegalArgumentException("The planningId (" + planningId + ") of the member (" + planningIdMemberAccessor + ") on externalObject (" + externalObject + ") must not be null.\n" + "Maybe initialize the planningId of the original object before solving" + " or remove the " + PlanningId.class.getSimpleName() + " annotation" + " or change the " + PlanningSolution.class.getSimpleName() + " annotation's " + LocationStrategyType.class.getSimpleName() + "."); } return Pair.of(externalObject.getClass(), planningId); }

Target:
protected Object extractPlanningId(Object externalObject) { Object planningId = planningIdMemberAccessor.executeGetter(externalObject); if (planningId == null) { throw new IllegalArgumentException("The planningId (" + planningId + ") of the member (" + planningIdMemberAccessor + ") of the class (" + externalObject.getClass() + ") on externalObject (" + externalObject + ") must not be null.\n" + "Maybe initialize the planningId of the original object before solving" + " or remove the " + PlanningId.class.getSimpleName() + " annotation" + " or change the " + PlanningSolution.class.getSimpleName() + " annotation's " + LocationStrategyType.class.getSimpleName() + "."); } return Pair.of(externalObject.getClass(), planningId); }
Source:
@Override public void close() throws IOException { try { for ( ResultSet rs : otherResultSets ) { resultSet.close(); } for ( Statement s : otherStatements ) { s.close(); } resultSet.close(); statement.close(); connection.close(); open = false; } catch ( SQLException e ) { throw new IOException( "Unable to close sql objects", e ); } }

Target:
@Override public void close() throws IOException { try { for ( ResultSet rs : otherResultSets ) { rs.close(); } for ( Statement s : otherStatements ) { s.close(); } resultSet.close(); statement.close(); connection.close(); open = false; } catch ( SQLException e ) { throw new IOException( "Unable to close sql objects", e ); } }
Source:
private void setControlEnabled(Composite composite, boolean enabled){ composite.setEnabled(enabled); for (Control child : composite.getChildren()) { if (child == removeGraphButton || child == copyGraphButton) { child.setEnabled(false); } if(child instanceof Composite){ setControlEnabled((Composite)child, enabled); } } }

Target:
private void setControlEnabled(Composite composite, boolean enabled){ composite.setEnabled(enabled); for (Control child : composite.getChildren()) { child.setEnabled(enabled); if(child instanceof Composite){ setControlEnabled((Composite)child, enabled); } } }
Source:
public boolean updateConsoleLog(File dest, InputStream in) throws IOException { File parentFile = dest.getParentFile(); parentFile.mkdirs(); LOGGER.trace("Updating console log [" + dest.getAbsolutePath() + "]"); try (BufferedWriter writer = new BufferedWriter(new FileWriter(dest, dest.exists()))) { IOUtils.copy(in, writer, Charset.defaultCharset()); } catch (IOException e) { LOGGER.error("Failed to update console log at : [" + dest.getAbsolutePath() + "]", e); return false; } if (LOGGER.isTraceEnabled()) { LOGGER.trace("Console log [" + dest.getAbsolutePath() + "] saved."); } return true; }

Target:
public boolean updateConsoleLog(File dest, InputStream in) throws IOException { File parentFile = dest.getParentFile(); parentFile.mkdirs(); LOGGER.trace("Updating console log [" + dest.getAbsolutePath() + "]"); try (OutputStream out = new BufferedOutputStream(new FileOutputStream(dest, dest.exists()))) { IOUtils.copy(in, out); } catch (IOException e) { LOGGER.error("Failed to update console log at : [" + dest.getAbsolutePath() + "]", e); return false; } if (LOGGER.isTraceEnabled()) { LOGGER.trace("Console log [" + dest.getAbsolutePath() + "] saved."); } return true; }
Source:
public CoalesceUnitPanel(ColumnListMultipleCoalesceUnitPropertyWidget parent, CoalesceUnit unit) { _parent = parent; _inputColumns = new ArrayList<>(); _inputColumnPanels = new IdentityHashMap<>(); _comboBox = new DCComboBox<>(); SchemaStructureComboBoxListRenderer renderer = new SchemaStructureComboBoxListRenderer(); renderer.setNullText("- Add input column -"); _comboBox.setRenderer(renderer); _comboBox.addListener(new DCComboBox.Listener<InputColumn<?>>() { @Override public void onItemSelected(InputColumn<?> item) { if (item == null) { return; } addInputColumn(item); } }); _columnListPanel = new DCPanel(); _columnListPanel.setLayout(new VerticalLayout(2)); _columnListPanel.setBorder(new EmptyBorder(4, 4, 4, 4)); final DCPanel comboBoxPanel = DCPanel.around(_comboBox); comboBoxPanel.setBorder(new EmptyBorder(4, 4, 4, 4)); _outerPanel = new DCPanel(); _outerPanel.setLayout(new BorderLayout()); _outerPanel.add(_columnListPanel, BorderLayout.CENTER); _outerPanel.add(comboBoxPanel, BorderLayout.SOUTH); setLayout(new BorderLayout()); add(WidgetUtils.decorateWithShadow(_outerPanel), BorderLayout.CENTER); List<InputColumn<?>> availableInputColumns = _parent.getAvailableInputColumns(); setAvailableInputColumns(availableInputColumns); if (unit != null) { InputColumn<?>[] updatedInputColumns = unit.getUpdatedInputColumns(availableInputColumns .toArray(new InputColumn[availableInputColumns.size()]), false); for (InputColumn<?> inputColumn : updatedInputColumns) { addInputColumn(inputColumn); } } }

Target:
public CoalesceUnitPanel(ColumnListMultipleCoalesceUnitPropertyWidget parent, CoalesceUnit unit) { _parent = parent; _inputColumns = new ArrayList<>(); _inputColumnPanels = new IdentityHashMap<>(); _comboBox = new DCComboBox<>(); SchemaStructureComboBoxListRenderer renderer = new SchemaStructureComboBoxListRenderer(); renderer.setNullText("- Add input column -"); _comboBox.setRenderer(renderer); _comboBox.addListener(new DCComboBox.Listener<InputColumn<?>>() { @Override public void onItemSelected(InputColumn<?> item) { if (item == null) { return; } addInputColumn(item); } }); _columnListPanel = new DCPanel(); _columnListPanel.setLayout(new VerticalLayout(2)); _columnListPanel.setBorder(new EmptyBorder(4, 4, 4, 4)); final DCPanel comboBoxPanel = DCPanel.around(_comboBox); comboBoxPanel.setBorder(new EmptyBorder(4, 4, 4, 4)); _outerPanel = new DCPanel(); _outerPanel.setLayout(new BorderLayout()); _outerPanel.add(_columnListPanel, BorderLayout.CENTER); _outerPanel.add(comboBoxPanel, BorderLayout.SOUTH); setLayout(new BorderLayout()); add(WidgetUtils.decorateWithShadow(_outerPanel), BorderLayout.CENTER); List<InputColumn<?>> availableInputColumns = _parent.getAvailableInputColumns(); setAvailableInputColumns(availableInputColumns); if (unit != null) { final InputColumn<?>[] updatedInputColumns = unit.getUpdatedInputColumns(availableInputColumns .toArray(new InputColumn[availableInputColumns.size()]), false); for (InputColumn<?> inputColumn : updatedInputColumns) { addInputColumn(inputColumn); } } }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case FILE_SELECT_CODE: if (resultCode == RESULT_OK) { Uri uri = data.getData(); Log.d("Get file", "File Uri: " + uri.toString()); ContentResolver cR = getContentResolver(); Log.d("file type", cR.getType(uri)); addAttachment(uri); } break; } super.onActivityResult(requestCode, resultCode, data); }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case FILE_SELECT_CODE: if (resultCode == RESULT_OK) { Uri uri = data.getData(); ContentResolver cR = getContentResolver(); addAttachment(uri); } break; } super.onActivityResult(requestCode, resultCode, data); }
Source:
private boolean isPatch(Feature feature) { FeatureEntry[] entries = feature.getEntries(); for (FeatureEntry entrie : entries) { if (entrie.isPatch()) { return true; } } return false; }

Target:
private boolean isPatch(Feature feature) { FeatureEntry[] entries = feature.getEntries(); for (FeatureEntry entry : entries) { if (entry.isPatch()) { return true; } } return false; }
Source:
private int resolveDecodedLength(int lengthByte) throws PatchApplyException { if (lengthByte <= 122 && lengthByte >= 97) { return lengthByte - 70; } else if (lengthByte <= 90 && lengthByte >= 65) { return lengthByte - 64; } else { throw new PatchApplyException( "Invalid length found: " + lengthByte); } }

Target:
private int resolveDecodedLength(int lengthByte) throws PatchApplyException { if (lengthByte <= 122 && lengthByte >= 97) { return lengthByte - 70; } else if (lengthByte <= 90 && lengthByte >= 65) { return lengthByte - 64; } else { throw new PatchApplyException(MessageFormat.format( JGitText.get().invalidBinaryStreamLength, (char) lengthByte)); } }
Source:
private boolean cacheReadRequest(ReadOptions options) { if (runtime.getParameters().isCacheDisabled() && options.isClientCacheable()) { if (runtime.getParameters().getPriorityLevel() != PriorityLevel.HIGH) { log.warn("read: Runtime cache is disabled, but read request is requesting to cache"); } } return !runtime.getParameters().isCacheDisabled() && options.isClientCacheable(); }

Target:
private boolean cacheReadRequest(ReadOptions options) { return !runtime.getParameters().isCacheDisabled() && options.isClientCacheable(); }
Source:
public Image stereotypeIconToDisplay() { String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View) getHost().getModel()); if (stereotypespresentationKind == null) { return null; } if (stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) { String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View) getHost().getModel()); StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ","); if (tokenizer.hasMoreTokens()) { String firstStereotypeName = tokenizer.nextToken(); Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName); return Activator.getIconElement(getUMLElement(), stereotype, false); } } return null; }

Target:
public Image stereotypeIconToDisplay() { Image icon = null; String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View) getHost().getModel()); if (stereotypespresentationKind == null) { icon = null; } if (stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) { String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View) getHost().getModel()); StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ","); if (tokenizer.hasMoreTokens()) { String firstStereotypeName = tokenizer.nextToken(); Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName); icon = Activator.getIconElement(getUMLElement(), stereotype, false); } } return icon; }
Source:
public void provideCompletedRunData(Run run, JSONObject json) { FailureCauseBuildAction action = run.getAction(FailureCauseBuildAction.class); if (action != null) { List<FoundFailureCause> foundFailureCauses = action.getFoundFailureCauses(); JSONArray failureCausesJSON = new JSONArray(); for (FoundFailureCause foundFailureCause : foundFailureCauses) { JSONObject failureCauseJSON = new JSONObject(); failureCauseJSON.put("id", foundFailureCause.getId()); failureCauseJSON.put("name", foundFailureCause.getName()); failureCauseJSON.put("description", foundFailureCause.getDescription()); failureCauseJSON.put("categories", foundFailureCause.getCategories()); JSONArray foundIndicationsJSON = new JSONArray(); for (FoundIndication ind : foundFailureCause.getIndications()) { JSONObject foundIndicationJSON = new JSONObject(); foundIndicationJSON.put("pattern", ind.getPattern()); foundIndicationJSON.put("matchingString", ind.getMatchingString()); foundIndicationsJSON.add(foundIndicationJSON); } failureCauseJSON.put("indications", foundIndicationsJSON); failureCausesJSON.add(failureCauseJSON); } json.put("failurecauses", failureCausesJSON); } }

Target:
public void provideCompletedRunData(Run run, JSONObject json) { FailureCauseBuildAction action = run.getAction(FailureCauseBuildAction.class); if (action != null) { List<FoundFailureCause> foundFailureCausesList = action.getFoundFailureCauses(); JSONArray failureCausesJSONArray = new JSONArray(); for (FoundFailureCause foundFailureCause : foundFailureCausesList) { JSONObject failureCauseJSONObject = new JSONObject(); failureCauseJSONObject.put("id", foundFailureCause.getId()); failureCauseJSONObject.put("name", foundFailureCause.getName()); failureCauseJSONObject.put("description", foundFailureCause.getDescription()); failureCauseJSONObject.put("categories", foundFailureCause.getCategories()); JSONArray foundIndicationsJSONArray = new JSONArray(); for (FoundIndication indication : foundFailureCause.getIndications()) { JSONObject foundIndicationJSONObject = new JSONObject(); foundIndicationJSONObject.put("pattern", indication.getPattern()); foundIndicationJSONObject.put("matchingString", indication.getMatchingString()); foundIndicationsJSONArray.add(foundIndicationJSONObject); } failureCauseJSONObject.put("indications", foundIndicationsJSONArray); failureCausesJSONArray.add(failureCauseJSONObject); } json.put("failurecauses", failureCausesJSONArray); } }
Source:
public String getContainerHostForModulePrefix(String streamName, ModuleType moduleType) { Assert.hasText(streamName, "stream name can not be empty nor null"); String moduleIdPrefix = streamName + "." + moduleType + "."; Iterator<ModuleMetadataResource> resourceIter = StreamUtils.getRuntimeModules(adminServer).iterator(); ArrayList<String> containerIds = new ArrayList<String>(); while (resourceIter.hasNext()) { ModuleMetadataResource resource = resourceIter.next(); if (resource.getName().startsWith(moduleIdPrefix)) { containerIds.add(resource.getContainerId()); } } Assert.isTrue( containerIds.size() == 1, "Test require that module to be deployed to only one container. It was deployed to " + containerIds.size() + " containers"); return containers.get(containerIds.get(0)); }

Target:
public String getContainerHostForModulePrefix(String streamName, ModuleType moduleType) { Assert.hasText(streamName, "stream name can not be empty nor null"); String moduleIdPrefix = streamName + "." + moduleType + "."; Iterator<ModuleMetadataResource> resourceIter = StreamUtils.getRuntimeModules(adminServer).iterator(); ArrayList<String> containerIds = new ArrayList<String>(); while (resourceIter.hasNext()) { ModuleMetadataResource resource = resourceIter.next(); if (resource.getModuleId().startsWith(moduleIdPrefix)) { containerIds.add(resource.getContainerId()); } } Assert.isTrue( containerIds.size() == 1, "Test require that module to be deployed to only one container. It was deployed to " + containerIds.size() + " containers"); return containers.get(containerIds.get(0)); }
Source:
private void cleanupDataSets(FileSystem oldDatasetsFS) { Path oldDatasetsRoot = getRoot(oldDatasetsFS); if (oldDatasetsRoot != null) { if (oldDatasetsFS instanceof JGitFileSystem) { try { Path fsPath = oldDatasetsFS.getPath(""); Files.delete(fsPath); } catch (Exception e) { LOGGER.error("Failed to remove the datasets git repository."); } } } }

Target:
private void cleanupDataSets(FileSystem oldDatasetsFS) { Path oldDatasetsRoot = getRoot(oldDatasetsFS); if (oldDatasetsRoot != null) { if (oldDatasetsFS instanceof JGitFileSystem) { try { Path fsPath = oldDatasetsFS.getPath(""); Files.delete(fsPath); } catch (Exception e) { LOGGER.error("Failed to remove the datasets git repository."); LOGGER.debug("Error during dashbuilder migration", e); } } } }
Source:
public void writeObject(Object obj) throws IOException { LinkedBuffer buffer = LinkedBuffer.allocate(); byte[] bytes; byte[] classNameBytes; if (Utils.WRAPPER_SET.contains(obj.getClass()) || obj.getClass().isArray() || obj instanceof Enum) { Schema<Wrapper> schema = RuntimeSchema.getSchema(Wrapper.class); Wrapper wrapper = new Wrapper(obj); bytes = ProtobufIOUtil.toByteArray(wrapper, schema, buffer); classNameBytes = Wrapper.class.getName().getBytes(); } else { Schema schema = RuntimeSchema.getSchema(obj.getClass()); bytes = ProtobufIOUtil.toByteArray(obj, schema, buffer); classNameBytes = obj.getClass().getName().getBytes(); } dos.writeInt(classNameBytes.length); dos.writeInt(bytes.length); dos.write(classNameBytes); dos.write(bytes); }

Target:
public void writeObject(Object obj) throws IOException { LinkedBuffer buffer = LinkedBuffer.allocate(); byte[] bytes; byte[] classNameBytes; if (WrapperUtils.needWrapper(obj)) { Schema<Wrapper> schema = RuntimeSchema.getSchema(Wrapper.class); Wrapper wrapper = new Wrapper(obj); bytes = ProtobufIOUtil.toByteArray(wrapper, schema, buffer); classNameBytes = Wrapper.class.getName().getBytes(); } else { Schema schema = RuntimeSchema.getSchema(obj.getClass()); bytes = ProtobufIOUtil.toByteArray(obj, schema, buffer); classNameBytes = obj.getClass().getName().getBytes(); } dos.writeInt(classNameBytes.length); dos.writeInt(bytes.length); dos.write(classNameBytes); dos.write(bytes); }
Source:
public String toString() { final String lineSeparator = System.getProperty("line.separator"); StringBuilder output = new StringBuilder(); output.append(StringUtils.format("Druid version - %s", version)).append(lineSeparator).append(lineSeparator); if (modules.size() > 0) { output.append("Registered Druid Modules").append(lineSeparator); } else { output.append("No Druid Modules loaded !"); } for (ModuleVersion moduleVersion : modules) { output.append(moduleVersion).append(lineSeparator); } return output.toString(); }

Target:
public String toString() { StringBuilder output = new StringBuilder(); String lineSeparator = System.lineSeparator(); output.append(StringUtils.format("Druid version - %s", version)).append(lineSeparator).append(lineSeparator); if (modules.size() > 0) { output.append("Registered Druid Modules").append(lineSeparator); } else { output.append("No Druid Modules loaded !"); } for (ModuleVersion moduleVersion : modules) { output.append(moduleVersion).append(lineSeparator); } return output.toString(); }
Source:
public KRunState rewrite(ConstrainedTerm constrainedTerm, int bound, boolean computeGraph) { stopwatch.start(); Context context = definition.context(); KRunState initialState = new JavaKRunState(constrainedTerm.term(), context, counter); if (computeGraph) { executionGraph = new KRunGraph(); executionGraph.addVertex(initialState); } for (step = 0; step != bound; ++step) { computeRewriteStep(constrainedTerm, 1); ConstrainedTerm result = getTransition(0); if (result != null) { KRunState finalState = new JavaKRunState(result.term(), context, counter); if (computeGraph) { JavaTransition javaTransition = new JavaTransition( getRule(0), getSubstitution(0), context); executionGraph.addEdge(javaTransition, initialState, finalState); } constrainedTerm = result; initialState = finalState; } else { break; } } stopwatch.stop(); if (definition.context().krunOptions.experimental.statistics) { System.err.println("[" + step + ", " + stopwatch + "]"); } return initialState; }

Target:
public KRunState rewrite(ConstrainedTerm constrainedTerm, int bound, boolean computeGraph) { stopwatch.start(); Context context = definition.context(); KRunState initialState = null; if (computeGraph) { executionGraph = new KRunGraph(); initialState = new JavaKRunState(constrainedTerm.term(), context, counter); executionGraph.addVertex(initialState); } for (step = 0; step != bound; ++step) { computeRewriteStep(constrainedTerm, 1); ConstrainedTerm result = getTransition(0); KRunState finalState = null; if (result != null) { if (computeGraph) { finalState = new JavaKRunState(result.term(), context, counter); JavaTransition javaTransition = new JavaTransition( getRule(0), getSubstitution(0), context); executionGraph.addEdge(javaTransition, initialState, finalState); } constrainedTerm = result; } else { if (computeGraph) { initialState = finalState; } break; } } stopwatch.stop(); if (definition.context().krunOptions.experimental.statistics) { System.err.println("[" + step + ", " + stopwatch + "]"); } if (initialState == null) { initialState = new JavaKRunState(constrainedTerm.term(), context, counter); } return initialState; }
Source:
private static Multimap<String, String> toStringMap(JSONObject object) { if (object != null) { Multimap<String, String> map = HashMultimap.create(); Iterator<String> keys = object.keys(); while (keys.hasNext()) { String key = keys.next(); if (key != null) { map.put(key, object.optString(key)); } } return map; } return null; }

Target:
private static Multimap<String, String> toStringMap(JSONObject object) { if (object != null) { Multimap<String, String> map = HashMultimap.create(); Iterator<String> keys = object.keys(); while (keys.hasNext()) { String key = keys.next(); if (key != null) { map.put(key, object.optString(key, null)); } } return map; } return null; }
Source:
public StreamlineHiveMapper(List<String> fields, List<String> partitionFields) { Objects.requireNonNull(fields, "Empty fields"); Objects.requireNonNull(partitionFields, "Empty partitionFields"); this.fields = fields.stream().map(field -> field.substring(field.indexOf(":") + 1, field.length())).collect(Collectors.toList()); this.partitionFields = partitionFields.stream().map(field -> field.substring(field.indexOf(":") + 1, field.length())).collect(Collectors.toList()); }

Target:
public StreamlineHiveMapper(List<String> fields, List<String> partitionFields) { Objects.requireNonNull(fields, "Empty fields"); Objects.requireNonNull(partitionFields, "Empty partitionFields"); this.fields = fields.stream().map(field -> field.substring(field.indexOf(":") + 1)).collect(Collectors.toList()); this.partitionFields = partitionFields.stream().map(field -> field.substring(field.indexOf(":") + 1)).collect(Collectors.toList()); }
Source:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_RESOURCE_ATTR_DEF); attr.setFriendlyName("maxUserDataQuotas"); attr.setDisplayName("Maximum of data quotas of User on any volumes."); attr.setType(LinkedHashMap.class.getName()); attr.setDescription("This is Facility manager maximum set for Resource on defined volumes. " + "Every record is the path (to volume) and the quota in format 'SoftQuota:HardQuota' in (M, G, T, ...), G is default. Example: '10G:20T'."); return attr; }

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_RESOURCE_ATTR_DEF); attr.setFriendlyName("maxUserDataQuotas"); attr.setDisplayName("Maximum of data quotas of user on any volumes."); attr.setType(LinkedHashMap.class.getName()); attr.setDescription("Maximum data quota for each user on this resource. " + "Every record is the path (to volume) and the quota in format 'SoftQuota:HardQuota' in (M, G, T, ...), G is default. Example: '10G:20T'."); return attr; }
Source:
public void shouldAlwaysPull() { try ( GenericContainer<?> container = new GenericContainer<>(imageName) .withStartupCheckStrategy(new OneShotStartupCheckStrategy()) ) { container.start(); } DockerClientFactory.instance().client() .removeImageCmd(imageName.asCanonicalNameString()) .withForce(true) .exec(); try ( GenericContainer<?> container = new GenericContainer<>(imageName) .withStartupCheckStrategy(new OneShotStartupCheckStrategy()) ) { expectToFailWithNotFoundException(container); } try ( GenericContainer<?> container = new GenericContainer<>(imageName) .withImagePullPolicy(PullPolicy.alwaysPull()) ) { container.withStartupCheckStrategy(new OneShotStartupCheckStrategy()); container.start(); } }

Target:
public void shouldAlwaysPull() { try ( GenericContainer<?> container = new GenericContainer<>(imageName) .withStartupCheckStrategy(new OneShotStartupCheckStrategy()) ) { container.start(); } removeImage(); try ( GenericContainer<?> container = new GenericContainer<>(imageName) .withStartupCheckStrategy(new OneShotStartupCheckStrategy()) ) { expectToFailWithNotFoundException(container); } try ( GenericContainer<?> container = new GenericContainer<>(imageName) .withImagePullPolicy(PullPolicy.alwaysPull()) ) { container.withStartupCheckStrategy(new OneShotStartupCheckStrategy()); container.start(); } }
Source:
public boolean await(Duration duration) throws InterruptedException { KeyValueStoreProvider kv = (KeyValueStoreProvider) getKvStore(); Set<String> commandIds = kv.keyStream() .filter(k -> k.endsWith(STATUS)) .map(k -> k.replaceFirst(STATUS, "")) .collect(Collectors.toSet()); for (String id : commandIds) { while (getStatus(id).getState() != State.COMPLETED) { Thread.sleep(100); } } return true; }

Target:
public boolean await(Duration duration) throws InterruptedException { KeyValueStoreProvider kv = (KeyValueStoreProvider) getKvStore(); Set<String> commandIds = kv.keyStream() .filter(k -> k.endsWith(STATUS)) .map(k -> k.replaceFirst(STATUS, "")) .collect(Collectors.toSet()); for (String id : commandIds) { while (getStatus(id).getState() != State.COMPLETED) { Thread.sleep(100); long deadline = System.nanoTime() + duration.toNanos(); for (String commandId : commandIds) { while (getStatus(commandId).getState() != COMPLETED) { Thread.sleep(100); if (deadline < System.nanoTime()) { return false; } } } } } return true; }
Source:
public void perform(final UiController uiController, final View view) { Screenshot.snap(view) .record(); }

Target:
public void perform(final UiController uiController, final View view) { Screenshot.snap(view).setName(name).record(); }
Source:
public void setup() { doReturn(dbFacade).when(cmd).getDbFacade(); when(dbFacade.getStoragePoolDao()).thenReturn(storagePoolDAO); when(dbFacade.getStorageDomainDao()).thenReturn(storageDomainDAO); when(cmd.getTransactionSupport()).thenReturn(transactionSupport); }

Target:
public void setup() { CommandMocks.mockDbFacade(cmd, dbFacade); when(dbFacade.getStoragePoolDao()).thenReturn(storagePoolDAO); when(dbFacade.getStorageDomainDao()).thenReturn(storageDomainDAO); CommandMocks.mockTxSupport(cmd); }
Source:
String getSubscribingDeviceId() { String subscribingDeviceId = DEFAULT_DEVICE_ID_TOPIC; final Object deviceId = this.properties.get(CONF_DEVICE_ID_TOPIC); if ((this.properties != null) && this.properties.containsKey(CONF_APP_TOPIC) && (deviceId != null) && (deviceId instanceof String)) { subscribingDeviceId = String.valueOf(deviceId); } return subscribingDeviceId; }

Target:
String getSubscribingDeviceId() { String subscribingDeviceId = DEFAULT_DEVICE_ID_TOPIC; final Object deviceId = this.properties.get(CONF_DEVICE_ID_TOPIC); if (deviceId != null && deviceId instanceof String) { subscribingDeviceId = String.valueOf(deviceId); } return subscribingDeviceId; }
Source:
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { title = null; if (view instanceof WebView) { WebView.HitTestResult result = ((WebView) view).getHitTestResult(); String foo = result.getExtra(); Log.d("foo", foo); if (result.getType() == WebView.HitTestResult.SRC_ANCHOR_TYPE) { Uri uri = Uri.parse(result.getExtra()); if (isValidPageLink(uri)) { title = ((WebViewContextMenuListener) contextMenuListener).getWikiSite() .titleForInternalLink(uri.getPath()); } else if (OfflineManager.hasCompilation() && isValidOfflinePageLink(uri)) { title = ((WebViewContextMenuListener) contextMenuListener).getWikiSite() .titleForInternalLink(uri.getLastPathSegment().replace(".html", "")); } } } else if (view instanceof ListView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; title = ((ListViewContextMenuListener) contextMenuListener) .getTitleForListPosition(info.position); } if (title != null && !title.isSpecial()) { hideSoftKeyboard(view); entry = new HistoryEntry(title, historySource); new MenuInflater(view.getContext()).inflate(R.menu.menu_page_long_press, menu); menu.setHeaderTitle(title.getDisplayText()); for (int i = 0; i < menu.size(); i++) { menu.getItem(i).setOnMenuItemClickListener(this); } } }

Target:
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { title = null; if (view instanceof WebView) { WebView.HitTestResult result = ((WebView) view).getHitTestResult(); if (result.getType() == WebView.HitTestResult.SRC_ANCHOR_TYPE) { Uri uri = Uri.parse(result.getExtra()); if (isValidPageLink(uri)) { title = ((WebViewContextMenuListener) contextMenuListener).getWikiSite() .titleForInternalLink(uri.getPath()); } else if (OfflineManager.hasCompilation() && isValidOfflinePageLink(uri)) { title = ((WebViewContextMenuListener) contextMenuListener).getWikiSite() .titleForInternalLink(uri.getLastPathSegment().replace(".html", "")); } } } else if (view instanceof ListView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; title = ((ListViewContextMenuListener) contextMenuListener) .getTitleForListPosition(info.position); } if (title != null && !title.isSpecial()) { hideSoftKeyboard(view); entry = new HistoryEntry(title, historySource); new MenuInflater(view.getContext()).inflate(R.menu.menu_page_long_press, menu); menu.setHeaderTitle(title.getDisplayText()); for (int i = 0; i < menu.size(); i++) { menu.getItem(i).setOnMenuItemClickListener(this); } } }
Source:
private CompletionStage<Void> doNotifyCreated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) { if (clusteringDependentLogic.running().commitType(command, ctx, extractSegment(command, key), false).isLocal() && (command == null || !command.hasAnyFlag(FlagBitSets.PUT_FOR_STATE_TRANSFER))) { EventImpl<K, V> e = EventImpl.createEvent(cache.wired(), CACHE_ENTRY_CREATED); boolean isLocalNodePrimaryOwner = isLocalNodePrimaryOwner(key); Object eventIdentifier = ctx.isInTxScope() ? null : Thread.currentThread(); try { AggregateCompletionStage<Void> aggregateCompletionStage = null; for (CacheEntryListenerInvocation<K, V> listener : cacheEntryCreatedListeners) { configureEvent(listener, e, key, value, metadata, pre, ctx, command, null, null); aggregateCompletionStage = composeStageIfNeeded(aggregateCompletionStage, listener.invoke(new EventWrapper<>(key, e), isLocalNodePrimaryOwner)); } if (eventIdentifier != null) { return sendEvents(eventIdentifier, aggregateCompletionStage); } else if (aggregateCompletionStage != null) { return aggregateCompletionStage.freeze(); } } finally { if (eventIdentifier != null) { eventManager.dropEvents(eventIdentifier); } } } return CompletableFutures.completedNull(); }

Target:
private CompletionStage<Void> doNotifyCreated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) { if (clusteringDependentLogic.running().commitType(command, ctx, extractSegment(command, key), false).isLocal() && (command == null || !command.hasAnyFlag(FlagBitSets.PUT_FOR_STATE_TRANSFER))) { EventImpl<K, V> e = EventImpl.createEvent(cache.wired(), CACHE_ENTRY_CREATED); boolean isLocalNodePrimaryOwner = isLocalNodePrimaryOwner(key); Object batchIdentifier = ctx.isInTxScope() ? null : Thread.currentThread(); try { AggregateCompletionStage<Void> aggregateCompletionStage = null; for (CacheEntryListenerInvocation<K, V> listener : cacheEntryCreatedListeners) { configureEvent(listener, e, key, value, metadata, pre, ctx, command, null, null); aggregateCompletionStage = composeStageIfNeeded(aggregateCompletionStage, listener.invoke(new EventWrapper<>(key, e), isLocalNodePrimaryOwner)); } if (batchIdentifier != null) { return sendEvents(batchIdentifier, aggregateCompletionStage); } else if (aggregateCompletionStage != null) { return aggregateCompletionStage.freeze(); } } finally { if (batchIdentifier != null) { eventManager.dropEvents(batchIdentifier); } } } return CompletableFutures.completedNull(); }
Source:
MultiThreadedClientServiceCache(MultiThreadedServiceFactory<S> serviceFactory, ScheduledExecutorService executor, int evictionDelayInSeconds, int cleanUpDelayInSeconds, MetricRegistry metricRegistry) { checkNotNull(serviceFactory); checkNotNull(metricRegistry); checkArgument(evictionDelayInSeconds >= 0); checkArgument(cleanUpDelayInSeconds >= 0); _serviceFactory = serviceFactory; _cleanupExecutor = executor; _evictionDelayInSeconds = evictionDelayInSeconds; _isClosed = false; _metrics = Metrics.forInstance(metricRegistry, this, serviceFactory.getServiceName()); _registerTimer = _metrics.timer("register-time"); _evictionTimer = _metrics.timer("eviction-time"); _serviceCounter = _metrics.counter("service-counter"); _cleanupFuture = _cleanupExecutor.scheduleAtFixedRate( new Runnable() { @Override public void run() { List<HeavyServiceHandle<S>> handlesToDelete = new LinkedList<>(); synchronized (MultiThreadedClientServiceCache.this) { Map<ServiceEndPoint, HeavyServiceHandle<S>> sourceCopy = Maps.newHashMap(_instancesPerEndpoint); for (Map.Entry<ServiceEndPoint, HeavyServiceHandle<S>> entry : _instancesPerEndpoint.entrySet()) { HeavyServiceHandle handle = entry.getValue(); if ( handle.timeToEvict() ) { handlesToDelete.add( sourceCopy.remove( handle.getEndPoint() ) ); } } _instancesPerEndpoint = sourceCopy; } for ( HeavyServiceHandle<S> handle : handlesToDelete ) { destroyService(handle); } _serviceCounter.dec(handlesToDelete.size()); } }, (cleanUpDelayInSeconds * 1000) + 1, (cleanUpDelayInSeconds * 1000) + 1, TimeUnit.MILLISECONDS); }

Target:
MultiThreadedClientServiceCache(MultiThreadedServiceFactory<S> serviceFactory, ScheduledExecutorService executor, int evictionDelayInSeconds, int cleanUpDelayInSeconds, MetricRegistry metricRegistry) { checkNotNull(serviceFactory); checkNotNull(metricRegistry); checkArgument(evictionDelayInSeconds >= 0); checkArgument(cleanUpDelayInSeconds >= 0); _serviceFactory = serviceFactory; _cleanupExecutor = executor; _evictionDelayInMilliSeconds = SECONDS.toMillis(evictionDelayInSeconds); _isClosed = false; _metrics = Metrics.forInstance(metricRegistry, this, serviceFactory.getServiceName()); _registerTimer = _metrics.timer("register-time"); _evictionTimer = _metrics.timer("eviction-time"); _serviceCounter = _metrics.counter("service-counter"); _cleanupFuture = _cleanupExecutor.scheduleAtFixedRate( new Runnable() { @Override public void run() { List<HeavyServiceHandle<S>> handlesToDelete = new LinkedList<>(); synchronized (MultiThreadedClientServiceCache.this) { Map<ServiceEndPoint, HeavyServiceHandle<S>> sourceCopy = Maps.newHashMap(_instancesPerEndpoint); for (HeavyServiceHandle<S> handle : _instancesPerEndpoint.values()) { if (handle.timeToEvict()) { handlesToDelete.add(sourceCopy.remove(handle.getEndPoint())); } } _instancesPerEndpoint = sourceCopy; } for (HeavyServiceHandle<S> handle : handlesToDelete) { destroyService(handle); } _serviceCounter.dec(handlesToDelete.size()); } }, SECONDS.toMillis(cleanUpDelayInSeconds) + 1, SECONDS.toMillis(cleanUpDelayInSeconds) + 1, TimeUnit.MILLISECONDS); }
Source:
public void testRemoveCache() { ConfigurationBuilder cb = TestCacheManagerFactory.getDefaultCacheConfiguration(false); createCacheStoreConfig(cb.persistence(), true); EmbeddedCacheManager local = TestCacheManagerFactory.createCacheManager(cb); try { final String cacheName = "to-be-removed"; Cache<Integer, String> cache = local.getCache(cacheName); assertTrue(local.isRunning(cacheName)); cache.put(1, "v1"); assertEquals("v1", cache.get(1)); local.removeCache(cacheName); assertFalse(local.isRunning(cacheName)); } finally { TestingUtil.killCacheManagers(local); } }

Target:
public void testRemoveCache() { ConfigurationBuilder cb = TestCacheManagerFactory.getDefaultCacheConfiguration(false); createCacheStoreConfig(cb.persistence(), true); EmbeddedCacheManager local = TestCacheManagerFactory.createCacheManager(cb); try { final String cacheName = "to-be-removed"; Cache<String, Object> cache = local.getCache(cacheName); assertTrue(local.isRunning(cacheName)); cache.put("1", wrap("1", "v1")); assertCacheEntry(cache, "1", "v1", -1, -1); local.removeCache(cacheName); assertFalse(local.isRunning(cacheName)); } finally { TestingUtil.killCacheManagers(local); } }
Source:
public ModelAndView setupForm(@PathVariable Long poolId, ModelMap model) throws IOException { Pool pool = null; if (poolId == PoolImpl.UNSAVED_ID) { pool = new PoolImpl(); model.put("title", "New Pool"); } else { pool = poolService.get(poolId); model.put("title", "Pool " + poolId); } if (pool == null) throw new NotFoundException("No pool found for ID " + poolId.toString()); PoolDto poolDto = Dtos.asDto(pool, true, false, errorEditDistance, warningEditDistance); ObjectMapper mapper = new ObjectMapper(); model.put("pool", pool); model.put("poolDto", poolId == PoolImpl.UNSAVED_ID ? "{}" : mapper.writeValueAsString(poolDto)); model.put("partitions", containerService.listPartitionsByPoolId(poolId).stream() .map(partition -> Dtos.asDto(partition, errorEditDistance, warningEditDistance)).collect(Collectors.toList())); model.put("runs", poolId == PoolImpl.UNSAVED_ID ? Collections.emptyList() : Dtos.asRunDtos(runService.listByPoolId(poolId))); model.put("orders", poolId == PoolImpl.UNSAVED_ID ? Collections.emptyList() : Dtos.asSequencingOrderDtos(sequencingOrderService.getByPool(pool), errorEditDistance, warningEditDistance)); model.put("duplicateIndicesSequences", mapper.writeValueAsString(poolDto.getDuplicateIndicesSequences())); model.put("nearDuplicateIndicesSequences", mapper.writeValueAsString(poolDto.getNearDuplicateIndicesSequences())); model.put("includedLibraryAliquots", Dtos.asDto(pool, true, false, errorEditDistance, warningEditDistance).getPooledElements()); return new ModelAndView("/WEB-INF/pages/editPool.jsp", model); }

Target:
public ModelAndView setupForm(@PathVariable Long poolId, ModelMap model) throws IOException { Pool pool = null; if (poolId == PoolImpl.UNSAVED_ID) { pool = new PoolImpl(); model.put("title", "New Pool"); } else { pool = poolService.get(poolId); model.put("title", "Pool " + poolId); } if (pool == null) throw new NotFoundException("No pool found for ID " + poolId.toString()); PoolDto poolDto = Dtos.asDto(pool, true, false, indexChecker); ObjectMapper mapper = new ObjectMapper(); model.put("pool", pool); model.put("poolDto", poolId == PoolImpl.UNSAVED_ID ? "{}" : mapper.writeValueAsString(poolDto)); Collection<Partition> partitions = containerService.listPartitionsByPoolId(poolId); model.put("partitions", partitions.stream() .map(partition -> Dtos.asDto(partition, indexChecker)).collect(Collectors.toList())); model.put("runs", poolId == PoolImpl.UNSAVED_ID ? Collections.emptyList() : Dtos.asRunDtos(runService.listByPoolId(poolId))); if (poolId == PoolImpl.UNSAVED_ID) { model.put("orders", Collections.emptyList()); } else { Collection<SequencingOrder> sequencingOrders = sequencingOrderService.getByPool(pool); model.put("orders", Dtos.asSequencingOrderDtos(sequencingOrders, indexChecker)); } model.put("duplicateIndicesSequences", mapper.writeValueAsString(poolDto.getDuplicateIndicesSequences())); model.put("nearDuplicateIndicesSequences", mapper.writeValueAsString(poolDto.getNearDuplicateIndicesSequences())); model.put("includedLibraryAliquots", Dtos.asDto(pool, true, false, indexChecker).getPooledElements()); return new ModelAndView("/WEB-INF/pages/editPool.jsp", model); }
Source:
public boolean isSubtypeOfBound(JavaType type) { switch (boundType) { case SUPER: if(bound.isTagged(TYPEVAR) && !type.isTagged(TYPEVAR) && bound != type) { return false; } return bound.isSubtypeOf(type); case EXTENDS: if(bound.isTagged(TYPEVAR) && !type.isTagged(TYPEVAR) && bound != type) { return false; } return type.isSubtypeOf(bound); case UNBOUNDED: default: return true; } }

Target:
public boolean isSubtypeOfBound(JavaType type) { switch (boundType) { case SUPER: return !boundIsTypeVarAndNotType(type) && bound.isSubtypeOf(type); case EXTENDS: return !boundIsTypeVarAndNotType(type) && type.isSubtypeOf(bound); case UNBOUNDED: default: return true; } }
Source:
protected void map(FilesFacade ff, LPSZ name, long size) { this.size = size; if (size > 0) { this.page = ff.mmap(fd, size, 0, Files.MAP_RO); if (page == FilesFacade.MAP_FAILED) { close(); throw CairoException.instance(ff.errno()).put("Cannot mmap ").put(name).put(" [size=").put(size).put(", fd=").put(fd).put(']'); } this.absolutePointer = page; } else { this.page = -1; this.absolutePointer = -1; } LOG.info().$("open ").$(name).$(" [fd=").$(fd).$(", pageSize=").$(size).$(", size=").$(this.size).$(']').$(); }

Target:
protected void map(FilesFacade ff, LPSZ name, long size) { this.size = size; if (size > 0) { this.page = ff.mmap(fd, size, 0, Files.MAP_RO); if (page == FilesFacade.MAP_FAILED) { close(); throw CairoException.instance(ff.errno()).put("Could not mmap ").put(name).put(" [size=").put(size).put(", fd=").put(fd).put(']'); } this.absolutePointer = page; } else { this.page = -1; this.absolutePointer = -1; } LOG.info().$("open ").$(name).$(" [fd=").$(fd).$(", pageSize=").$(size).$(", size=").$(this.size).$(']').$(); }
Source:
public JPACommit getEndCommit() { return commitB; }

Target:
public JPACommit getEndCommit() { return endCommit; }
Source:
public void initMapGenRTG(InitMapGenEvent event) { Logger.debug("event type = %s", event.getType().toString()); Logger.debug("event originalGen = %s", event.getOriginalGen().toString()); if (event.getType() == InitMapGenEvent.EventType.SCATTERED_FEATURE) { event.setNewGen(new MapGenScatteredFeatureRTG()); } else if (event.getType() == InitMapGenEvent.EventType.VILLAGE) { if (Mods.RTG.config.ENABLE_VILLAGE_MODIFICATIONS.get()) { event.setNewGen(new MapGenVillageRTG()); } } else if (event.getType() == InitMapGenEvent.EventType.CAVE) { if (Mods.RTG.config.ENABLE_CAVE_MODIFICATIONS.get()) { event.setNewGen(new MapGenCavesRTG()); } } else if (event.getType() == InitMapGenEvent.EventType.RAVINE) { if (Mods.RTG.config.ENABLE_RAVINE_MODIFICATIONS.get()) { event.setNewGen(new MapGenRavineRTG()); } } else if (event.getType() == InitMapGenEvent.EventType.OCEAN_MONUMENT) { event.setNewGen(new StructureOceanMonumentRTG()); } Logger.debug("event newGen = %s", event.getNewGen().toString()); }

Target:
public void initMapGenRTG(InitMapGenEvent event) { Logger.debug("event type = %s", event.getType().toString()); Logger.debug("event originalGen = %s", event.getOriginalGen().toString()); switch (event.getType()) { case SCATTERED_FEATURE: event.setNewGen(new MapGenScatteredFeatureRTG()); break; case VILLAGE: if (Mods.RTG.config.ENABLE_VILLAGE_MODIFICATIONS.get()) { event.setNewGen(new MapGenVillageRTG()); } break; case CAVE: if (Mods.RTG.config.ENABLE_CAVE_MODIFICATIONS.get()) { event.setNewGen(new MapGenCavesRTG()); } break; case RAVINE: if (Mods.RTG.config.ENABLE_RAVINE_MODIFICATIONS.get()) { event.setNewGen(new MapGenRavineRTG()); } break; case OCEAN_MONUMENT: event.setNewGen(new StructureOceanMonumentRTG()); break; default: break; } Logger.debug("event newGen = %s", event.getNewGen().toString()); }
Source:
private FormItem createUploadItemDisabled(PluginDescriptor plugin, PluginDescriptor.Field pluginField) { FormItem chooseCredentialsFormItem; chooseCredentialsFormItem = new UploadItem(plugin.getPluginName() + pluginField.getName(), ""); chooseCredentialsFormItem.disable(); return chooseCredentialsFormItem; }

Target:
private FormItem createUploadItemDisabled(PluginDescriptor plugin, PluginDescriptor.Field pluginField) { FormItem chooseCredentialsFormItem = new UploadItem(plugin.getPluginName() + pluginField.getName(), ""); chooseCredentialsFormItem.disable(); return chooseCredentialsFormItem; }
Source:
@Override public MultiEnvironment bind(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { SSHUserPrivateKey sshKey = getCredentials(build); FilePath keyFile = tempDir(workspace).child("ssh-key-" + keyFileVariable); StringWriter stringWriter = new StringWriter(); PrintWriter keysFileStream = new PrintWriter(stringWriter); for (String key : sshKey.getPrivateKeys()) { keysFileStream.println(key); } keysFileStream.close(); keyFile.write(stringWriter.toString(), "UTF-8"); keyFile.chmod(0400); Map<String, String> map = new HashMap<String, String>(); map.put(keyFileVariable, keyFile.getRemote()); Secret passphrase = sshKey.getPassphrase(); if (passphrase != null) { map.put(passphraseVariable, passphrase.getPlainText()); } else { map.put(passphraseVariable, ""); } map.put(usernameVariable, sshKey.getUsername()); return new MultiEnvironment(map, new KeyRemover(keyFile.getRemote())); }

Target:
@Override public MultiEnvironment bind(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { SSHUserPrivateKey sshKey = getCredentials(build); UnbindableDir keyDir = UnbindableDir.create(workspace); FilePath keyFile = keyDir.getDirPath().child("ssh-key-" + keyFileVariable); StringBuilder contents = new StringBuilder(); for (String key : sshKey.getPrivateKeys()) { contents.append(key); contents.append('\n'); } keyFile.write(contents.toString(), "UTF-8"); keyFile.chmod(0400); Map<String, String> map = new HashMap<String, String>(); map.put(keyFileVariable, keyFile.getRemote()); if (passphraseVariable != null) { Secret passphrase = sshKey.getPassphrase(); if (passphrase != null) { map.put(passphraseVariable, passphrase.getPlainText()); } else { map.put(passphraseVariable, ""); } } if (usernameVariable != null) { map.put(usernameVariable, sshKey.getUsername()); } return new MultiEnvironment(map, keyDir.getUnbinder()); }
Source:
public void writeTo(StreamOutput out) throws IOException { out.writeString(baseTypeName); out.writeVInt(parameters.size()); for (TypeSignature parameter : parameters) { out.writeVInt(parameter.type().ordinal()); parameter.writeTo(out); } }

Target:
public void writeTo(StreamOutput out) throws IOException { out.writeString(baseTypeName); out.writeVInt(parameters.size()); for (TypeSignature parameter : parameters) { toStream(parameter, out); } }
Source:
public ProcessDefinition processDefinition(String processDefinitionId) { org.activiti.engine.repository.ProcessDefinition processDefinition = null; try { processDefinition = repositoryService.getProcessDefinition(processDefinitionId); } catch (Exception internalEx) { } if (processDefinition == null) { List<org.activiti.engine.repository.ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().processDefinitionKey(processDefinitionId).list(); if (!list.isEmpty()) { processDefinition = list.get(0); } else { throw new NotFoundException("Unable to find process definition for the given key:'" + processDefinitionId + "'"); } } return processDefinitionConverter.from(processDefinition); }

Target:
public ProcessDefinition processDefinition(String processDefinitionId) { org.activiti.engine.repository.ProcessDefinition processDefinition; List<org.activiti.engine.repository.ProcessDefinition> list = repositoryService .createProcessDefinitionQuery() .processDefinitionKey(processDefinitionId) .orderByProcessDefinitionVersion() .asc() .list(); if (!list.isEmpty()) { processDefinition = list.get(0); } else { processDefinition = repositoryService.getProcessDefinition(processDefinitionId); } return processDefinitionConverter.from(processDefinition); }