auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ExprEval getObject() { List<String> arrayBindings = unknownColumns.stream() .filter(x -> !baseExprBindingDetails.getArrayVariables().contains(x) && isBindingArray(x)) .collect(Collectors.toList()); if (ignoredColumns.size() > 0) { unknownColumns.removeAll(ignoredColumns); ignoredColumns.clear(); } if (arrayBindings.size() > 0) { final int key = arrayBindings.hashCode(); if (transformedCache.containsKey(key)) { return transformedCache.get(key).eval(bindings); } Expr transformed = Parser.applyUnappliedIdentifiers(expression, baseExprBindingDetails, arrayBindings); transformedCache.put(key, transformed); return transformed.eval(bindings); } return expression.eval(bindings); }

Target:
public ExprEval getObject() { List<String> arrayBindings = unknownColumns.stream().filter(this::isBindingArray).collect(Collectors.toList()); if (ignoredColumns.size() > 0) { unknownColumns.removeAll(ignoredColumns); ignoredColumns.clear(); } if (arrayBindings.size() > 0) { final int key = arrayBindings.hashCode(); if (transformedCache.containsKey(key)) { return transformedCache.get(key).eval(bindings); } Expr transformed = Parser.applyUnappliedIdentifiers(expression, baseExprBindingDetails, arrayBindings); transformedCache.put(key, transformed); return transformed.eval(bindings); } return expression.eval(bindings); }
Source:
public boolean isEnableForComponent(Component invoker) { TreePath[] paths = this.extAlert.getAlertPanel().getTreeAlert().getSelectionPaths(); for(int i = 0; i < paths.length; i++ ){ DefaultMutableTreeNode alertNode = (DefaultMutableTreeNode)paths[i].getLastPathComponent(); if(alertNode.getUserObject() == null) { return false; } } if(this.extAlert == null) { return false; } if ("treeAlert".equals(invoker.getName())) { int count = this.extAlert.getAlertPanel().getTreeAlert().getSelectionCount(); setEnabled(isButtonEnabledForNumberOfSelectedAlerts(count)); return true; } return false; }

Target:
public boolean isEnableForComponent(Component invoker) { if(this.extAlert == null) { return false; } if ("treeAlert".equals(invoker.getName())) { int count = this.extAlert.getAlertPanel().getTreeAlert().getSelectionCount(); setEnabled(!this.extAlert.getAlertPanel().getTreeAlert().isRowSelected(0) && isButtonEnabledForNumberOfSelectedAlerts(count)); return true; } return false; }
Source:
public Response removeCredentials() { String user = authenticationService.getPrincipal(); LOGGER.info("removeCredentials credentials for user ", user); UserCredentials uc; try { uc = credentials.removeUserCredentials(user); if (uc == null) { return new JsonResponse<>(Status.NOT_FOUND).build(); } return new JsonResponse<>(Status.OK).build(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); return new JsonResponse<>(Status.INTERNAL_SERVER_ERROR).build(); } }

Target:
public Response removeCredentials() { String user = authenticationService.getPrincipal(); LOGGER.info("removeCredentials for user ", user); UserCredentials uc; try { uc = credentials.removeUserCredentials(user); if (uc == null) { return new JsonResponse<>(Status.NOT_FOUND).build(); } return new JsonResponse<>(Status.OK).build(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); return new JsonResponse<>(Status.INTERNAL_SERVER_ERROR).build(); } }
Source:
public Collection<EObject> eRemoveInverseCrossReferences(EObject eObject, ECrossReferenceAdapter xref, EReferencePredicate isReferencesToIgnorePredicate) { Collection<EObject> impactedEObjects = new ArrayList<EObject>(); for (final IMetamodelExtender extender : getActivatedExtenders()) { impactedEObjects.addAll(extender.eRemoveInverseCrossReferences(eObject, xref, isReferencesToIgnorePredicate)); } return impactedEObjects; }

Target:
public Collection<EObject> eRemoveInverseCrossReferences(EObject eObject, ECrossReferenceAdapter xref, EReferencePredicate isReferencesToIgnorePredicate) { Collection<EObject> impactedEObjects = new LinkedHashSet<EObject>(); for (final IMetamodelExtender extender : getActivatedExtenders()) { impactedEObjects.addAll(extender.eRemoveInverseCrossReferences(eObject, xref, isReferencesToIgnorePredicate)); } return impactedEObjects; }
Source:
Stamp(long stamp, long gcStamp) { long b= stamp & ColumnConstants.PREFIX_MASK ; Preconditions.checkArgument(b==0?true:false, "should be zero"); long c= gcStamp & ColumnConstants.PREFIX_MASK ; Preconditions.checkArgument(c==0?true:false, "should be zero"); this.txStamp = stamp; this.gcStamp = gcStamp; }

Target:
Stamp(long stamp, long gcStamp) { long b = stamp & ColumnConstants.PREFIX_MASK; Preconditions.checkArgument(b == 0, "timestamp prefix should be zero"); long c = gcStamp & ColumnConstants.PREFIX_MASK; Preconditions.checkArgument(c == 0, "timestamp prefix should be zero"); this.txStamp = stamp; this.gcStamp = gcStamp; }
Source:
public void onMessage(ResponseBody message) throws IOException { int type = message.byteStream().read(); String msg = message.string(); switch ( type ) { case 1: listener.onStdOut(msg); break; case 2: listener.onStdErr(msg); break; case 3: listener.onExecErr(msg); break; default: LOG.warn("Unable to deliver exec message of type [%d]: %s", type, msg ); } }

Target:
public void onMessage(ResponseBody message) throws IOException { int channel = message.byteStream().read(); String msg = message.string(); deliver( channel, msg ); }
Source:
public List<RuleRuntime> getRulesRuntime() { final List<Rule> rules = rulesProcessor.getRules(); final List<RuleRuntime> rulesRuntime = new ArrayList<>(); if (rules != null) { for (Rule rule : rules) { ruleRuntimeBuilder.setRule(rule); RuleRuntime ruleRuntime = null; if (rule.getCondition() != null) { ruleRuntimeBuilder.buildExpression(); ruleRuntimeBuilder.buildScriptEngine(); ruleRuntimeBuilder.buildScript(); } ruleRuntimeBuilder.buildActions(); ruleRuntime = ruleRuntimeBuilder.buildRuleRuntime(); rulesRuntime.add(ruleRuntime); LOG.trace("Added {}", ruleRuntime); } LOG.debug("Finished building. [{}]", this); } return rulesRuntime; }

