auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Builder fromContainer(Container in) { return this.id(in.id()).name(in.name()).created(in.created()).path(in.path()).args(in.args()) .config(in.config()).state(in.state()).image(in.image()).networkSettings(in.networkSettings()) .sysInitPath(in.sysInitPath()).resolvConfPath(in.resolvConfPath()).driver(in.driver()) .execDriver(in.execDriver()).volumes(in.volumes()).hostConfig(in.hostConfig()).volumesRW(in.volumesRW()) .command(in.command()).status(in.status()).ports(in.ports()).hostnamePath(in.hostnamePath()) .hostsPath(in.hostsPath()).mountLabel(in.mountLabel()).processLabel(in.processLabel()).node(in.node().get()); }

Target:
public Builder fromContainer(Container in) { return this.id(in.id()).name(in.name()).created(in.created()).path(in.path()).args(in.args()) .config(in.config()).state(in.state()).image(in.image()).networkSettings(in.networkSettings()) .sysInitPath(in.sysInitPath()).resolvConfPath(in.resolvConfPath()).driver(in.driver()) .execDriver(in.execDriver()).volumes(in.volumes()).hostConfig(in.hostConfig()).volumesRW(in.volumesRW()) .command(in.command()).status(in.status()).ports(in.ports()).hostnamePath(in.hostnamePath()) .hostsPath(in.hostsPath()).mountLabel(in.mountLabel()).processLabel(in.processLabel()).node(in.node().orNull()); }
Source:
public void onError(CommandEnvelope envelope, RuntimeException exception) { checkNotNull(envelope); checkNotNull(exception); if (causedByRejection(exception)) { final Rejection rejection = Commands.reject(envelope.getCommand(), exception); getBoundedContext().getRejectionBus() .post(rejection); } else { logError("Error dispatching command (class: %s id: %s).", envelope, exception); throw exception; } }

Target:
public void onError(CommandEnvelope envelope, RuntimeException exception) { commandErrorHandler.handleError(envelope, exception); }
Source:
public void iCanBulkDownloadASingleFile() throws IOException, OperationException, InterruptedException { System.setProperty(RandomBug.MODE_PROPERTY, RandomBug.Mode.STRICT.toString()); testWithNbFiles(1); }

Target:
public void iCanBulkDownloadASingleFile() throws IOException, OperationException, InterruptedException { testWithNbFiles(1); }
Source:
public void closeCloseCurrentConnection() throws SQLException { synchronized (this) { if (_theConnection != null) { _theConnection.close(); _theConnection = null; _theXAResource = null; _theTransaction = null; } } }

Target:
public void closeCloseCurrentConnection() throws SQLException { synchronized (this) { if (_theConnection != null) { _theConnection.close(); _theConnection = null; reset(); } } }
Source:
public void testCheckpointingWithDelayedAssignment() throws Exception { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); env.setRestartStrategy(new RestartStrategies.NoRestartStrategyConfiguration()); env.enableCheckpointing(50, CheckpointingMode.EXACTLY_ONCE); final SingleOutputStreamOperator<Long> stream = env .fromSequence(0, 100) .map(x -> { Thread.sleep(10); return x; }); final CompletableFuture<Collection<Long>> result = collector.collect(stream); env.execute(); assertArrayEquals(LongStream.rangeClosed(0, 100).boxed().toArray(), result.get().toArray()); }

Target:
public void testCheckpointingWithDelayedAssignment() throws Exception { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); env.setRestartStrategy(new RestartStrategies.NoRestartStrategyConfiguration()); env.enableCheckpointing(10, CheckpointingMode.EXACTLY_ONCE); final SingleOutputStreamOperator<Long> stream = env .fromSequence(0, 100) .map(x -> { Thread.sleep(10); return x; }); final CompletableFuture<Collection<Long>> result = collector.collect(stream); env.execute(); assertArrayEquals(LongStream.rangeClosed(0, 100).boxed().toArray(), result.get().toArray()); }
Source:
public int processLineContent(String line, int offset) { if (blockLineCount == 0) { String idprefix = getAsciiDocState().getAttribute(AsciiDocContentState.ATTRIBUTE_IDPREFIX); String idseparator = getAsciiDocState().getAttribute(AsciiDocContentState.ATTRIBUTE_IDSEPARATOR); String headingId = LanguageSupport.computeHeadingId(line, idprefix, idseparator); HeadingAttributes attributes = new HeadingAttributes(); attributes.setId(headingId); builder.beginHeading(level, attributes); builder.characters(line.trim()); } else { builder.endHeading(); setClosed(true); } blockLineCount++; return -1; }

Target:
public int processLineContent(String line, int offset) { if (blockLineCount == 0) { HeadingAttributes attributes = new HeadingAttributes(); attributes.setId(state.getIdGenerator().newId(null, line)); builder.beginHeading(level, attributes); builder.characters(line.trim()); } else { builder.endHeading(); setClosed(true); } blockLineCount++; return -1; }
Source:
private static char[][] internSimpleNames(char[][] simpleNames, boolean removeWellKnown, boolean doSort) { if (simpleNames == null) return EmptySimpleNames; int length = simpleNames.length; if (length == 0) return EmptySimpleNames; char[][] keepers = new char[length][]; char[] prev = null; boolean isSorted = true; int index = 0; next : for (int i = 0; i < length; i++) { char[] name = simpleNames[i]; int sLength = name.length; for (int j = 0, m = WellKnownSimpleNames.length; j < m; j++) { char[] wellKnownName = WellKnownSimpleNames[j]; if (sLength > wellKnownName.length) break; if (CharOperation.equals(name, wellKnownName)) { if (!removeWellKnown) { keepers[index++] = wellKnownName; if (doSort && isSorted) { if (prev == null) { prev = name; } else { if (compareCharArray(prev, name) > 0) { isSorted = false; } } prev = name; } } continue next; } } NameSet internedNames = InternedSimpleNames[sLength < MaxSimpleNames ? sLength : 0]; keepers[index++] = internedNames.add(name); if (doSort && isSorted) { if (prev == null) { prev = name; } else { if (compareCharArray(prev, name) > 0) { isSorted = false; } } prev = name; } } if (length > index) { if (index == 0) return EmptySimpleNames; System.arraycopy(keepers, 0, keepers = new char[index][], 0, index); } if (doSort && !isSorted) { Arrays.sort(keepers, CHAR_ARR_COMPARATOR); } return keepers; }

Target:
private static char[][] internSimpleNames(char[][] simpleNames, boolean removeWellKnown, boolean doSort) { if (simpleNames == null) return EmptySimpleNames; int length = simpleNames.length; if (length == 0) return EmptySimpleNames; char[][] keepers = new char[length][]; char[] prev = null; boolean isSorted = true; int index = 0; next : for (int i = 0; i < length; i++) { char[] name = simpleNames[i]; int sLength = name.length; for (int j = 0, m = WellKnownSimpleNames.length; j < m; j++) { char[] wellKnownName = WellKnownSimpleNames[j]; if (sLength > wellKnownName.length) break; if (CharOperation.equals(name, wellKnownName)) { if (!removeWellKnown) { keepers[index++] = wellKnownName; if (doSort && isSorted) { if (prev != null && compareCharArray(prev, name) > 0) { isSorted = false; } prev = name; } } continue next; } } NameSet internedNames = InternedSimpleNames[sLength < MaxSimpleNames ? sLength : 0]; keepers[index++] = internedNames.add(name); if (doSort && isSorted) { if (prev != null && compareCharArray(prev, name) > 0) { isSorted = false; } prev = name; } } if (length > index) { if (index == 0) return EmptySimpleNames; System.arraycopy(keepers, 0, keepers = new char[index][], 0, index); } if (doSort && !isSorted) { Arrays.sort(keepers, CHAR_ARR_COMPARATOR); } return keepers; }
Source:
public static List<String> getNotableTagDisplayNames() { List<String> tagDisplayNames = new ArrayList<>(); for (TagNameDefinition tagDef : TagNameDefinition.getTagNameDefinitions()) { if (tagDef.getKnownStatus() == TskData.FileKnown.BAD) { tagDisplayNames.add(tagDef.getDisplayName()); } } try { TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); for (TagName tagName : tagsManager.getAllTagNames()) { if(tagName.getKnownStatus() == TskData.FileKnown.BAD && !tagDisplayNames.contains(tagName.getDisplayName())) { tagDisplayNames.add(tagName.getDisplayName()); } } } catch (NoCurrentCaseException ignored) { } catch(TskCoreException ex) { LOGGER.log(Level.SEVERE, "Faile to get list of TagNams from tagsManager."); } return tagDisplayNames; }

Target:
public static List<String> getNotableTagDisplayNames() { List<String> tagDisplayNames = new ArrayList<>(); for (TagNameDefinition tagDef : TagNameDefinition.getTagNameDefinitions()) { if (tagDef.getKnownStatus() == TskData.FileKnown.BAD) { tagDisplayNames.add(tagDef.getDisplayName()); } } try { TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); for (TagName tagName : tagsManager.getAllTagNames()) { if(tagName.getKnownStatus() == TskData.FileKnown.BAD && !tagDisplayNames.contains(tagName.getDisplayName())) { tagDisplayNames.add(tagName.getDisplayName()); } } } catch (NoCurrentCaseException ignored) { } catch(TskCoreException ex) { LOGGER.log(Level.SEVERE, "Failed to get list of TagNames from TagsManager.", ex); } return tagDisplayNames; }
Source:
static void parseCoreEnvironmentElement(final XMLExtendedStreamReader reader, final ModelNode operation) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case NODE_IDENTIFIER: TransactionSubsystemRootResourceDefinition.NODE_IDENTIFIER.parseAndSetParameter(value, operation, reader); break; case PATH: case RELATIVE_TO: throw new XMLStreamException("the attribute '" + attribute.getLocalName() + "' is no longer supported", reader.getLocation()); default: throw unexpectedAttribute(reader, i); } } final EnumSet<Element> required = EnumSet.of(Element.PROCESS_ID); final EnumSet<Element> encountered = EnumSet.noneOf(Element.class); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { final Element element = Element.forName(reader.getLocalName()); required.remove(element); switch (element) { case PROCESS_ID: { if (!encountered.add(element)) { throw duplicateNamedElement(reader, reader.getLocalName()); } parseProcessIdEnvironmentElement(reader, operation); break; } default: throw unexpectedElement(reader); } } if (!required.isEmpty()) { throw missingRequiredElement(reader, required); } }

Target:
static void parseCoreEnvironmentElement(final XMLExtendedStreamReader reader, final ModelNode operation) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case NODE_IDENTIFIER: TransactionSubsystemRootResourceDefinition.NODE_IDENTIFIER.parseAndSetParameter(value, operation, reader); break; case PATH: case RELATIVE_TO: throw TransactionLogger.ROOT_LOGGER.unsupportedAttribute(attribute.getLocalName(), reader.getLocation()); default: throw unexpectedAttribute(reader, i); } } final EnumSet<Element> required = EnumSet.of(Element.PROCESS_ID); final EnumSet<Element> encountered = EnumSet.noneOf(Element.class); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { final Element element = Element.forName(reader.getLocalName()); required.remove(element); switch (element) { case PROCESS_ID: { if (!encountered.add(element)) { throw duplicateNamedElement(reader, reader.getLocalName()); } parseProcessIdEnvironmentElement(reader, operation); break; } default: throw unexpectedElement(reader); } } if (!required.isEmpty()) { throw missingRequiredElement(reader, required); } }
Source:
protected String getValueOutOfPaymentWorksCustomFieldDTO(PaymentWorksCustomFieldDTO dto, PaymentWorksFieldMapping fieldMapping) { if (StringUtils.equalsIgnoreCase(fieldMapping.getCustomAttributeValueToUse(), PaymentWorksConstants.CustomAttributeValueToUse.FILE)) { return dto.getFile(); } else if (StringUtils.equalsIgnoreCase(fieldMapping.getCustomAttributeValueToUse(), PaymentWorksConstants.CustomAttributeValueToUse.FIELD_VALUE)) { return dto.getField_value(); } else { throw new IllegalArgumentException("The custom attrbute value to use is not value: " + fieldMapping.getCustomAttributeValueToUse()); } }