Target:
public List<RuleRuntime> getRulesRuntime() { final List<Rule> rules = rulesProcessor.getRules(); final List<RuleRuntime> rulesRuntime = new ArrayList<>(); if (rules != null) { for (Rule rule : rules) { ruleRuntimeBuilder.setRule(rule); if (rule.getCondition() != null) { ruleRuntimeBuilder.buildExpression(); ruleRuntimeBuilder.buildScriptEngine(); ruleRuntimeBuilder.buildScript(); } ruleRuntimeBuilder.buildActions(); RuleRuntime ruleRuntime = ruleRuntimeBuilder.buildRuleRuntime(); rulesRuntime.add(ruleRuntime); LOG.trace("Added {}", ruleRuntime); } LOG.debug("Finished building. [{}]", this); } return rulesRuntime; }
Source:
private static Collection getCollection(BaseResource model, Class<? extends BaseResource> suggestedParentType) { ParentToCollectionMap collections = TYPES.get(model.getClass()); if (collections == null) { log.error("Map 'describing every possible collection' does not contain rather possible key for resource " + "%1$s, returning 'null' instead.", model.getClass()); return null; } if (suggestedParentType != null) { for (Entry<Class<? extends BaseResource>, Collection> entry : collections.entrySet()) { if (entry.getKey().equals(suggestedParentType)) { return entry.getValue(); } } } for (Entry<Class<? extends BaseResource>, Collection> parentTypeEntry : collections.entrySet()) { if (parentTypeEntry.getKey() != NO_PARENT && getParentModel(model, parentTypeEntry.getKey()) != null) { return parentTypeEntry.getValue(); } } return collections.get(NO_PARENT); }

Target:
private static Collection getCollection(BaseResource model, Class<? extends BaseResource> suggestedParentType) { ParentToCollectionMap collections = TYPES.get(model.getClass()); if (collections == null) { return null; } if (suggestedParentType != null) { for (Entry<Class<? extends BaseResource>, Collection> entry : collections.entrySet()) { if (entry.getKey().equals(suggestedParentType)) { return entry.getValue(); } } } for (Entry<Class<? extends BaseResource>, Collection> parentTypeEntry : collections.entrySet()) { if (parentTypeEntry.getKey() != NO_PARENT && getParentModel(model, parentTypeEntry.getKey()) != null) { return parentTypeEntry.getValue(); } } return collections.get(NO_PARENT); }
Source:
public void notifyParentItemRangeInserted(int parentPositionStart, int itemCount) { int initialWrapperIndex; if (parentPositionStart < mParentItemList.size() - 1) { initialWrapperIndex = getParentWrapperIndex(parentPositionStart); } else { initialWrapperIndex = mItemList.size(); } int sizeChanged = 0; int wrapperIndex = initialWrapperIndex; int changed; for (int i = parentPositionStart; i < parentPositionStart + itemCount; i++) { ParentListItem parentListItem = mParentItemList.get(i); changed = addParentWrapper(wrapperIndex, parentListItem); wrapperIndex += changed; sizeChanged += changed; } notifyItemRangeInserted(initialWrapperIndex, sizeChanged); }

Target:
public void notifyParentItemRangeInserted(int parentPositionStart, int itemCount) { int initialWrapperIndex; if (parentPositionStart < mParentItemList.size() - 1) { initialWrapperIndex = getParentWrapperIndex(parentPositionStart); } else { initialWrapperIndex = mItemList.size(); } int sizeChanged = 0; int wrapperIndex = initialWrapperIndex; int changed; int parentPositionEnd = parentPositionStart + itemCount; for (int i = parentPositionStart; i < parentPositionEnd; i++) { ParentListItem parentListItem = mParentItemList.get(i); changed = addParentWrapper(wrapperIndex, parentListItem); wrapperIndex += changed; sizeChanged += changed; } notifyItemRangeInserted(initialWrapperIndex, sizeChanged); }
Source:
public String createProfile(String profileFolder, String profileName, String version, InputStream zipFile) throws IOException, ConfigurationException, MalformedObjectNameException { String profileId = getProfileName(profileFolder, profileName); String versionId = getOrCreateVersion(version); createProfile(versionId, profileId); ZipInputStream zis = new ZipInputStream(zipFile); ZipEntry ze = zis.getNextEntry(); while (ze != null) { String name = ze.getName(); if (name.contains(FABRIC_MAIN_PROFILE_FILE)) { int count; byte data[] = new byte[2048]; File f = File.createTempFile("temp.fabric", "properties"); FileOutputStream fos = new FileOutputStream(f); while ((count = zis.read(data, 0, 2048)) != -1) { fos.write(data, 0, count); } fos.flush(); fos.close(); PropertiesConfiguration propertiesFile = new PropertiesConfiguration(f); parseProperties(profileId, versionId, propertiesFile); f.delete(); } else { if (!ze.isDirectory()) { int count; byte data[] = new byte[2048]; File f = File.createTempFile("temp.fabric", "properties"); FileOutputStream fos = new FileOutputStream(f); while ((count = zis.read(data, 0, 2048)) != -1) { fos.write(data, 0, count); } fos.flush(); fos.close(); uploadProfilePropertiesFile(versionId, profileId, ze.getName(), new FileInputStream(f)); f.delete(); } } ze = zis.getNextEntry(); } zis.closeEntry(); zis.close(); refreshProfile(versionId, profileId); return profileId; }

Target:
public String createProfile(String profileFolder, String profileName, String version, InputStream zipFile) throws IOException, ConfigurationException, MalformedObjectNameException { String profileId = getProfileName(profileFolder, profileName); String versionId = getOrCreateVersion(version); createProfile(versionId, profileId); ZipInputStream zis = new ZipInputStream(zipFile); ZipEntry ze = zis.getNextEntry(); while (ze != null) { String name = ze.getName(); if (name.contains(FABRIC_MAIN_PROFILE_FILE)) { int count; byte data[] = new byte[2048]; File f = File.createTempFile("temp.fabric", "properties"); FileOutputStream fos = new FileOutputStream(f); while ((count = zis.read(data, 0, 2048)) != -1) { fos.write(data, 0, count); } fos.flush(); fos.close(); PropertiesConfiguration propertiesFile = new PropertiesConfiguration(f); parseProperties(profileId, versionId, propertiesFile); f.delete(); } else { if (!ze.isDirectory()) { int count; byte data[] = new byte[2048]; File f = File.createTempFile("temp.fabric", "properties"); FileOutputStream fos = null; try { fos = new FileOutputStream(f); while ((count = zis.read(data, 0, 2048)) != -1) { fos.write(data, 0, count); } fos.flush(); } finally { if (fos != null) { fos.close(); } } InputStream is = null; try { is = new FileInputStream(f); uploadProfilePropertiesFile(versionId, profileId, ze.getName(), is); } finally { if (is != null) { is.close(); } } f.delete(); } } ze = zis.getNextEntry(); } zis.closeEntry(); zis.close(); refreshProfile(versionId, profileId); return profileId; }
Source:
public boolean bind(final ClientEndpoint endpoint) { if (isMCClient(endpoint) && !clientSelector.select(endpoint)) { return false; } if (!endpointManager.registerEndpoint(endpoint)) { return true; } Connection conn = endpoint.getConnection(); if (conn instanceof TcpIpConnection) { InetSocketAddress socketAddress = conn.getRemoteSocketAddress(); if (socketAddress != null) { Address address = new Address(socketAddress); ((TcpIpConnection) conn).setEndPoint(address); } } if (!isMCClient(endpoint) && !clientSelector.select(endpoint)) { endpointManager.removeEndpoint(endpoint); return false; } return true; }