Target:
protected String getValueOutOfPaymentWorksCustomFieldDTO(PaymentWorksCustomFieldDTO dto, PaymentWorksFieldMapping fieldMapping) { if (StringUtils.equalsIgnoreCase(fieldMapping.getCustomAttributeValueToUse(), PaymentWorksConstants.CustomAttributeValueToUse.FILE)) { return dto.getFile(); } else if (StringUtils.equalsIgnoreCase(fieldMapping.getCustomAttributeValueToUse(), PaymentWorksConstants.CustomAttributeValueToUse.FIELD_VALUE)) { return dto.getField_value(); } else { throw new IllegalArgumentException("The custom attrbute value to use is not valid: " + fieldMapping.getCustomAttributeValueToUse()); } }
Source:
public Channel retrieve(VeluxBridge bridge) { logger.trace("retrieve() called."); GetFirmware bcp = bridge.bridgeAPI().getFirmware(); if ((bridge.bridgeCommunicate(bcp)) && (bcp.isCommunicationSuccessful())) { this.channel.firmwareVersion = new StringType(bcp.getFirmware().toString()); this.channel.isRetrieved = true; logger.trace("retrieve() found successfully firmware {}.", this.channel.firmwareVersion); return channel; } logger.trace("retrieve() finished with failure."); return null; }

Target:
public Channel retrieve(VeluxBridge bridge) { logger.trace("retrieve() called."); GetFirmware bcp = bridge.bridgeAPI().getFirmware(); if (bridge.bridgeCommunicate(bcp) && bcp.isCommunicationSuccessful()) { this.channel.firmwareVersion = new StringType(bcp.getFirmware().toString()); this.channel.isRetrieved = true; logger.trace("retrieve() found successfully firmware {}.", this.channel.firmwareVersion); return channel; } logger.trace("retrieve() finished with failure."); return null; }
Source:
public void deliverMessagesFrom(ShardIndex index) { NodeId currentNode = ServerEnvironment.instance() .nodeId(); Optional<ShardProcessingSession> picked = workRegistry.pickUp(index, currentNode); if (!picked.isPresent()) { return; } ShardProcessingSession session = picked.get(); try { Integer deliveredMsgCount = null; while (deliveredMsgCount == null || deliveredMsgCount > 0) { deliveredMsgCount = doDeliver(session); } } finally { session.complete(); } }

Target:
public void deliverMessagesFrom(ShardIndex index) { NodeId currentNode = ServerEnvironment.instance() .nodeId(); Optional<ShardProcessingSession> picked = workRegistry.pickUp(index, currentNode); if (!picked.isPresent()) { return; } ShardProcessingSession session = picked.get(); try { int deliveredMsgCount; do { deliveredMsgCount = doDeliver(session); } while (deliveredMsgCount > 0); } finally { session.complete(); } }
Source:
public void execute() { final Setting setting = getActionContext().getSetting(); final EObject eObject = setting.getEObject(); final EStructuralFeature eStructuralFeature = setting.getEStructuralFeature(); final EObject toDuplicate = (EObject) ((IStructuredSelection) getTableViewer().getSelection()) .getFirstElement(); final EObject copy = copyElement( eObject, eStructuralFeature, getEditingDomainForContainment(), toDuplicate); getTableViewer().setSelection(new StructuredSelection(copy), true); }

Target:
public void execute() { final Setting setting = getActionContext().getSetting(); final EObject eObject = setting.getEObject(); final EStructuralFeature eStructuralFeature = setting.getEStructuralFeature(); @SuppressWarnings("unchecked") final List<EObject> toDuplicate = ((IStructuredSelection) getTableViewer().getSelection()).toList(); final Collection<EObject> copies = copyElements( eObject, eStructuralFeature, getEditingDomainForContainment(), toDuplicate); getTableViewer().setSelection(new StructuredSelection(copies.iterator().next()), true); }
Source:
@Nullable public String getClientSecret() { for (FormGroup formGroup : form) { for (FormField formField : formGroup.getFields()) { if (formField.getId().equals("clientSecret")) { return formField.getValue().toString(); } } } return null; }

Target:
@Nullable public String getClientSecret() { return getValueFromField(FormField.CLIENT_SECRET); }
Source:
private void parseZkJsonAndPopulateZkInfo(String zkLayoutPath) throws IOException, JSONException { JSONObject root = new JSONObject(Utils.readStringFromFile(zkLayoutPath)); JSONArray all = (root).getJSONArray("zkHosts"); for (int i = 0; i < all.length(); i++) { JSONObject entry = all.getJSONObject(i); dataCenterToZkAddress.put(entry.getString("datacenter"), entry.getString("hostname") + ":" + entry.getString("port")); } }

Target:
private void parseZkJsonAndPopulateZkInfo(String zkLayoutPath) throws IOException, JSONException { JSONObject root = new JSONObject(Utils.readStringFromFile(zkLayoutPath)); JSONArray all = (root).getJSONArray(ZKINFO_STR); for (int i = 0; i < all.length(); i++) { JSONObject entry = all.getJSONObject(i); dataCenterToZkAddress.put(entry.getString(DATACENTER_STR), entry.getString(ZKCONNECTSTR_STR)); } }
Source:
public void openStreamTest() throws IOException { final String path = "path"; CloudFilesObjectApiProxy objectApi = createMock(CloudFilesObjectApiProxy.class); CloudFilesObject cloudFilesObject = createMock(CloudFilesObject.class); Payload payload = createMock(Payload.class); InputStream stream = createMock(InputStream.class); expect(objectApi.get(path)).andReturn(cloudFilesObject); expect(cloudFilesObject.getPayload()).andReturn(payload); expect(payload.openStream()).andReturn(stream); replayAll(); CloudFilesByteSource byteSource = new CloudFilesByteSource(objectApi, path); byteSource.openStream(); verifyAll(); }

Target:
public void openStreamTest() throws IOException { final String path = "path"; CloudFilesObjectApiProxy objectApi = createMock(CloudFilesObjectApiProxy.class); CloudFilesObject cloudFilesObject = createMock(CloudFilesObject.class); Payload payload = createMock(Payload.class); InputStream stream = createMock(InputStream.class); expect(objectApi.get(path)).andReturn(cloudFilesObject); expect(cloudFilesObject.getPayload()).andReturn(payload); expect(payload.openStream()).andReturn(stream); payload.close(); replayAll(); CloudFilesByteSource byteSource = new CloudFilesByteSource(objectApi, path); assertEquals(stream, byteSource.openStream()); byteSource.closeStream(); verifyAll(); }
Source:
public void aboutToBeShown() { super.aboutToBeShown(); final String hint = new Eval(interpreter, variableManager).get(description.getHintExpression(), String.class); this.modifyListener = new ModifyListener() { @Override public void modifyText(ModifyEvent event) { if (!EEFTextLifecycleManager.this.container.isRenderingInProgress() && !text.getText().equals(hint)) { if (text.getText().equals(hint)) { text.setText(""); } if (!"".equals(text.getText())) { text.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); } controller.updateValue(text.getText()); } } }; this.text.addModifyListener(this.modifyListener); this.text.addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent e) { text.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); if (text.getText().length() == 0 && hint != null) { text.setText(hint); text.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); } } @Override public void focusGained(FocusEvent e) { if (text.getText().equals(hint)) { text.setText(""); } } }); this.controller.onNewValue(new IConsumer<String>() { @Override public void apply(String value) { if (!text.isDisposed()) { if (((value == null || value.length() == 0) && !text.isFocusControl()) && hint != null) { text.setText(hint); text.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); } else if (!(text.getText() != null && (text.getText().equals(value)))) { text.setText(Objects.firstNonNull(value, "")); } setStyle(); if (!text.isEnabled()) { text.setEnabled(true); } } } }); }

Target:
public void aboutToBeShown() { super.aboutToBeShown(); final String hint = new Eval(interpreter, variableManager).get(description.getHintExpression(), String.class); this.modifyListener = new ModifyListener() { @Override public void modifyText(ModifyEvent event) { if (!EEFTextLifecycleManager.this.container.isRenderingInProgress() && !text.getText().equals(hint)) { if (!"".equals(text.getText())) { text.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); } controller.updateValue(text.getText()); } } }; this.text.addModifyListener(this.modifyListener); this.text.addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent e) { text.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); if (text.getText().length() == 0 && !Util.isBlank(hint)) { text.setText(hint); text.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); } } @Override public void focusGained(FocusEvent e) { if (text.getText().equals(hint)) { text.setText(""); } } }); this.controller.onNewValue(new IConsumer<String>() { @Override public void apply(String value) { if (!text.isDisposed()) { if ((Util.isBlank(value) && !text.isFocusControl()) && !Util.isBlank(hint)) { text.setText(hint); text.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); } else if (!(text.getText() != null && (text.getText().equals(value)))) { text.setText(Objects.firstNonNull(value, "")); } setStyle(); if (!text.isEnabled()) { text.setEnabled(true); } } } }); }
Source:
private boolean isImplementingRecursive(Class commandClass, Class interfaceClass) { if (Arrays.asList(commandClass.getInterfaces()).contains(interfaceClass)) { return true; } else { return commandClass.getSuperclass() != CommandBase.class && isImplementingRecursive(commandClass.getSuperclass(), interfaceClass); } }

Target:
private boolean isImplementingRecursive(Class commandClass, Class interfaceClass) { if (Arrays.asList(commandClass.getInterfaces()).contains(interfaceClass)) { return true; } else { return !commandClass.getSuperclass().equals(CommandBase.class) && isImplementingRecursive(commandClass.getSuperclass(), interfaceClass); } }
Source:
public void shouldThrowIfPluginThrows() { TestPlugins.assertInitialized(); assertNotNull(plugins.newPlugin( TestPlugins.ALWAYS_THROW_EXCEPTION, new AbstractConfig(new ConfigDef(), Collections.emptyMap()), Converter.class )); }

Target:
public void shouldThrowIfPluginThrows() { TestPlugins.assertAvailable(); plugins.newPlugin( TestPlugins.ALWAYS_THROW_EXCEPTION, new AbstractConfig(new ConfigDef(), Collections.emptyMap()), Converter.class ); }
Source:
public String convertMemberName(Member member) { if (Modifier.isTransient(member.getModifiers())) { return null; } if (member instanceof Field) { Field f = (Field) member; if (gson.excluder().excludeField(f, true)) { return null; } if (f.isAnnotationPresent(SerializedName.class)) { return f.getDeclaredAnnotation(SerializedName.class).value(); } } return member.getName(); }