Target:
public boolean bind(final ClientEndpoint endpoint) { if (!isClientAllowed(endpoint)) { return false; } if (!endpointManager.registerEndpoint(endpoint)) { return true; } Connection conn = endpoint.getConnection(); if (conn instanceof TcpIpConnection) { InetSocketAddress socketAddress = conn.getRemoteSocketAddress(); if (socketAddress != null) { Address address = new Address(socketAddress); ((TcpIpConnection) conn).setEndPoint(address); } } if (!isClientAllowed(endpoint)) { endpointManager.removeEndpoint(endpoint); return false; } return true; }
Source:
public static Iterable<Object[]> data() { List<Object[]> parameters = new ArrayList<>(); Set<Class<? extends FormulaBrick>> formulaClasses = getAllSubClassesOf(FormulaBrick.class); formulaClasses = removeAbstractClasses(formulaClasses); formulaClasses = removeInnerClasses(formulaClasses); for (Class<?> formulaClazz : formulaClasses) { parameters.add(new Object[] {formulaClazz.getName(), formulaClazz}); } return parameters; }

Target:
public static Iterable<Object[]> data() { List<Object[]> parameters = new ArrayList<>(); Set<Class<? extends FormulaBrick>> formulaClasses = getAllSubClassesOf(FormulaBrick.class); formulaClasses = removeAbstractClasses(formulaClasses); formulaClasses = removeInnerClasses(formulaClasses); for (Class<?> formulaClazz : formulaClasses) { if (!ScriptBrick.class.isAssignableFrom(formulaClazz)) { parameters.add(new Object[] {formulaClazz.getName(), formulaClazz}); } } return parameters; }
Source:
public SimpleObject[] getMothers(@RequestParam("patientId") Patient patient,UiUtils ui) { List<Person> people = new ArrayList<Person>(); if (patient == null) return new SimpleObject[] {}; else { for (Relationship relationship : Context.getPersonService().getRelationshipsByPerson(patient)) { if (relationship != null) { if (relationship.getRelationshipType().getbIsToA().equals("Parent")) { if (relationship.getPersonB().getGender().equals("F")) people.add(relationship.getPersonB()); } if (relationship.getRelationshipType().getaIsToB().equals("Parent")) { if (relationship.getPersonA().getGender().equals("F")) { people.add(relationship.getPersonA()); } } } } } return ui.simplifyCollection(people); }

Target:
public SimpleObject[] getMothers(@RequestParam("patientId") Patient patient,UiUtils ui) { List<Person> people = new ArrayList<Person>(); for (Relationship relationship : Context.getPersonService().getRelationshipsByPerson(patient)) { if (relationship.getRelationshipType().getbIsToA().equals("Parent")) { if (relationship.getPersonB().getGender().equals("F")) { people.add(relationship.getPersonB()); } } if (relationship.getRelationshipType().getaIsToB().equals("Parent")) { if (relationship.getPersonA().getGender().equals("F")) { people.add(relationship.getPersonA()); } } } return ui.simplifyCollection(people); }
Source:
public void testGetChildWithParents() throws Exception { Response response = resource.getOntologyById(child.getId()); assertTrue(response.getStatus() == 200); List<TermResource> terms = (List<TermResource>) response.getEntity(); assertTrue(terms.size() == 1); TermResource term = terms.get(0); assertTrue(child.getId().equals(term.getId())); assertTrue(child.getLabel().equals(term.getLabel())); assertTrue(child.getDefinition().equals(term.getDefinition())); assertTrue(child.getSynonyms().equals(term.getSynonyms())); for (TermParent p : term.getParents()) { boolean parentChecked = false; if (p.getId().equals(parent1.getId())) { assertTrue(p.getLabel().equals(parent1.getLabel())); assertTrue(p.getDefinition().equals(parent1.getDefinition())); assertTrue(p.getSynonyms().equals(parent1.getSynonyms())); parentChecked = true; } else if (p.getId().equals(parent2.getId())) { assertTrue(p.getLabel().equals(parent2.getLabel())); assertTrue(p.getDefinition().equals(parent2.getDefinition())); assertTrue(p.getSynonyms().equals(parent2.getSynonyms())); parentChecked = true; } assertTrue(parentChecked); } }

Target:
public void testGetChildWithParents() throws Exception { Response response = resource.getOntologyById(child.getId()); assertTrue(response.getStatus() == 200); List<TermResource> terms = (List<TermResource>) response.getEntity(); assertTrue(terms.size() == 1); TermResource term = terms.get(0); assertTrue(child.getId().equals(term.getId())); assertTrue(child.getLabel().equals(term.getLabel())); assertTrue(child.getDefinition().equals(term.getDefinition())); assertTrue(child.getSynonyms().equals(term.getSynonyms())); assertEquals("Expected two parents", 2, term.getParents().size()); term.getParents().sort(Comparator.comparingInt(TermParent::getOrder)); TermParent actualParent1 = term.getParents().get(0); TermParent actualParent2 = term.getParents().get(1); assertTrue(actualParent1.getLabel().equals(parent1.getLabel())); assertTrue(actualParent1.getDefinition().equals(parent1.getDefinition())); assertTrue(actualParent1.getSynonyms().equals(parent1.getSynonyms())); assertTrue(actualParent2.getLabel().equals(parent2.getLabel())); assertTrue(actualParent2.getDefinition().equals(parent2.getDefinition())); assertTrue(actualParent2.getSynonyms().equals(parent2.getSynonyms())); }
Source:
public String next() { char c = input.read(); if (input.isAtEnd()) { return getTokenEOF(); } if (!keepBeginningWhiteSpace) { while (isWhitespace(c)) { c = input.read(); if (input.isAtEnd()) { return getTokenEOF(); } } } if (c == separator) { return getTokenSeparator(); } if (c == textMarker) { return onTextMarkerChar(); } if (c == '\r' || c == '\n') { return onLineEndingChar(c); } int length = 1; builder.append(c); while (true) { c = input.read(); if (input.isAtEnd()) { break; } if (c == separator || c == '\r' || c == '\n') { input.rewind(1); break; } builder.append(c); length++; } while (length > 0 && isWhitespace(builder.charAt(length-1))) { length--; } return getTokenValue(length); }

Target:
public String next() { char c = input.read(); if (input.isAtEnd()) { return getTokenEOF(); } if (!keepBeginningWhiteSpace) { while (isWhitespace(c)) { c = input.read(); if (input.isAtEnd()) { return getTokenEOF(); } } } if (c == separator) { return getTokenSeparator(); } if (c == textMarker) { return onTextMarkerChar(); } if (c == '\r' || c == '\n') { return onLineEndingChar(c); } builder.append(c); while (true) { c = input.read(); if (input.isAtEnd()) { break; } if (c == separator || c == '\r' || c == '\n') { input.rewind(1); break; } builder.append(c); } int length = builder.length() - 1; while (length > 0 && isWhitespace(builder.charAt(length))) { builder.deleteCharAt(length); length--; } return getTokenValue(length); }
Source:
public void init(ServletConfig config) throws ServletException { super.init(config); this.servletName = config.getServletName(); this.async = Optional.ofNullable(config.getInitParameter(ASYNC_PARAM)) .map(ObjectHelper::toBoolean) .orElse(Boolean.FALSE); log.trace("servlet '{}' initialized with: async={}", new Object[]{servletName, async}); }

Target:
public void init(ServletConfig config) throws ServletException { super.init(config); this.servletName = config.getServletName(); final String asyncParam = config.getInitParameter(ASYNC_PARAM); this.async = asyncParam == null ? false : ObjectHelper.toBoolean(asyncParam); log.trace("servlet '{}' initialized with: async={}", new Object[]{servletName, async}); }
Source:
private void hideMatchingResources(RepositoryResourceImpl newResource) throws RepositoryBackendException, RepositoryResourceException { String vanityURL = newResource.getVanityURL(); RepositoryConnection repo = newResource.getRepositoryConnection(); Collection<RepositoryResource> matchingResources = repo.getMatchingResources(FilterPredicate.areEqual(FilterableAttribute.VANITY_URL, vanityURL)); boolean found = false; for (RepositoryResource resource : matchingResources) { if (!isVisible(resource)) { continue; } if (!State.PUBLISHED.equals(((RepositoryResourceWritable) resource).getState())) { continue; } if (newResource.getId().equals(resource.getId())) { continue; } if (found) { throw new RepositoryResourceUpdateException("There is more than 1 resource with the vanity URL " + newResource.getVanityURL() + " in state visible, " + newResource.getName() + "(" + newResource.getId() + ") and " + resource.getName() + "(" + resource.getId() + ")", newResource.getId()); } found = true; ((WebDisplayable) resource).setWebDisplayPolicy(DisplayPolicy.HIDDEN); ((RepositoryResourceWritable) resource).uploadToMassive(new AddThenDeleteStrategy(null, State.DRAFT, true)); } }

Target:
private void hideMatchingResources(RepositoryResourceImpl newResource) throws RepositoryBackendException, RepositoryResourceException { String vanityURL = newResource.getVanityURL(); RepositoryConnection repo = newResource.getRepositoryConnection(); Collection<RepositoryResource> matchingResources = repo.getMatchingResources(FilterPredicate.areEqual(FilterableAttribute.VANITY_URL, vanityURL)); List<String> hiddenAssets = new ArrayList<String>(); for (RepositoryResource resource : matchingResources) { if (!isVisibleAndWebDisplayable(resource)) { continue; } if (!State.PUBLISHED.equals(((RepositoryResourceWritable) resource).getState())) { continue; } if (newResource.getId().equals(resource.getId())) { continue; } ((WebDisplayable) resource).setWebDisplayPolicy(DisplayPolicy.HIDDEN); ((RepositoryResourceWritable) resource).uploadToMassive(new AddThenDeleteStrategy(null, State.DRAFT, true)); hiddenAssets.add(resource.getId()); } if (hiddenAssets.size() > 1) { StringBuilder ids = new StringBuilder(); for (String id : hiddenAssets) { ids.append(id + ", "); } throw new RepositoryResourceUpdateException("There was more than 1 resource with the vanity URL " + newResource.getVanityURL() + " in state visible. New resource is " + newResource.getName() + "(" + newResource.getId() + ") and old asset ids were " + ids.toString(), newResource.getVanityURL()); } }
Source:
private boolean isRequestFiltered(@Nullable Integer orderBy) { return orderBy != null && (orderBy == Constants.ORDER_BY_DISTANCE || orderBy == Constants.ORDER_BY_DATE || orderBy == Constants.ORDER_BY_STATUS || orderBy == Constants.ORDER_BY_NAME); return false; }

Target:
private boolean isRequestFiltered(@Nullable Integer orderBy) { return orderBy != null && (orderBy == Constants.ORDER_BY_DISTANCE || orderBy == Constants.ORDER_BY_DATE || orderBy == Constants.ORDER_BY_STATUS || orderBy == Constants.ORDER_BY_NAME); }
Source:
public List<Kill> getKills() { List<Kill> flattenedKills = new ArrayList<Kill>(); for(ArrayList<Kill> personKills : kills.values()) { flattenedKills.addAll(personKills); } return Collections.unmodifiableList(flattenedKills); }

Target:
public List<Kill> getKills() { List<Kill> flattenedKills = new ArrayList<>(); for(List<Kill> personKills : kills.values()) { flattenedKills.addAll(personKills); } return Collections.unmodifiableList(flattenedKills); }
Source:
void updateActionLabels() { ImageDescriptor descriptor = ImageDescriptor.getMissingImageDescriptor(); final Image descImage = labelProvider.getImage(description); if (descImage != null) { descriptor = ImageDescriptor.createFromImage(descImage); } this.setImageDescriptor(descriptor); computeRepresentationName(); this.setText(name); this.setToolTipText(description.getEndUserDocumentation()); if (session instanceof DAnalysisSession) { DRepresentationContainer representationContainer = DAnalysisSessionHelper.findContainerForRepresentationDescription((DAnalysisSession) session, description); if (representationContainer != null) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(representationContainer); if (permissionAuthority != null && !permissionAuthority.canCreateIn(representationContainer)) { this.setEnabled(false); } } } }