Target:
public String convertMemberName(Member member) { if (Modifier.isTransient(member.getModifiers())) { return null; } if (member instanceof Field) { Field f = (Field) member; if (f.isAnnotationPresent(SerializedName.class)) { return f.getDeclaredAnnotation(SerializedName.class).value(); } return member.getName(); } return null; }
Source:
public void unstarOrganization(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Organization to unstar.", required = true) @PathParam("organizationId") Long organizationId) { Organization organization = organizationDAO.findById(organizationId); boolean doesOrgExist = doesOrganizationExistToUser(organizationId, user.getId()); if (!doesOrgExist) { String msg = "Organization not found"; LOG.info(msg); throw new CustomWebApplicationException(msg, HttpStatus.SC_NOT_FOUND); } Set<User> starredUsers = organization.getStarredUsers(); if (starredUsers.contains(user)) { organization.removeStarredUser(user); } else { throw new CustomWebApplicationException( "You cannot unstar the organization " + organization.getName() + " because you have not starred it.", HttpStatus.SC_BAD_REQUEST); } }

Target:
public void unstarOrganization(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Organization to unstar.", required = true) @PathParam("organizationId") Long organizationId) { Organization organization = organizationDAO.findApprovedById(organizationId); checkOrganization(organization); Set<User> starredUsers = organization.getStarredUsers(); if (starredUsers.contains(user)) { organization.removeStarredUser(user); } else { throw new CustomWebApplicationException( "You cannot unstar the organization " + organization.getName() + " because you have not starred it.", HttpStatus.SC_BAD_REQUEST); } }
Source:
public void logsEndpointsSorted() { rc.register(DummyResource.class); rc.register(TestResource2.class); rc.register(TestResource.class); rc.register(ImplementingResource.class); System.out.println(rc.getEndpointsInfo()); assertThat(rc.getEndpointsInfo()) .contains(" GET / (io.dropwizard.jersey.dummy.DummyResource)\n" + " GET /another (io.dropwizard.jersey.DropwizardResourceConfigTest.ImplementingResource)\n" + " GET /async (io.dropwizard.jersey.dummy.DummyResource)\n" + " DELETE /dummy (io.dropwizard.jersey.DropwizardResourceConfigTest.TestResource2)\n" + " GET /dummy (io.dropwizard.jersey.DropwizardResourceConfigTest.TestResource)\n" + " POST /dummy (io.dropwizard.jersey.DropwizardResourceConfigTest.TestResource2)" ); }

Target:
public void logsEndpointsSorted() { rc.register(DummyResource.class); rc.register(TestResource2.class); rc.register(TestResource.class); rc.register(ImplementingResource.class); assertThat(rc.getEndpointsInfo()).matches(Pattern.compile(".*" + " GET / \\(io\\.dropwizard\\.jersey\\.dummy\\.DummyResource\\)." + " GET /another \\(io\\.dropwizard\\.jersey\\.DropwizardResourceConfigTest\\.ImplementingResource\\)." + " GET /async \\(io\\.dropwizard\\.jersey\\.dummy\\.DummyResource\\)." + " DELETE /dummy \\(io\\.dropwizard\\.jersey\\.DropwizardResourceConfigTest\\.TestResource2\\)." + " GET /dummy \\(io\\.dropwizard\\.jersey\\.DropwizardResourceConfigTest\\.TestResource\\)." + " POST /dummy \\(io\\.dropwizard\\.jersey\\.DropwizardResourceConfigTest\\.TestResource2\\).", Pattern.DOTALL)); }
Source:
protected void startBundles(List<Bundle> bundles) { FrameworkWiring frameworkWiring = framework.adapt(FrameworkWiring.class); if (!frameworkWiring.resolveBundles(bundles)) { logger.warn("Could not resolve all ${bundles.size} bundles."); } List<Bundle> sortedByDependency = BundleDependencies.sortByDependencies(bundles); for (Bundle bundle : sortedByDependency) { if (!isFragmentBundle(bundle)) { this.startBundle(bundle); } } }

Target:
protected void startBundles(List<Bundle> bundles) { FrameworkWiring frameworkWiring = framework.adapt(FrameworkWiring.class); if (!frameworkWiring.resolveBundles(bundles)) { logger.warn("Could not resolve all bundles.", bundles.size()); } List<Bundle> sortedByDependency = BundleDependencies.sortByDependencies(bundles); for (Bundle bundle : sortedByDependency) { if (!isFragmentBundle(bundle)) { this.startBundle(bundle); } } }
Source:
private KeyStore getKeyStoreInstance(String type) throws CredentialStoreException { if (providers != null) { if (log.isTraceEnabled()) { log.tracef("Obtaining KeyStore instance of type %s, providers: %s", type, providers); } for (Provider p: providers) { try { KeyStore ks = KeyStore.getInstance(type, p); log.tracef("Obtained KeyStore instance: %s, provider: %s", ks, p.toString()); return ks; } catch (KeyStoreException e) { } } } try { if (log.isTraceEnabled()) { log.tracef("Obtaining KeyStore instance of type %s, providers: %s", type, Arrays.toString(Security.getProviders())); } KeyStore ks = KeyStore.getInstance(type); log.tracef("Obtained KeyStore instance: %s", ks); return ks; } catch (KeyStoreException e) { throw log.cannotInitializeCredentialStore(e); } }

Target:
private KeyStore getKeyStoreInstance(String type) throws CredentialStoreException { if (providers != null) { if (log.isTraceEnabled()) { log.tracef("Obtaining KeyStore instance of type %s, providers: %s", type, Arrays.toString(providers)); } for (Provider p: providers) { try { KeyStore ks = KeyStore.getInstance(type, p); log.tracef("Obtained KeyStore instance: %s, provider: %s", ks, p.toString()); return ks; } catch (KeyStoreException e) { } } } try { if (log.isTraceEnabled()) { log.tracef("Obtaining KeyStore instance of type %s, providers: %s", type, Arrays.toString(Security.getProviders())); } KeyStore ks = KeyStore.getInstance(type); log.tracef("Obtained KeyStore instance: %s", ks); return ks; } catch (KeyStoreException e) { throw log.cannotInitializeCredentialStore(e); } }
Source:
public TaskBuilder async() { this.syncType = ScheduledTask.TaskSynchroncity.ASYNCHRONOUS; if (this.tickDelay != -1) { this.delay = this.tickDelay * 50; this.tickDelay = -1; } if (this.tickInterval != -1) { this.interval = this.tickInterval * 50; this.tickInterval = -1; } return this; }

Target:
public TaskBuilder async() { this.syncType = ScheduledTask.TaskSynchronicity.ASYNCHRONOUS; if (this.tickDelay != -1) { this.delay = this.tickDelay * TICK_DURATION; this.tickDelay = -1; } if (this.tickInterval != -1) { this.interval = this.tickInterval * TICK_DURATION; this.tickInterval = -1; } return this; }
Source:
public void testFrameworkProducerCreate() throws Exception { setupFrameworkProducer(false); Exchange mockExchange = mock(Exchange.class); Message message = mock(Message.class); when(mockExchange.getIn()).thenReturn(message); when(mockExchange.getOut()).thenReturn(message); when(mockExchange.getIn().getHeader(OPERATION_HEADER_KEY)).thenReturn(CREATE_OPERATION); when(mockExchange.getIn().getHeader(TIMEOUT_HEADER_KEY)).thenReturn(1000L); when(mockExchange.getIn().getBody()).thenReturn(new MetacardImpl()); when(mockExchange.getIn().getBody(any())).thenReturn(new MetacardImpl()); frameworkProducer.process(mockExchange); }

Target:
public void testFrameworkProducerCreate() throws Exception { setupFrameworkProducer(false); Exchange mockExchange = mock(Exchange.class); Message message = mock(Message.class); when(mockExchange.getIn()).thenReturn(message); when(mockExchange.getOut()).thenReturn(message); when(mockExchange.getIn().getHeader(OPERATION_HEADER_KEY)).thenReturn(CREATE_OPERATION); when(mockExchange.getIn().getHeader(TIMEOUT_HEADER_KEY)).thenReturn(1000L); when(mockExchange.getIn().getBody()).thenReturn(new MetacardImpl()); when(mockExchange.getIn().getBody(any())).thenReturn(new MetacardImpl()); frameworkProducer.process(mockExchange); verify(catalogFramework).create(any(CreateRequest.class)); }
Source:
private void initProgressIndicator() { progressIndicator = new SimplePanel(); getContainer().insert(progressIndicator, 0); getDetailModel().getPropertyChangedEvent().addListener((ev, sender, args) -> { if (getDetailModel().isNetworkOperationInProgress()) { progressIndicator.getElement().setInnerSafeHtml( templates.hostInterfaceOperationInProgressSpinner(constants.networkUpdating()) ); } else { progressIndicator.getElement().setInnerSafeHtml(templates.sevenPixelPaddedEmptyPlaceholder()); } }); }

Target:
private void initProgressIndicator() { progressIndicator = new SimplePanel(); getContainer().insert(progressIndicator, 0); getDetailModel().getPropertyChangedEvent().addListener((ev, sender, args) -> { if (getDetailModel().isNetworkOperationInProgress()) { progressIndicator.getElement().setInnerSafeHtml( templates.hostInterfaceOperationInProgressSpinner(constants.networkUpdating()) ); } else { progressIndicator.getElement().setInnerSafeHtml(templates.networkUpdatingPlaceholder()); } }); }
Source:
private void exitFormulaEditorFragment() { if (hasFormulaBeenChanged || formulaEditorEditText.getHistory().hasUnsavedChanges()) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.formula_editor_discard_changes_dialog_title) .setMessage(R.string.formula_editor_discard_changes_dialog_message) .setNegativeButton(R.string.no, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (discardFormulaIfPossible()) { ToastUtil.showError(getActivity(), R.string.formula_editor_changes_discarded); currentFormula.setDisplayText(null); onUserDismiss(); } } }) .setPositiveButton(R.string.yes, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (saveFormulaIfPossible()) { ToastUtil.showSuccess(getActivity(), R.string.formula_editor_changes_saved); hasFormulaBeenChanged = false; onUserDismiss(); } } }) .create() .show(); } else { onUserDismiss(); } }

Target:
private void exitFormulaEditorFragment() { if (hasFormulaBeenChanged || formulaEditorEditText.getHistory().hasUnsavedChanges()) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.formula_editor_discard_changes_dialog_title) .setMessage(R.string.formula_editor_discard_changes_dialog_message) .setNegativeButton(R.string.no, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { saveInitialStates(); ToastUtil.showError(getActivity(), R.string.formula_editor_changes_discarded); currentFormula.setDisplayText(null); onUserDismiss(); } }) .setPositiveButton(R.string.yes, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (saveFormulaIfPossible()) { ToastUtil.showSuccess(getActivity(), R.string.formula_editor_changes_saved); hasFormulaBeenChanged = false; onUserDismiss(); } } }) .create() .show(); } else { onUserDismiss(); } }
Source:
void updateBayCount(Entity e) { if ((e instanceof Jumpship) || (e instanceof SmallCraft)) { for (Bay bay : e.getTransportBays()) { if (bay instanceof MechBay) { setMechBayCount(getMechBayCount() + (int)bay.getCapacity()); } else if (bay instanceof BattleArmorBay) { setBaBayCount(getBaBayCount() + (int)bay.getCapacity()); } else if (bay instanceof InfantryBay) { setInfantryBayCount(getInfantryBayCount() + (int) (bay.getCapacity() / ((InfantryBay) bay).getPlatoonType().getWeight())); } else if (bay instanceof LightVehicleBay) { setLightVeeBayCount(getLightVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof HeavyVehicleBay) { setHeavyVeeBayCount(getHeavyVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof SuperHeavyVehicleBay) { setSuperHeavyVeeBayCount(getSuperHeavyVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof ASFBay) { setFighterBayCount(getFighterBayCount() + (int) bay.getCapacity()); } else if (bay instanceof SmallCraftBay) { setSmallCraftBayCount(getSmallCraftBayCount() + (int) bay.getCapacity()); } } } }

Target:
void updateBayCount(Entity e) { if (((e instanceof Jumpship) || (e instanceof Dropship)) && !(e instanceof SpaceStation)) { for (Bay bay : e.getTransportBays()) { if (bay instanceof MechBay) { setMechBayCount(getMechBayCount() + (int)bay.getCapacity()); } else if (bay instanceof BattleArmorBay) { setBaBayCount(getBaBayCount() + (int)bay.getCapacity()); } else if (bay instanceof InfantryBay) { setInfantryBayCount(getInfantryBayCount() + (int) (bay.getCapacity() / ((InfantryBay) bay).getPlatoonType().getWeight())); } else if (bay instanceof LightVehicleBay) { setLightVeeBayCount(getLightVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof HeavyVehicleBay) { setHeavyVeeBayCount(getHeavyVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof SuperHeavyVehicleBay) { setSuperHeavyVeeBayCount(getSuperHeavyVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof ASFBay) { setFighterBayCount(getFighterBayCount() + (int) bay.getCapacity()); } else if (bay instanceof SmallCraftBay) { setSmallCraftBayCount(getSmallCraftBayCount() + (int) bay.getCapacity()); } } } }
Source:
protected S3Profile mapProfile(HierarchicalConfiguration<ImmutableNode> profileConfig) throws ConfigurationException { S3Profile profile = super.mapProfile(profileConfig); profile.setBucketName(getRequiredStringProperty(profileConfig, CONFIG_KEY_BUCKET)); if(profileConfig.getString(CONFIG_KEY_ENDPOINT) != null && !profileConfig.getString(CONFIG_KEY_ENDPOINT).isEmpty()){ profile.setEndpoint(getRequiredStringProperty(profileConfig, CONFIG_KEY_ENDPOINT)); } return profile; }

Target:
protected S3Profile mapProfile(HierarchicalConfiguration<ImmutableNode> profileConfig) throws ConfigurationException { S3Profile profile = super.mapProfile(profileConfig); profile.setBucketName(getRequiredStringProperty(profileConfig, CONFIG_KEY_BUCKET)); profile.setEndpoint(getStringProperty(profileConfig, CONFIG_KEY_ENDPOINT)); return profile; }
Source:
void updateFileCommentVisibility(boolean forceHide) { if (forceHide || (fileCommentPanelA.getBoxCount() == 0 && fileCommentPanelB.getBoxCount() == 0)) { UIObject.setVisible(patchsetNavRow, false); UIObject.setVisible(fileCommentRow, false); } else if (patchSelectBoxA.isFileCommentSetVisible()) { UIObject.setVisible(patchsetNavRow, true); UIObject.setVisible(fileCommentRow, true); } host.resizeCodeMirror(); }

Target:
void updateFileCommentVisibility(boolean forceHide) { if (forceHide) { UIObject.setVisible(patchsetNavRow, false); } if (forceHide || (fileCommentPanelA.getBoxCount() == 0 && fileCommentPanelB.getBoxCount() == 0)) { UIObject.setVisible(fileCommentRow, false); } else { UIObject.setVisible(patchsetNavRow, true); UIObject.setVisible(fileCommentRow, true); } host.resizeCodeMirror(); }
Source:
private static LogEntry switchVolumes(LogEntry le, List<Pair<Path,Path>> replacements) { String switchedPath = switchVolume(le.filename, FileType.WAL, replacements); int numSwitched = 0; if (switchedPath != null) numSwitched++; else switchedPath = le.filename; String switchedLog = switchVolume(le.filename, FileType.WAL, replacements); if (switchedLog != null) { numSwitched++; } if (numSwitched == 0) { log.trace("Did not switch {}", le); return null; } LogEntry newLogEntry = new LogEntry(le.extent, le.timestamp, le.server, switchedPath); log.trace("Switched to {}", le, newLogEntry); return newLogEntry; }

Target:
private static LogEntry switchVolumes(LogEntry le, List<Pair<Path,Path>> replacements) { String switchedPath = switchVolume(le.filename, FileType.WAL, replacements); int numSwitched = 0; if (switchedPath != null) numSwitched++; else switchedPath = le.filename; if (switchVolume(le.filename, FileType.WAL, replacements) != null) { numSwitched++; } if (numSwitched == 0) { log.trace("Did not switch {}", le); return null; } LogEntry newLogEntry = new LogEntry(le.extent, le.timestamp, le.server, switchedPath); log.trace("Switched to {}", le, newLogEntry); return newLogEntry; }
Source:
private Object unmarshallSiteFileNode( Node field ) { ArrayList<NamedClusterSiteFile> namedClusterSiteFiles = new ArrayList<>(); Node siteFileWrapper = XMLHandler.getSubNode( field, CHILDREN ); if ( siteFileWrapper != null ) { List<Node> siteFilesNode = XMLHandler.getNodes( siteFileWrapper, CHILD ); for ( Node siteFile : siteFilesNode ) { NamedClusterSiteFileImpl namedClusterSiteFile = new NamedClusterSiteFileImpl(); List<Node> siteFields = XMLHandler.getNodes( XMLHandler.getSubNode( siteFile, CHILDREN ), CHILD ); for ( Node siteField : siteFields ) { String id = XMLHandler.getTagValue( siteField, ID ); if ( id != null && !id.isEmpty() ) { try { BeanUtils.setProperty( namedClusterSiteFile, id, XMLHandler.getTagValue( siteField, VALUE ) ); } catch ( IllegalAccessException | InvocationTargetException e ) { LOGGER.error( "Could not set field " + id + " in NamedClusterSiteFile", e ); } } } namedClusterSiteFiles.add( namedClusterSiteFile ); } } return namedClusterSiteFiles; }

Target:
private Object unmarshallSiteFileNode( Node field ) { ArrayList<NamedClusterSiteFile> namedClusterSiteFiles = new ArrayList<>(); Node siteFileWrapper = XMLHandler.getSubNode( field, CHILDREN ); if ( siteFileWrapper != null ) { unmarshallSiteFiles( namedClusterSiteFiles, XMLHandler.getNodes( siteFileWrapper, CHILD ) ); } return namedClusterSiteFiles; }
Source:
public Response systemScopesRoleAliasesPut(RoleAliasListDTO body, MessageContext messageContext) throws APIManagementException { String tenantDomain = MultitenantUtils.getTenantDomain(RestApiUtil.getLoggedInUsername()); RoleAliasListDTO roleAliasListDTO = new RoleAliasListDTO(); JsonObject existingTenantConfObject = new JsonObject(); try { APIMRegistryService apimRegistryService = new APIMRegistryServiceImpl(); String existingTenantConf = apimRegistryService.getConfigRegistryResourceContent(tenantDomain, APIConstants.API_TENANT_CONF_LOCATION); existingTenantConfObject = new JsonParser().parse(existingTenantConf).getAsJsonObject(); } catch (RegistryException e) { APIUtil.handleException("Couldn't read tenant configuration from tenant registry", e); } catch (UserStoreException e) { APIUtil.handleException("Couldn't read tenant configuration from User Store", e); } JSONObject responseJson = SystemScopesMappingUtil.createJsonObjectOfRoleMapping(body); existingTenantConfObject.remove(APIConstants.REST_API_ROLE_MAPPINGS_CONFIG); JsonElement jsonElement = new JsonParser().parse(String.valueOf(responseJson)); existingTenantConfObject.add(APIConstants.REST_API_ROLE_MAPPINGS_CONFIG, jsonElement); try { ObjectMapper mapper = new ObjectMapper(); String formattedTenantConf = mapper.writerWithDefaultPrettyPrinter() .writeValueAsString(existingTenantConfObject.toString()); APIUtil.updateTenantConf(existingTenantConfObject.toString(), tenantDomain); if (log.isDebugEnabled()) { log.debug("Finalized tenant-conf.json: " + formattedTenantConf); } } catch (JsonProcessingException e) { throw new APIManagementException("Error while formatting tenant-conf.json of tenant: " + tenantDomain, e); } JSONObject tenantConfig = APIUtil.getTenantConfig(tenantDomain); JSONObject roleMapping = (JSONObject) tenantConfig.get(APIConstants.REST_API_ROLE_MAPPINGS_CONFIG); if (roleMapping != null) { roleAliasListDTO = SystemScopesMappingUtil.fromRoleAliasListToRoleAliasListDTO( SystemScopesMappingUtil.createMapOfRoleMapping((roleMapping))); } return Response.ok().entity(roleAliasListDTO).build(); }

Target:
public Response systemScopesRoleAliasesPut(RoleAliasListDTO body, MessageContext messageContext) throws APIManagementException { RoleAliasListDTO roleAliasListDTO = new RoleAliasListDTO(); JSONObject newRoleMappingJson = SystemScopesMappingUtil.createJsonObjectOfRoleMapping(body); String username = RestApiUtil.getLoggedInUsername(); String tenantDomain = MultitenantUtils.getTenantDomain(username); APIUtil.updateTenantConfRoleAliasMapping(newRoleMappingJson, username); JSONObject tenantConfig = APIUtil.getTenantConfig(tenantDomain); JSONObject roleMapping = (JSONObject) tenantConfig.get(APIConstants.REST_API_ROLE_MAPPINGS_CONFIG); if (roleMapping != null) { roleAliasListDTO = SystemScopesMappingUtil.fromRoleAliasListToRoleAliasListDTO( SystemScopesMappingUtil.createMapOfRoleMapping((roleMapping))); } return Response.ok().entity(roleAliasListDTO).build(); }
Source:
public URI apply(@Nullable Object from) { checkArgument(from != null && from instanceof String, "you must specify a region, as a String argument"); return Suppliers2.getValueInMapOrNull(endpointsSupplier, (String) from).get(); }

Target:
public URI apply(@Nullable Object from) { checkArgument(from != null && from instanceof String, "you must specify a region, as a String argument"); Map<String, Supplier<URI>> regionToEndpoint = endpointsSupplier.get(); checkState(regionToEndpoint.size() > 0, "no region name to endpoint mappings configured!"); checkArgument(regionToEndpoint.containsKey(from), "requested location %s, which is not in the configured locations: %s", from, regionToEndpoint); return regionToEndpoint.get(from).get(); }
Source:
protected void scanTarget(MqttBrokerConnection testConnection) throws ConfigurationException, MqttException, InterruptedException { final Lock lock = new ReentrantLock(); lock.lock(); testConnection.addConnectionObserver((isConnected, error) -> lock.unlock()); testConnection.start(); lock.tryLock(TIMEOUT_IN_MS, TimeUnit.MILLISECONDS); if (testConnection.connectionState() == MqttConnectionState.CONNECTED) { logger.trace("Found service device at {}", testConnection.getHost() + ":" + String.valueOf(testConnection.getPort())); Map<String, Object> properties = new HashMap<>(); properties.put("host", testConnection.getHost()); properties.put("port", testConnection.getPort()); ThingUID thingUID = MqttThingID.getThingUID(testConnection.getHost(), testConnection.getPort()); thingDiscovered(DiscoveryResultBuilder.create(thingUID).withTTL(120).withProperties(properties) .withLabel("Mqtt Broker (" + testConnection.getHost() + ")").build()); } testConnection.stop(); }

Target:
protected void scanTarget(MqttBrokerConnection testConnection) throws ConfigurationException, MqttException, InterruptedException { final Lock lock = new ReentrantLock(); lock.lock(); testConnection.addConnectionObserver((isConnected, error) -> lock.unlock()); testConnection.start(); lock.tryLock(TIMEOUT_IN_MS, TimeUnit.MILLISECONDS); if (testConnection.connectionState() == MqttConnectionState.CONNECTED) { logger.trace("Found service device at {}:{}", testConnection.getHost(), String.valueOf(testConnection.getPort())); Map<String, Object> properties = new HashMap<>(); properties.put("host", testConnection.getHost()); properties.put("port", testConnection.getPort()); ThingUID thingUID = MqttThingID.getThingUID(testConnection.getHost(), testConnection.getPort()); thingDiscovered(DiscoveryResultBuilder.create(thingUID).withTTL(120).withProperties(properties) .withRepresentationProperty("host").withLabel("MQTT Broker").build()); } testConnection.stop(); }
Source:
public void init(FilterConfig arg0) throws ServletException { if (allowedCorsOriginsConfig == null || "*".equals(allowedCorsOriginsConfig)) { allowAnyOrigin = true; } else { allowAnyOrigin = false; try { allowedOrigins = OriginValidation.parseAllowedCorsOrigins(allowedCorsOriginsConfig); } catch (Exception e) { throw new ServletException(e); } } }

Target:
public void init(FilterConfig arg0) throws ServletException { if (allowedCorsOriginsConfig == null || ALLOW_ALL_ORIGIN.equals(allowedCorsOriginsConfig.trim())) { allowAnyOrigin = true; } else { allowAnyOrigin = false; try { allowedOrigins = OriginValidation.parseAllowedCorsOrigins(allowedCorsOriginsConfig); } catch (Exception e) { throw new ServletException(e); } } }
Source:
public boolean visit(Assignment node) { if (ASTHelper.isSameLocalVariable(node.getLeftHandSide(), cursorSimpleName)) { return DO_NOT_VISIT_SUBTREE; } return VISIT_SUBTREE; }

Target:
public boolean visit(Assignment node) { if (isSameLocalVariable(node.getLeftHandSide(), cursorSimpleName)) { return DO_NOT_VISIT_SUBTREE; } return VISIT_SUBTREE; }