Target:
void updateActionLabels() { ImageDescriptor descriptor = ImageDescriptor.getMissingImageDescriptor(); final Image descImage = labelProvider.getImage(description); if (descImage != null) { descriptor = ImageDescriptor.createFromImage(descImage); } this.setImageDescriptor(descriptor); computeRepresentationName(); this.setText(name); this.setToolTipText(description.getEndUserDocumentation()); if (session instanceof DAnalysisSession) { Collection<DRepresentationContainer> containers = DAnalysisSessionHelper.findContainerCandidatesForRepresentationDescription((DAnalysisSession) session, description); if (!containers.isEmpty()) { boolean enabled = false; for (DRepresentationContainer container : containers) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority == null || permissionAuthority.canCreateIn(container)) { enabled = true; break; } } this.setEnabled(enabled); } } }
Source:
public File file() throws IOException { final File license = File.createTempFile("LICENSE", ".txt"); FileUtils.forceDeleteOnExit(license); FileUtils.writeStringToFile( license, StringUtils.join(this.lines, this.eol), Charset.defaultCharset() ); if (this.directory != null) { this.makePackageInfo(this.directory); } return license; }

Target:
public File file() throws IOException { final File license = File.createTempFile("LICENSE", ".txt"); FileUtils.forceDeleteOnExit(license); FileUtils.writeStringToFile( license, new JoinedText(this.eol, this.lines).asString(), StandardCharsets.UTF_8 ); if (this.directory != null) { this.makePackageInfo(this.directory); } return license; }
Source:
public void setLaunchAndWait(ILaunch launch) { this.launch = launch; this.myProcess = launch.getProcesses()[0]; synchronized (waiting) { if( checkAllCachedEvents()) { return; } try { waiting.wait(); } catch (InterruptedException ie) { } } }

Target:
public void setLaunchAndWait(ILaunch launch) { this.launch = launch; this.myProcess = this.launch.getProcesses()[0]; synchronized (waiting) { while( !checkAllCachedEvents()) { try { waiting.wait(); } catch (InterruptedException ie) { } } } }
Source:
protected ContainerPlacementMessage(UUID uuid, String deploymentId, String processorId, String destinationHost, Duration requestExpiry, StatusCode statusCode, long timestamp) { Preconditions.checkNotNull(uuid, "uuid cannot be null"); Preconditions.checkNotNull(deploymentId, "deploymentId cannot be null"); Preconditions.checkNotNull(processorId, "processorId cannot be null"); Preconditions.checkNotNull(destinationHost, "destinationHost cannot be null"); Preconditions.checkNotNull(statusCode, "statusCode cannot be null"); Preconditions.checkNotNull(timestamp, "Timestamp of the message cannot be null"); this.uuid = uuid; this.deploymentId = deploymentId; this.processorId = processorId; this.destinationHost = destinationHost; this.requestExpiry = requestExpiry; this.statusCode = statusCode; this.timestamp = timestamp; }

Target:
protected ContainerPlacementMessage(UUID uuid, String deploymentId, String processorId, String destinationHost, Duration requestExpiry, StatusCode statusCode, long timestamp) { this.uuid = Preconditions.checkNotNull(uuid, "uuid cannot be null"); this.deploymentId = Preconditions.checkNotNull(deploymentId, "deploymentId cannot be null"); this.processorId = Preconditions.checkNotNull(processorId, "processorId cannot be null"); this.destinationHost = Preconditions.checkNotNull(destinationHost, "destinationHost cannot be null"); this.statusCode = Preconditions.checkNotNull(statusCode, "statusCode cannot be null"); this.timestamp = Preconditions.checkNotNull(timestamp, "Timestamp of the message cannot be null"); this.requestExpiry = requestExpiry; }
Source:
public DataSet updateDataset(DataSetDTO dataset, Integer datasetId, Integer userId) { Timestamp now = new Timestamp(new Date().getTime()); DataSet old = getDatasetWithPropertiesById(datasetId); Set<DataSetProperty> oldProperties = old.getProperties(); List<DataSetPropertyDTO> dtos = dataset.getProperties(); List<DataSetProperty> jsonProperties = processDatasetProperties(datasetId, dtos); ; List<DataSetProperty> propertiesToAdd = jsonProperties.stream() .filter(p -> oldProperties.stream() .noneMatch(op -> op.getPropertyKey() == p.getPropertyKey())) .collect(Collectors.toList()); List<DataSetProperty> propertiesToUpdate = jsonProperties.stream() .filter(p -> oldProperties.stream() .noneMatch(op -> equalsProperty(op.getPropertyKey(), op.getPropertyValue(), p.getPropertyKey(), p.getPropertyValue()))) .collect(Collectors.toList()); if (propertiesToAdd.isEmpty() && propertiesToUpdate.isEmpty()) { return null; } propertiesToUpdate.stream().forEach(p -> dataSetDAO.updateDatasetProperty(datasetId, p.getPropertyKey(), p.getPropertyValue())); dataSetDAO.insertDataSetsProperties(propertiesToAdd); dataSetDAO.updateDataset(datasetId, now, userId); DataSet updatedDataset = getDatasetWithPropertiesById(datasetId); return updatedDataset; }

Target:
public Optional<DataSet> updateDataset(DataSetDTO dataset, Integer datasetId, Integer userId) { Timestamp now = new Timestamp(new Date().getTime()); DataSet old = getDatasetWithPropertiesById(datasetId); Set<DataSetProperty> oldProperties = old.getProperties(); List<DataSetPropertyDTO> updateDatasetPropertyDTOs = dataset.getProperties(); List<DataSetProperty> updateDatasetProperties = processDatasetProperties(datasetId, updateDatasetPropertyDTOs); List<DataSetProperty> propertiesToAdd = updateDatasetProperties.stream() .filter(p -> oldProperties.stream() .noneMatch(op -> op.getPropertyKey() == p.getPropertyKey())) .collect(Collectors.toList()); List<DataSetProperty> propertiesToUpdate = updateDatasetProperties.stream() .filter(p -> oldProperties.stream() .noneMatch(op -> p.equals(op))) .collect(Collectors.toList()); List<DataSetProperty> propertiesToDelete = oldProperties.stream() .filter(op -> updateDatasetProperties.stream() .noneMatch(p -> p.getPropertyKey() == op.getPropertyKey()) ).collect(Collectors.toList()); if (propertiesToAdd.isEmpty() && propertiesToUpdate.isEmpty() && propertiesToDelete.isEmpty()) { return Optional.empty(); } updateDatasetProperties(propertiesToUpdate, propertiesToDelete, propertiesToAdd); dataSetDAO.updateDatasetUpdateUserAndDate(datasetId, now, userId); DataSet updatedDataset = getDatasetWithPropertiesById(datasetId); return Optional.of(updatedDataset); }
Source:
public void init() { publisher.subscribe(to(BlockAdded.class, data -> { data.getBlockSummary().getBlock().getTransactionsList().forEach(gasPriceTracker::onTransaction); })); }

Target:
public void init() { worldManager.subscribe(to(BLOCK_ADDED, data -> gasPriceTracker.onBlock(data.getBlockSummary()))); }
Source:
protected void initialize() { setInstallLocation(new File("./").getAbsolutePath()); loadConfig(); if (getPort().isPresent()) { getUrlDetector().setPort(getPort()); } else { LOG.info("No valid port in storm.yaml, using the on configured in the Url Detector " + getUrlDetector().getPort()); setPort(getUrlDetector().getPort()); } }

Target:
protected void initialize() { setInstallLocation(new File(".").getAbsolutePath()); loadConfig(); if (getPort().isPresent()) { getUrlDetector().setPort(getPort()); } else { LOG.info("No valid port in storm.yaml, using the on configured in the Url Detector " + getUrlDetector().getPort()); setPort(getUrlDetector().getPort()); } }
Source:
private CacheLoader<Cell, byte[]> getCacheLoader(TableReference tableRef) { return new CacheLoader<Cell, byte[]>() { @Override public byte[] load(Cell key) throws Exception { byte[] res = CachingTransaction.super.get(tableRef, ImmutableSet.of(key)).get(key); if (res == null) { return PtBytes.EMPTY_BYTE_ARRAY; } else { return res; } } @Override public Map<Cell, byte[]> loadAll(Iterable<? extends Cell> keys) throws Exception { Map<Cell, byte[]> internalResult = CachingTransaction.super.get(tableRef, ImmutableSet.copyOf(keys)); Map<Cell, byte[]> res = Maps.newConcurrentMap(); for (Cell key : keys) { byte[] value = internalResult.get(key); if (value == null) { res.put(key, PtBytes.EMPTY_BYTE_ARRAY); } else { res.put(key, value); } } return res; } }; }

Target:
private CacheLoader<Cell, byte[]> getCacheLoader(TableReference tableRef) { return new CacheLoader<Cell, byte[]>() { @Override public byte[] load(Cell key) throws Exception { return setMissingKeysToEmpty(CachingTransaction.super.get(tableRef, ImmutableSet.of(key)), ImmutableSet.of(key)) .get(key); } @Override public Map<Cell, byte[]> loadAll(Iterable<? extends Cell> keys) throws Exception { Set<Cell> keySet = ImmutableSet.copyOf(keys); return setMissingKeysToEmpty(CachingTransaction.super.get(tableRef, ImmutableSet.copyOf(keys)), keySet); } }; }
Source:
void deleteAll() { assertThrows(IllegalStateException.class, () -> storage().deleteAll(ImmutableList.of(newId(), newId())) ); }

Target:
void deleteAll() { assertISE(() -> storage().deleteAll(ImmutableList.of(newId(), newId()))); }
Source:
public void checkReferenceSetFoundByAccession() throws AvroRemoteException { final SearchReferenceSetsRequest req = SearchReferenceSetsRequest.newBuilder() .setAccessions(TestData.REFERENCESET_ACCESSIONS) .build(); final SearchReferenceSetsResponse resp = client.references.searchReferenceSets(req); final List<ReferenceSet> refSets = resp.getReferenceSets(); assertThat(refSets).hasSize(1); final ReferenceSet refSet = refSets.get(0); assertThat(refSet.getAssemblyId()).isEqualTo(TestData.REFERENCESET_ASSEMBLY_ID); assertThat(refSet.getMd5checksum()).isEqualTo(TestData.REFERENCESET_MD5_CHECKSUM); assertThat(refSet.getSourceAccessions()).isEqualTo(TestData.REFERENCESET_ACCESSIONS); }

Target:
public void checkReferenceSetFoundByAccession() throws AvroRemoteException { final SearchReferenceSetsRequest req = SearchReferenceSetsRequest.newBuilder() .setAccessions(TestData.REFERENCESET_ACCESSIONS) .build(); final SearchReferenceSetsResponse resp = client.references.searchReferenceSets(req); final List<ReferenceSet> refSets = resp.getReferenceSets(); assertThat(refSets).hasSize(1); final ReferenceSet refSet = refSets.get(0); checkRefSetConstants(refSet); }
Source:
void syncButtonPressed() { if (!ConnectivityStatus.isNetworkAvailable(StandardHomeActivity.this)) { if (ConnectivityStatus.isAirplaneModeOn(StandardHomeActivity.this)) { handleSyncNotAttempted(Localization.get("notification.sync.airplane.action")); CommCareApplication.notificationManager().reportNotificationMessage( NotificationMessageFactory.message( NotificationMessageFactory.StockMessages.Sync_AirplaneMode, AIRPLANE_MODE_CATEGORY)); } else { handleSyncNotAttempted(Localization.get("notification.sync.connections.action")); CommCareApplication.notificationManager().reportNotificationMessage( NotificationMessageFactory.message( NotificationMessageFactory.StockMessages.Sync_NoConnections, AIRPLANE_MODE_CATEGORY)); } FirebaseAnalyticsUtil.reportSyncFailure( AnalyticsParamValue.SYNC_TRIGGER_USER, AnalyticsParamValue.SYNC_MODE_SEND_FORMS, AnalyticsParamValue.SYNC_FAIL_NO_CONNECTION); return; } else { ConnectionDiagnosticTask<StandardHomeActivity> task = new ConnectionDiagnosticTask(getApplicationContext()); task.setListener(new ConnectionDiagnosticTask.ConnectionDiagnosticListener<StandardHomeActivity>() { @Override public void connected(StandardHomeActivity receiver) { CommCareApplication.notificationManager().clearNotifications(AIRPLANE_MODE_CATEGORY); receiver.sendFormsOrSync(true); } @Override public void failed(StandardHomeActivity receiver, String errorMessageId, MessageTag notificationTag, String analyticsMessage) { receiver.handleSyncNotAttempted(Localization.get(errorMessageId)); CommCareApplication.notificationManager().reportNotificationMessage( NotificationMessageFactory.message( notificationTag, AIRPLANE_MODE_CATEGORY)); FirebaseAnalyticsUtil.reportSyncFailure( AnalyticsParamValue.SYNC_TRIGGER_USER, AnalyticsParamValue.SYNC_MODE_SEND_FORMS, analyticsMessage); } }); task.connect(StandardHomeActivity.this); task.executeParallel(); } }

Target:
void syncButtonPressed() { ConnectionDiagnosticTask<StandardHomeActivity> task = new ConnectionDiagnosticTask(getApplicationContext()); task.setListener(new ConnectionDiagnosticTask.ConnectionDiagnosticListener<StandardHomeActivity>() { @Override public void connected(StandardHomeActivity receiver) { CommCareApplication.notificationManager().clearNotifications(AIRPLANE_MODE_CATEGORY); receiver.sendFormsOrSync(true); } @Override public void failed(StandardHomeActivity receiver, String errorMessageId, MessageTag notificationTag, String analyticsMessage) { receiver.handleSyncNotAttempted(Localization.get(errorMessageId)); CommCareApplication.notificationManager().reportNotificationMessage( NotificationMessageFactory.message( notificationTag, AIRPLANE_MODE_CATEGORY)); FirebaseAnalyticsUtil.reportSyncFailure( AnalyticsParamValue.SYNC_TRIGGER_USER, AnalyticsParamValue.SYNC_MODE_SEND_FORMS, analyticsMessage); } }); task.connect(StandardHomeActivity.this); task.executeParallel(); }
Source:
public void suspendMachine(MachineLocation rawLocation) { String instanceId = vmInstanceIds.remove(rawLocation); if (instanceId == null) { LOG.info("Attempt to suspend unknown machine " + rawLocation + " in " + this); throw new IllegalArgumentException("Unknown machine " + rawLocation); } getComputeService().suspendNode(instanceId); }

Target:
public void suspendMachine(MachineLocation rawLocation) { String instanceId = vmInstanceIds.remove(rawLocation); if (instanceId == null) { LOG.info("Attempt to suspend unknown machine " + rawLocation + " in " + this); throw new IllegalArgumentException("Unknown machine " + rawLocation); } LOG.info("Suspending machine in {}, instance id {}", new Object[]{rawLocation, this, instanceId}); Exception toThrow = null; try { getComputeService().suspendNode(instanceId); } catch (Exception e) { toThrow = e; LOG.error("Problem suspending machine " + rawLocation + " in " + this + ", instance id " + instanceId, e); } removeChild(rawLocation); if (toThrow != null) { throw Exceptions.propagate(toThrow); } }
Source:
private void store(LookupEntry newEntry, @Nullable LookupEntry existingEntry) { int newHashCode = translator.removeFieldsForHash(translator.toDbo(newEntry)).hashCode(); Integer existingHashCode = existingEntry == null ? null : translator.removeFieldsForHash(translator.toDbo(existingEntry)).hashCode(); if (existingHashCode != null && newHashCode == existingHashCode) { log.debug("Hash code not changed for URI {}; skipping write", newEntry.uri()); return; } log.debug("New entry or hash code changed for URI {}; writing", newEntry.uri()); lookup.update(MongoBuilders.where().idEquals(newEntry.uri()).build(), translator.toDbo(newEntry), UPSERT, SINGLE); }

Target:
private void store(LookupEntry newEntry, @Nullable LookupEntry existingEntry) { if (existingEntry != null && lookupEntryHasher.writeHashFor(newEntry) == lookupEntryHasher.writeHashFor(existingEntry)) { log.debug("Hash code not changed for URI {}; skipping write", newEntry.uri()); return; } log.debug("New entry or hash code changed for URI {}; writing", newEntry.uri()); lookup.update(MongoBuilders.where().idEquals(newEntry.uri()).build(), translator.toDbo(newEntry), UPSERT, SINGLE); }
Source:
private static void addHostNetworksAndUpdateInterfaces(VDS vds, Map<String, Object> xmlRpcStruct) { Map<String, Object> networks = (Map<String, Object>) xmlRpcStruct.get(VdsProperties.NETWORKS); Map<String, Object> bridges = (Map<String, Object>) xmlRpcStruct.get(VdsProperties.NETWORK_BRIDGES); Map<String, VdsNetworkInterface> vdsInterfaces = Entities.entitiesByName(vds.getInterfaces()); boolean bridgesReported = FeatureSupported.bridgesReportByVdsm(vds.getVdsGroupCompatibilityVersion()); if (networks != null) { vds.getNetworks().clear(); for (Entry<String, Object> entry : networks.entrySet()) { Map<String, Object> network = (Map<String, Object>) entry.getValue(); if (network != null) { String interfaceName = (String) network.get(VdsProperties.INTERFACE); VdsNetworkInterface networkIface = vdsInterfaces.get(interfaceName); Map<String, Object> bridge = (bridges == null) ? null : (Map<String, Object>) bridges.get(interfaceName); boolean bridgedNetwork = isBridgedNetwork(network); HostNetworkQos qos = new HostNetworkQosMapper(network).deserialize(); Network net = createNetworkData(entry.getKey(), network); List<VdsNetworkInterface> interfaces = findNetworkInterfaces(vdsInterfaces, bridgesReported, networkIface, bridgesReported ? bridge : network); for (VdsNetworkInterface iface : interfaces) { updateNetworkDetailsInInterface(iface, network, bridgedNetwork, qos, vds, net); } vds.getNetworks().add(net); reportInvalidInterfacesForNetwork(interfaces, net, vds); } } } }

Target:
private static void addHostNetworksAndUpdateInterfaces(VDS vds, Map<String, Object> xmlRpcStruct) { Map<String, Map<String, Object>> networks = (Map<String, Map<String, Object>>) xmlRpcStruct.get(VdsProperties.NETWORKS); Map<String, Map<String, Object>> bridges = (Map<String, Map<String, Object>>) xmlRpcStruct.get(VdsProperties.NETWORK_BRIDGES); Map<String, VdsNetworkInterface> vdsInterfaces = Entities.entitiesByName(vds.getInterfaces()); boolean bridgesReported = FeatureSupported.bridgesReportByVdsm(vds.getVdsGroupCompatibilityVersion()); if (networks != null) { vds.getNetworks().clear(); for (Entry<String, Map<String, Object>> entry : networks.entrySet()) { Map<String, Object> network = entry.getValue(); if (network != null) { String interfaceName = (String) network.get(VdsProperties.INTERFACE); boolean bridgedNetwork = isBridgedNetwork(network); HostNetworkQos qos = new HostNetworkQosMapper(network).deserialize(); Network net = createNetworkData(entry.getKey(), network); List<VdsNetworkInterface> interfaces = bridgesReported ? findNetworkInterfaces(vdsInterfaces, interfaceName, bridges) : findBridgedNetworkInterfaces(network, vdsInterfaces); for (VdsNetworkInterface iface : interfaces) { updateNetworkDetailsInInterface(iface, network, bridgedNetwork, qos, vds, net); } vds.getNetworks().add(net); reportInvalidInterfacesForNetwork(interfaces, net, vds); } } } }
Source:
List<ICompletionProposal> computeFilteredProposals(int offset, DocumentEvent event) { if (offset == fInvocationOffset && event == null) { fIsFilteredSubset= false; return fComputedProposals; } if (offset < fInvocationOffset) { fIsFilteredSubset= false; fInvocationOffset= offset; fContentAssistant.fireSessionRestartEvent(); fComputedProposals= computeProposals(fInvocationOffset); return fComputedProposals; } List<ICompletionProposal> proposals; if (offset < fFilterOffset) { proposals= fComputedProposals; fIsFilteredSubset= false; } else { proposals= fFilteredProposals; fIsFilteredSubset= true; } if (proposals == null) { fIsFilteredSubset= false; return null; } IDocument document= fContentAssistSubjectControlAdapter.getDocument(); int length= proposals.size(); List<ICompletionProposal> filtered= new ArrayList<>(length); boolean recompute= false; for (ICompletionProposal proposal : proposals) { if (proposal instanceof ICompletionProposalExtension2) { ICompletionProposalExtension2 p= (ICompletionProposalExtension2) proposal; try { if (p.validate(document, offset, event)) filtered.add(proposal); } catch (RuntimeException e) { } } else if (proposal instanceof ICompletionProposalExtension) { ICompletionProposalExtension p= (ICompletionProposalExtension) proposal; try { if (p.isValidFor(document, offset)) filtered.add(proposal); } catch (RuntimeException e) { } } else { return recomputeProposals(offset, event); } } return filtered; }

Target:
List<ICompletionProposal> computeFilteredProposals(int offset, DocumentEvent event) { if (offset == fInvocationOffset && event == null) { fIsFilteredSubset= false; return fComputedProposals; } if (offset < fInvocationOffset) { fIsFilteredSubset= false; fInvocationOffset= offset; fContentAssistant.fireSessionRestartEvent(); fComputedProposals= computeProposals(fInvocationOffset); return fComputedProposals; } List<ICompletionProposal> proposals; if (offset < fFilterOffset) { proposals= fComputedProposals; fIsFilteredSubset= false; } else { proposals= fFilteredProposals; fIsFilteredSubset= true; } if (proposals == null) { fIsFilteredSubset= false; return null; } IDocument document= fContentAssistSubjectControlAdapter.getDocument(); int length= proposals.size(); List<ICompletionProposal> filtered= new ArrayList<>(length); for (ICompletionProposal proposal : proposals) { if (proposal instanceof ICompletionProposalExtension2) { ICompletionProposalExtension2 p= (ICompletionProposalExtension2) proposal; try { if (p.validate(document, offset, event)) filtered.add(proposal); } catch (RuntimeException e) { } } else if (proposal instanceof ICompletionProposalExtension) { ICompletionProposalExtension p= (ICompletionProposalExtension) proposal; try { if (p.isValidFor(document, offset)) filtered.add(proposal); } catch (RuntimeException e) { } } else { return recomputeProposals(offset, event); } } return filtered; }
Source:
public static @Nullable SegmentStoreDataProvider create(ITmfTrace trace, @Nullable ISegmentStoreProvider provider) { if (provider == null) { return null; } if (provider instanceof IAnalysisModule) { ((IAnalysisModule) provider).schedule(); } return new SegmentStoreDataProvider(trace, provider); }

Target:
public static @Nullable SegmentStoreDataProvider create(ITmfTrace trace, @Nullable ISegmentStoreProvider provider) { if (provider == null) { return null; } if (provider instanceof IAnalysisModule) { ((IAnalysisModule) provider).schedule(); return new SegmentStoreDataProvider(trace, provider); } return null; }
Source:
public FeatureVectorParser(String exampleFile, String lexiconFile) { this(exampleFile); ObjectInputStream lexIn = null; try { lexIn = new ObjectInputStream(new FileInputStream(lexiconFile)); } catch (Exception e) { logger.error("Can't open '" + lexiconFile + "' for input:"); e.printStackTrace(); System.exit(1); } try { lexicon = (Feature[]) lexIn.readObject(); } catch (Exception e) { logger.error("Can't read from '" + lexiconFile + "':"); e.printStackTrace(); System.exit(1); } try { lexIn.close(); } catch (Exception e) { logger.error("Can't close '" + lexiconFile + "':"); e.printStackTrace(); System.exit(1); } }

Target:
public FeatureVectorParser(String exampleFile, String lexiconFile) { this(exampleFile); ObjectInputStream lexIn = null; try { lexIn = new ObjectInputStream(new FileInputStream(lexiconFile)); } catch (Exception e) { System.err.println("Can't open '" + lexiconFile + "' for input:"); e.printStackTrace(); System.exit(1); } try { lexicon = (Feature[]) lexIn.readObject(); } catch (Exception e) { System.err.println("Can't read from '" + lexiconFile + "':"); e.printStackTrace(); System.exit(1); } try { lexIn.close(); } catch (Exception e) { System.err.println("Can't close '" + lexiconFile + "':"); e.printStackTrace(); System.exit(1); } }
Source:
private void setAttribute(Element element, String name, String value) { if (name.endsWith("$")) { return; } if (value.contains("{{") && value.contains("}}")) { return; } if (value.contains("[[") && value.contains("]]")) { return; } element.setAttribute(name, value); }

Target:
private void setAttribute(Element element, String name, String value) { if (name.endsWith("$")) { getLogger().debug( "Template contains an attribute in element which " + "ends with $ and ignored by initialization since this is an attribute binding", templateClass.getSimpleName(), name, element.getTag()); return; } if (value.contains("{{") && value.contains("}}")) { getLogger().debug( "Template contains an attribute in element whose value" + " contains two-way binding and it's ignored by initilization", templateClass.getSimpleName(), name, element.getTag()); return; } if (value.contains("[[") && value.contains("]]")) { getLogger().debug( "Template contains an attribute in element whose value" + " contains binding and it's ignored by initilization", templateClass.getSimpleName(), name, element.getTag()); return; } element.setAttribute(name, value); }