auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createAndCheckCluster(String compressorOption) { try (Cluster cluster = ClusterUtils.newCluster(ccmRule, compressorOption, "request.timeout = 30 seconds")) { Session session = cluster.connect(schemaClusterRule.keyspace()); ResultSet rs = session.execute( SimpleStatement.newInstance( "INSERT INTO test (k, t, i, f) VALUES (?, ?, ?, ?)", "key", "foo", 42, 24.03f)); assertThat(rs.iterator().hasNext()).isFalse(); ResultSet rs1 = session.execute("SELECT * FROM test WHERE k = 'key'"); assertThat(rs1.iterator().hasNext()).isTrue(); Row row = rs1.iterator().next(); assertThat(rs1.iterator().hasNext()).isFalse(); assertThat(row.getString("k")).isEqualTo("key"); assertThat(row.getString("t")).isEqualTo("foo"); assertThat(row.getInt("i")).isEqualTo(42); assertThat(row.getFloat("f")).isEqualTo(24.03f, offset(0.1f)); } }

Target:
private void createAndCheckCluster(String compressorOption) { try (Cluster cluster = ClusterUtils.newCluster(ccmRule, compressorOption)) { Session session = cluster.connect(schemaClusterRule.keyspace()); ResultSet rs = session.execute( SimpleStatement.newInstance( "INSERT INTO test (k, t, i, f) VALUES (?, ?, ?, ?)", "key", "foo", 42, 24.03f)); assertThat(rs.iterator().hasNext()).isFalse(); ResultSet rs1 = session.execute("SELECT * FROM test WHERE k = 'key'"); assertThat(rs1.iterator().hasNext()).isTrue(); Row row = rs1.iterator().next(); assertThat(rs1.iterator().hasNext()).isFalse(); assertThat(row.getString("k")).isEqualTo("key"); assertThat(row.getString("t")).isEqualTo("foo"); assertThat(row.getInt("i")).isEqualTo(42); assertThat(row.getFloat("f")).isEqualTo(24.03f, offset(0.1f)); } }
Source:
public void verifyAppearsOn(String articleName) { PageObjectLogging.log("Verify correct article title", "title correct", appearsListing.getText().equals(articleName)); }

Target:
public void verifyAppearsOn(String articleName) { Assertion.assertTrue(appearsListing.getText().equals(articleName)); }
Source:
public static OzoneAcl convertOzoneAcl(OzoneAclInfo aclInfo) { ACLIdentityType aclType; switch (aclInfo.getType()) { case USER: aclType = ACLIdentityType.USER; break; case GROUP: aclType = ACLIdentityType.GROUP; break; case WORLD: aclType = ACLIdentityType.WORLD; break; case ANONYMOUS: aclType = ACLIdentityType.ANONYMOUS; break; case CLIENT_IP: aclType = ACLIdentityType.CLIENT_IP; break; default: throw new IllegalArgumentException("ACL type is not recognized"); } BitSet aclRights = new BitSet(aclInfo.getRightsList().size()); aclInfo.getRightsList().parallelStream().forEach(a -> aclRights.set(ACLType.valueOf(a.name()).ordinal())); return new OzoneAcl(aclType, aclInfo.getName(), aclRights); }

Target:
public static OzoneAcl convertOzoneAcl(OzoneAclInfo aclInfo) { ACLIdentityType aclType; switch (aclInfo.getType()) { case USER: aclType = ACLIdentityType.USER; break; case GROUP: aclType = ACLIdentityType.GROUP; break; case WORLD: aclType = ACLIdentityType.WORLD; break; case ANONYMOUS: aclType = ACLIdentityType.ANONYMOUS; break; case CLIENT_IP: aclType = ACLIdentityType.CLIENT_IP; break; default: throw new IllegalArgumentException("ACL type is not recognized"); } BitSet aclRights = new BitSet(ACLType.getNoOfAcls()); aclInfo.getRightsList().stream().forEach(a -> aclRights.set(ACLType.valueOf(a.name()).ordinal())); return new OzoneAcl(aclType, aclInfo.getName(), aclRights); }
Source:
public List<DriverRecord> write(final List<DriverRecord> records) throws ConnectionException { if (isBusy.get()) { throw new ConnectionException(message.errorDriverBusy()); } if (this.client == null) { this.connect(); } for (final DriverRecord record : records) { OpcUaRequestInfo requestInfo = OpcUaRequestInfo.extract(record); if (requestInfo == null) { continue; } final TypedValue<?> value = record.getValue(); final NodeId nodeId = new NodeId(requestInfo.nodeNamespaceIndex, requestInfo.nodeId); final VariableNode node = this.client.getAddressSpace().createVariableNode(nodeId); final DataValue newValue = new DataValue(new Variant(value.getValue())); try { logger.debug("writing: to ns={};s={}..", value, requestInfo.nodeNamespaceIndex, requestInfo.nodeId); checkStatus(runSafe(node.writeValue(newValue))); record.setDriverStatus(new DriverStatus(WRITE_SUCCESSFUL)); logger.debug("write successful"); } catch (final Exception e) { record.setDriverStatus(new DriverStatus(WRITE_FAILURE, message.writeFailed(), e)); logger.warn(message.writeFailed(), e); } record.setTimestamp(System.currentTimeMillis()); } return Collections.unmodifiableList(records); }

Target:
public List<DriverRecord> write(final List<DriverRecord> records) throws ConnectionException { if (isBusy.get()) { throw new ConnectionException(message.errorDriverBusy()); } if (this.client == null) { this.connect(); } for (final DriverRecord record : records) { OpcUaRequestInfo.extract(record).ifPresent((requestInfo) -> { final TypedValue<?> value = record.getValue(); final NodeId nodeId = new NodeId(requestInfo.nodeNamespaceIndex, requestInfo.nodeId); final VariableNode node = this.client.getAddressSpace().createVariableNode(nodeId); final DataValue newValue = new DataValue(new Variant(value.getValue())); try { logger.debug("writing: to ns={};s={}..", value, requestInfo.nodeNamespaceIndex, requestInfo.nodeId); checkStatus(runSafe(node.writeValue(newValue))); record.setDriverStatus(new DriverStatus(WRITE_SUCCESSFUL)); logger.debug("write successful"); } catch (final Exception e) { record.setDriverStatus(new DriverStatus(WRITE_FAILURE, message.writeFailed(), e)); logger.warn(message.writeFailed(), e); } record.setTimestamp(System.currentTimeMillis()); }); } return Collections.unmodifiableList(records); }
Source:
public boolean friendlyFireCheck(Entity shooter, IGame game, Coords position, boolean includeMobileUnits) { if(friendlyFireCheckResults.containsKey(position)) { return friendlyFireCheckResults.get(position); } Building building = game.getBoard().getBuildingAt(position); if (building == null) { friendlyFireCheckResults.put(position, false); return false; } for(Entity entity : game.getEntitiesVector(position, true)) { if(!entity.isEnemyOf(shooter) && (includeMobileUnits || (entity.getWalkMP(true, false) == 0))) { friendlyFireCheckResults.put(position, true); return true; } } friendlyFireCheckResults.put(position, false); return false; }

Target:
private boolean friendlyFireCheck(Entity shooter, IGame game, Coords position, boolean includeMobileUnits) { if (friendlyFireCheckResults.containsKey(position)) { return friendlyFireCheckResults.get(position); } Building building = game.getBoard().getBuildingAt(position); if (building == null) { friendlyFireCheckResults.put(position, false); return false; } for (Entity entity : game.getEntitiesVector(position, true)) { if (!entity.isEnemyOf(shooter) && (includeMobileUnits || (entity.getWalkMP(true, false) == 0))) { friendlyFireCheckResults.put(position, true); return true; } } friendlyFireCheckResults.put(position, false); return false; }
Source:
protected boolean shouldAttemptLookup(CacheEntry e) { return e == null || (e.isNull() || e.getValue() == null) && !e.skipRemoteGet(); }

Target:
protected boolean shouldAttemptLookup(CacheEntry e) { return e == null || (e.isNull() || e.getValue() == null) && !e.skipLookup(); }
Source:
protected boolean checkKeyIntent( int authUid, Intent intent) throws SecurityException { long bid = Binder.clearCallingIdentity(); try { PackageManager pm = mContext.getPackageManager(); ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId); if (resolveInfo == null) { return false; } ActivityInfo targetActivityInfo = resolveInfo.activityInfo; int targetUid = targetActivityInfo.applicationInfo.uid; if (!isExportedSystemActivity(targetActivityInfo) && (PackageManager.SIGNATURE_MATCH != pm.checkSignatures(authUid, targetUid))) { String pkgName = targetActivityInfo.packageName; String activityName = targetActivityInfo.name; String tmpl = "KEY_INTENT resolved to an Activity (%s) in a package (%s) that " + "does not share a signature with the supplying authenticator (%s)."; throw new SecurityException( String.format(tmpl, activityName, pkgName, mAccountType)); } return true; } catch (SecurityException se) { return false; } finally { Binder.restoreCallingIdentity(bid); } }

Target:
protected boolean checkKeyIntent(int authUid, Intent intent) { long bid = Binder.clearCallingIdentity(); try { PackageManager pm = mContext.getPackageManager(); ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId); if (resolveInfo == null) { return false; } ActivityInfo targetActivityInfo = resolveInfo.activityInfo; int targetUid = targetActivityInfo.applicationInfo.uid; if (!isExportedSystemActivity(targetActivityInfo) && (PackageManager.SIGNATURE_MATCH != pm.checkSignatures(authUid, targetUid))) { String pkgName = targetActivityInfo.packageName; String activityName = targetActivityInfo.name; String tmpl = "KEY_INTENT resolved to an Activity (%s) in a package (%s) that " + "does not share a signature with the supplying authenticator (%s)."; Log.e(TAG, String.format(tmpl, activityName, pkgName, mAccountType)); return false; } return true; } finally { Binder.restoreCallingIdentity(bid); } }
Source:
private static boolean isExtended(ClassTree classTree) { List<IdentifierTree> usages = classTree.symbol().usages(); return usages.stream().anyMatch(usage -> { Tree parent = usage.parent(); return parent != null && parent.is(Kind.CLASS); }); }

Target:
private static boolean isExtended(ClassTree classTree) { IsExtendedVisitor isExtendedVisitor = new IsExtendedVisitor(classTree.symbol().type()); classTree.accept(isExtendedVisitor); return isExtendedVisitor.isExtended; }
Source:
protected void validateRespPayloadAndExchangeType( List<IkePayload> respPayloads, @ExchangeType int exchangeType) throws InvalidSyntaxException { if (exchangeType != EXCHANGE_TYPE_INFORMATIONAL) { throw new InvalidSyntaxException( "Unexpected exchange type in Delete Child response: " + exchangeType); } for (IkePayload payload : respPayloads) { handlePayload: switch (payload.payloadType) { case PAYLOAD_TYPE_DELETE: break; case PAYLOAD_TYPE_NOTIFY: IkeNotifyPayload notify = (IkeNotifyPayload) payload; if (!notify.isErrorNotify()) { logw( "Unexpected or unknown status notification in Delete Child" + " response: " + notify.notifyType); break handlePayload; } throw new UnsupportedOperationException( "Cannot handle error notifications in a Delete Child response"); default: throw new InvalidSyntaxException( "Unexpected payload found in Delete Child response: " + payload.payloadType); } } }

Target:
protected void validateRespPayloadAndExchangeType( List<IkePayload> respPayloads, @ExchangeType int exchangeType) throws InvalidSyntaxException { if (exchangeType != EXCHANGE_TYPE_INFORMATIONAL) { throw new InvalidSyntaxException( "Unexpected exchange type in Delete Child response: " + exchangeType); } for (IkePayload payload : respPayloads) { handlePayload: switch (payload.payloadType) { case PAYLOAD_TYPE_DELETE: break handlePayload; case PAYLOAD_TYPE_NOTIFY: IkeNotifyPayload notify = (IkeNotifyPayload) payload; if (!notify.isErrorNotify()) { logw( "Unexpected or unknown status notification in Delete Child" + " response: " + notify.notifyType); break handlePayload; } throw new UnsupportedOperationException( "Cannot handle error notifications in a Delete Child response"); default: throw new InvalidSyntaxException( "Unexpected payload found in Delete Child response: " + payload.payloadType); } } }
Source:
protected PathRef getExistingUserWorkspace(CoreSession session, PathRef rootref, NuxeoPrincipal principal, String username) { UserManager userManager = Framework.getService(UserManager.class); if (principal == null) { principal = userManager.getPrincipal(username); } PathRef freeRef = null; for (String name : getCandidateUserWorkspaceNames(username)) { PathRef ref = new PathRef(rootref, name); if (session.exists(ref) && principal != null && session.hasPermission(principal, ref, SecurityConstants.EVERYTHING)) { return ref; } @SuppressWarnings("boxing") boolean exists = CoreInstance.doPrivileged(session, (CoreSession s) -> s.exists(ref)); if (!exists && freeRef == null) { freeRef = ref; } } if (freeRef != null) { PathRef ref = freeRef; String path = CoreInstance.doPrivileged(session, s -> { DocumentModel uwsModel = doCreateUserWorkspace(session, ref, username); return s.getOrCreateDocument(uwsModel, doc -> initCreateUserWorkspace(s, doc, username)) .getPathAsString(); }); return new PathRef(path); } throw new DocumentSecurityException(username); }

Target:
protected PathRef getExistingUserWorkspace(CoreSession session, PathRef rootref, NuxeoPrincipal principal, String username) { if (principal == null) { principal = Framework.getService(UserManager.class).getPrincipal(username); } PathRef freeRef = null; for (String name : getCandidateUserWorkspaceNames(username)) { PathRef ref = new PathRef(rootref, name); if (session.exists(ref) && principal != null && session.hasPermission(principal, ref, SecurityConstants.EVERYTHING)) { return ref; } @SuppressWarnings("boxing") boolean exists = CoreInstance.doPrivileged(session, (CoreSession s) -> s.exists(ref)); if (!exists && freeRef == null) { freeRef = ref; } } if (freeRef != null) { PathRef ref = freeRef; String path = CoreInstance.doPrivileged(session, s -> { DocumentModel uwsModel = doCreateUserWorkspace(session, ref, username); return s.getOrCreateDocument(uwsModel, doc -> initCreateUserWorkspace(s, doc, username)) .getPathAsString(); }); return new PathRef(path); } throw new DocumentSecurityException(username); }
Source:
public void finish() { Intent intent = new Intent(); Bundle bundle = new Bundle(); String string; if (mType == DELETED) { string = getString(R.string.delete_announcement); } else if (mType == EDITED) { string = getString(R.string.edit_announcement); } else { string = null; } bundle.putString(string, NetworkUtils.writeAsString(this, mAnnouncement)); bundle.putInt(getString(R.string.announcement_type), mType); intent.putExtras(bundle); setResult(Activity.RESULT_OK, intent); super.finish(); }

Target:
public void finish() { Intent intent = new Intent(); Bundle bundle = new Bundle(); String string; switch (mType) { case ORIGINAL: string = null; break; default: string = getString(R.string.change_announcement); } bundle.putString(string, NetworkUtils.writeAsString(this, mAnnouncement)); bundle.putInt(getString(R.string.announcement_type), mType); intent.putExtras(bundle); setResult(Activity.RESULT_OK, intent); super.finish(); }
Source:
private List<Long> getConsecutiveSkipsCount(final Long accountId, final int tzOffsetMillis) { final List<Long> skippedIds = new ArrayList<>(); final DateTime today = DateTime.now(DateTimeZone.UTC).plusMillis(tzOffsetMillis).withTimeAtStartOfDay(); final List<Response> responses = this.questionResponseDAO.getLastFewResponses(accountId, this.checkSkipsNum); for (final Response response : responses) { if (response.skip == null && response.askTime.isEqual(today)) { continue; } Boolean skip = null; if (response.skip != null) { if (response.skip.isPresent()) { skip = response.skip.get(); } } if (skip != null && !skip) { break; } skippedIds.add(response.accountQuestionId); } return skippedIds; }

Target:
private List<Long> getConsecutiveSkipsCount(final Long accountId, final int tzOffsetMillis) { final List<Long> skippedIds = new ArrayList<>(); final DateTime today = DateTime.now(DateTimeZone.UTC).plusMillis(tzOffsetMillis).withTimeAtStartOfDay(); final List<Response> responses = this.questionResponseDAO.getLastFewResponses(accountId, this.checkSkipsNum); for (final Response response : responses) { if (response.skip == null && response.askTime.isEqual(today)) { continue; } Boolean skip = null; if (response.skip != null) { skip = response.skip.get(); } if (skip != null && !skip) { break; } skippedIds.add(response.accountQuestionId); } return skippedIds; }
Source:
protected void setUp() throws Exception { super.setUp(); configurationManager.getConfiguration(). addPackageConfig("foo", new PackageConfig.Builder("foo").namespace("/namespace").build()); view = new ServletRedirectResult(); container.inject(view); responseMock = new Mock(HttpServletResponse.class); requestMock = new Mock(HttpServletRequest.class); requestMock.matchAndReturn("getContextPath", "/context"); ResultConfig resultConfig = new ResultConfig.Builder("", "").build(); Map<String, ResultConfig> results = new HashMap<>(); results.put("myResult", resultConfig); ActionConfig actionConfig = new ActionConfig.Builder("", "", "") .addResultConfigs(results).build(); ActionContext ac = ActionContext.getContext(); ac.setServletRequest((HttpServletRequest) requestMock.proxy()); ac.setServletResponse((HttpServletResponse) responseMock.proxy()); MockActionInvocation ai = new MockActionInvocation(); ai.setInvocationContext(ac); ai.setResultCode("myResult"); ai.setInvocationContext(ac); ActionProxy mockActionProxy = createNiceMock(ActionProxy.class); ai.setProxy(mockActionProxy); expect(mockActionProxy.getConfig()).andReturn(actionConfig).anyTimes(); replay(mockActionProxy); ai.setStack(ActionContext.getContext().getValueStack()); this.ai = ai; }

Target:
protected void setUp() throws Exception { super.setUp(); configurationManager.getConfiguration(). addPackageConfig("foo", new PackageConfig.Builder("foo").namespace("/namespace").build()); view = new ServletRedirectResult(); container.inject(view); responseMock = new Mock(HttpServletResponse.class); requestMock = new Mock(HttpServletRequest.class); requestMock.matchAndReturn("getContextPath", "/context"); ResultConfig resultConfig = new ResultConfig.Builder("", "").build(); Map<String, ResultConfig> results = new HashMap<>(); results.put("myResult", resultConfig); ActionConfig actionConfig = new ActionConfig.Builder("", "", "") .addResultConfigs(results).build(); ActionContext ac = ActionContext.getContext(); ac.withServletRequest((HttpServletRequest) requestMock.proxy()); ac.withServletResponse((HttpServletResponse) responseMock.proxy()); MockActionInvocation ai = new MockActionInvocation(); ai.setInvocationContext(ac); ai.setResultCode("myResult"); ActionProxy mockActionProxy = createNiceMock(ActionProxy.class); ai.setProxy(mockActionProxy); expect(mockActionProxy.getConfig()).andReturn(actionConfig).anyTimes(); replay(mockActionProxy); ai.setStack(ActionContext.getContext().getValueStack()); this.ai = ai; }
Source:
private void createParameterNames(List<AnyParameter> parameterTrees, @Nullable String fileId) { ParameterState parameterState = new ParameterState(); for (AnyParameter anyParameter : parameterTrees) { if (anyParameter.is(Tree.Kind.PARAMETER)) { org.sonar.plugins.python.api.tree.Parameter parameter = (org.sonar.plugins.python.api.tree.Parameter) anyParameter; Token starToken = parameter.starToken(); if (starToken != null && "/".equals(starToken.value())) { parameterState.positionalOnly = true; } } } for (AnyParameter anyParameter : parameterTrees) { if (anyParameter.is(Tree.Kind.PARAMETER)) { addParameter((org.sonar.plugins.python.api.tree.Parameter) anyParameter, fileId, parameterState); } else { parameters.add(new ParameterImpl(null, InferredTypes.anyType(), false, false, parameterState, locationInFile(anyParameter, fileId))); } } }

Target:
private void createParameterNames(List<AnyParameter> parameterTrees, @Nullable String fileId) { ParameterState parameterState = new ParameterState(); parameterState.positionalOnly = parameterTrees.stream().anyMatch(param -> Optional.of(param) .filter(p -> p.is(Tree.Kind.PARAMETER)) .map(p -> ((org.sonar.plugins.python.api.tree.Parameter) p).starToken()) .map(Token::value) .filter("/"::equals) .isPresent() ); for (AnyParameter anyParameter : parameterTrees) { if (anyParameter.is(Tree.Kind.PARAMETER)) { addParameter((org.sonar.plugins.python.api.tree.Parameter) anyParameter, fileId, parameterState); } else { parameters.add(new ParameterImpl(null, InferredTypes.anyType(), false, false, parameterState, locationInFile(anyParameter, fileId))); } } }
Source:
private ReplicaMetadataResponseInfo(PartitionId partitionId, FindToken findToken, List<MessageInfo> messageInfoList, long remoteReplicaLagInBytes, short replicaMetadataResponseVersion) { if (partitionId == null || findToken == null || messageInfoList == null) { throw new IllegalArgumentException( "Invalid partition or token or message info list for ReplicaMetadataResponseInfo"); } this.partitionId = partitionId; this.remoteReplicaLagInBytes = remoteReplicaLagInBytes; messageInfoAndMetadataListSerde = new MessageInfoAndMetadataListSerde(messageInfoList, getMessageInfoListVersion(replicaMetadataResponseVersion)); messageInfoListSize = messageInfoAndMetadataListSerde.getMessageInfoAndMetadataListSize(); this.token = findToken; this.errorCode = ServerErrorCode.No_Error; }

Target:
private ReplicaMetadataResponseInfo(PartitionId partitionId, FindToken findToken, List<MessageInfo> messageInfoList, long remoteReplicaLagInBytes, short replicaMetadataResponseVersion) { if (partitionId == null || findToken == null || messageInfoList == null) { throw new IllegalArgumentException( "Invalid partition or token or message info list for ReplicaMetadataResponseInfo"); } this.partitionId = partitionId; this.remoteReplicaLagInBytes = remoteReplicaLagInBytes; messageInfoAndMetadataListSerde = new MessageInfoAndMetadataListSerde(messageInfoList, getMessageInfoAndMetadataListSerDeVersion(replicaMetadataResponseVersion)); messageInfoListSize = messageInfoAndMetadataListSerde.getMessageInfoAndMetadataListSize(); this.token = findToken; this.errorCode = ServerErrorCode.No_Error; }
Source:
public void makeSortable(String sortBy) { setSortable(true); this.sortBy = sortBy; }

Target:
public void makeSortable(String sortBy) { assert sortBy != null : "sortBy cannot be null"; this.sortBy = sortBy; this.comparator = null; setSortable(true); }
Source:
private ImmutableList<UpdaterConfiguration> makeRoviConfigurations() { ImmutableSet<Publisher> targetSources = ImmutableSet.of( Publisher.BBC, Publisher.PA, Publisher.YOUVIEW, Publisher.BBC_NITRO, Publisher.BBC_REDUX, Publisher.ITV, Publisher.C4_PMLSD, Publisher.C4_PMLSD_P06, FIVE ); return ImmutableList.of(ROVI_EN_GB, ROVI_EN_US) .stream() .map(source -> UpdaterConfiguration.builder() .withSource(source) .withItemEquivalenceUpdater( ROVI_ITEM, targetSources ) .withTopLevelContainerEquivalenceUpdater( STANDARD_TOP_LEVEL_CONTAINER, targetSources ) .withNonTopLevelContainerEquivalenceUpdater( NOP_CONTAINER, ImmutableSet.of() ) .build()) .collect(MoreCollectors.toImmutableList()); }

Target:
private ImmutableList<UpdaterConfiguration> makeRoviConfigurations() { ImmutableSet<Publisher> targetSources = ImmutableSet.of( Publisher.BBC, Publisher.PA, Publisher.YOUVIEW, Publisher.BBC_NITRO, Publisher.BBC_REDUX, Publisher.ITV, Publisher.C4_PMLSD, Publisher.C4_PMLSD_P06, Publisher.FIVE ); return ImmutableList.of(ROVI_EN_GB, ROVI_EN_US) .stream() .map(source -> UpdaterConfiguration.builder() .withSource(source) .withItemEquivalenceUpdater( ROVI_ITEM, targetSources ) .withTopLevelContainerEquivalenceUpdater( STANDARD_TOP_LEVEL_CONTAINER, targetSources ) .withNonTopLevelContainerEquivalenceUpdater( NOP_CONTAINER, ImmutableSet.of() ) .build()) .collect(MoreCollectors.toImmutableList()); }
Source:
private Path findFilteredPaths(OverridableConf queryContext, String tableName, Schema partitionColumns, EvalNode conjunctiveForms, Path tablePath) throws IOException, UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UndefinedOperatorException, UnsupportedException { Path filteredPaths = null; FileSystem fs = tablePath.getFileSystem(queryContext.getConf()); String splits = CatalogUtil.splitFQTableName(tableName); List<PartitionDescProto> partitions = null; try { if (conjunctiveForms == null) { partitions = catalog.getPartitionsOfTable(splits[0], splits[1]); if (partitions.isEmpty()) { filteredPaths = findFilteredPathsFromFileSystem(partitionColumns, conjunctiveForms, fs, tablePath); } else { filteredPaths = findFilteredPathsByPartitionDesc(partitions); } } else { if (catalog.existPartitions(splits[0], splits[1])) { PartitionsByAlgebraProto request = getPartitionsAlgebraProto(splits[0], splits[1], conjunctiveForms); partitions = catalog.getPartitionsByAlgebra(request); filteredPaths = findFilteredPathsByPartitionDesc(partitions); } else { filteredPaths = findFilteredPathsFromFileSystem(partitionColumns, conjunctiveForms, fs, tablePath); } } } catch (UnsupportedException ue) { LOG.warn(ue.getMessage()); filteredPaths = findFilteredPathsFromFileSystem(partitionColumns, conjunctiveForms, fs, tablePath); } LOG.info("Filtered directory or files: " + filteredPaths.length); return filteredPaths; }

Target:
private Path findFilteredPaths(OverridableConf queryContext, String tableName, Schema partitionColumns, EvalNode conjunctiveForms, Path tablePath) throws IOException, UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UndefinedOperatorException, UnsupportedException { return findFilteredPaths(queryContext, tableName, partitionColumns, conjunctiveForms, tablePath, null); }
Source:
public void stop() { log.info("Stopping announcer"); synchronized (toAnnounce) { if (!started) { return; } started = false; Closer closer = Closer.create(); for (NodeCache cache : listeners.values()) { closer.register(cache); } CloseQuietly.close(closer); for (String announcementPath : announcedPaths.keySet()) { unannounce(announcementPath); } if (!pathsCreatedInThisAnnouncer.isEmpty()) { final List<CuratorOp> deleteOps = new ArrayList<>(pathsCreatedInThisAnnouncer.size()); for (String parent : pathsCreatedInThisAnnouncer) { try { deleteOps.add(curator.transactionOp().delete().forPath(parent)); } catch (Exception e) { log.error(e, "Unable to delete parent[%s].", parent); } } try { curator.transaction().forOperations(deleteOps); } catch (Exception e) { log.error(e, "Unable to commit transaction."); } } } }

Target:
public void stop() { log.info("Stopping announcer"); synchronized (toAnnounce) { if (!started) { return; } started = false; Closer closer = Closer.create(); for (NodeCache cache : listeners.values()) { closer.register(cache); } for (String announcementPath : announcedPaths.keySet()) { closer.register(() -> unannounce(announcementPath)); } CloseQuietly.close(closer); if (!pathsCreatedInThisAnnouncer.isEmpty()) { final List<CuratorOp> deleteOps = new ArrayList<>(pathsCreatedInThisAnnouncer.size()); for (String parent : pathsCreatedInThisAnnouncer) { try { deleteOps.add(curator.transactionOp().delete().forPath(parent)); } catch (Exception e) { log.error(e, "Unable to delete parent[%s].", parent); } } try { curator.transaction().forOperations(deleteOps); } catch (Exception e) { log.error(e, "Unable to commit transaction."); } } } }
Source:
public void repositorySelectorTest() { File testConfig = new File(Preferences.DIRECTORY, Preferences.TEST_CONFIG_FILE); if (!(testConfig.exists() && testConfig.isFile())) fail(); assertNodeExists("#repoOwnerField"); type("dummy").push(KeyCode.TAB).type("dummy").push(KeyCode.ENTER); ComboBox<String> comboBox = find("#repositorySelector"); assertEquals(1, comboBox.getItems().size()); assertEquals("dummy/dummy", primaryRepo); click("#dummy/dummy_col0_filterTextField"); type("repo"); press(KeyCode.SHIFT).press(KeyCode.SEMICOLON).release(KeyCode.SEMICOLON).release(KeyCode.SHIFT); type("dummy2/dummy2"); push(KeyCode.ENTER); assertEquals(2, comboBox.getItems().size()); assertEquals("dummy/dummy", primaryRepo); doubleClick(comboBox); doubleClick(); type("dummy3/dummy3"); push(KeyCode.ENTER); assertEquals(3, comboBox.getItems().size()); assertEquals("dummy3/dummy3", primaryRepo); doubleClick(comboBox); doubleClick(); type(" dummy4 / dummy4 "); push(KeyCode.ENTER); assertEquals(4, comboBox.getItems().size()); assertEquals("dummy4/dummy4", primaryRepo); click("Repos"); push(KeyCode.DOWN); push(KeyCode.RIGHT); push(KeyCode.DOWN); push(KeyCode.ENTER); sleep(5000); assertEquals(3, comboBox.getItems().size()); click("File"); click("Quit"); if (!(testConfig.exists() && testConfig.isFile())) fail(); Preferences testPref = new Preferences(true); RepositoryId lastViewedRepository = testPref.getLastViewedRepository().get(); assertEquals("dummy4/dummy4", lastViewedRepository.generateId()); }

Target:
public void repositorySelectorTest() { File testConfig = new File(Preferences.DIRECTORY, Preferences.TEST_CONFIG_FILE); if (!(testConfig.exists() && testConfig.isFile())) fail(); assertNodeExists("#repoOwnerField"); type("dummy").push(KeyCode.TAB).type("dummy").push(KeyCode.ENTER); ComboBox<String> comboBox = find("#repositorySelector"); assertEquals(1, comboBox.getItems().size()); assertEquals("dummy/dummy", primaryRepo); click("#dummy/dummy_col0_filterTextField"); type("repo"); press(KeyCode.SHIFT).press(KeyCode.SEMICOLON).release(KeyCode.SEMICOLON).release(KeyCode.SHIFT); type("dummy2/dummy2"); push(KeyCode.ENTER); assertEquals(2, comboBox.getItems().size()); assertEquals("dummy/dummy", primaryRepo); doubleClick(comboBox); doubleClick(); type("dummy3/dummy3"); push(KeyCode.ENTER); assertEquals(3, comboBox.getItems().size()); assertEquals("dummy3/dummy3", primaryRepo); doubleClick(comboBox); doubleClick(); type(" dummy4 / dummy4 "); push(KeyCode.ENTER); assertEquals(4, comboBox.getItems().size()); assertEquals("dummy4/dummy4", primaryRepo); click("Repos"); push(KeyCode.DOWN); push(KeyCode.RIGHT); push(KeyCode.DOWN); push(KeyCode.ENTER); PlatformEx.waitOnFxThread(); assertEquals(3, comboBox.getItems().size()); click("File"); click("Quit"); if (!(testConfig.exists() && testConfig.isFile())) fail(); Preferences testPref = new Preferences(true); RepositoryId lastViewedRepository = testPref.getLastViewedRepository().get(); assertEquals("dummy4/dummy4", lastViewedRepository.generateId()); }
Source:
public boolean isBehaviour() { ErlangFunction function = getFunction("behaviour_info", 1); return !getCallbackMap().isEmpty() || function != null && function.isExported(); }

Target:
public boolean isBehaviour() { ErlangFileStub stub = getStub(); if (stub != null) return stub.isBehaviour(); ErlangFunction function = getFunction("behaviour_info", 1); return !getCallbackMap().isEmpty() || function != null && function.isExported(); }
Source:
static void purgeOlderSnapshots(FileTxnSnapLog txnLog, File snapShot) { final long leastZxidToBeRetain = Util.getZxidFromName( snapShot.getName(), PREFIX_SNAPSHOT); final Set<File> retainedTxnLogs = new HashSet<File>(); retainedTxnLogs.addAll(Arrays.asList(txnLog.getSnapshotLogs(leastZxidToBeRetain))); class MyFileFilter implements FileFilter{ private final String prefix; MyFileFilter(String prefix){ this.prefix=prefix; } public boolean accept(File f){ if(!f.getName().startsWith(prefix + ".")) return false; if (retainedTxnLogs.contains(f)) { return false; } long fZxid = Util.getZxidFromName(f.getName(), prefix); if (fZxid >= leastZxidToBeRetain) { return false; } return true; } } List<File> files = new ArrayList<File>(); File[] fileArray; if ((fileArray = txnLog.getDataDir().listFiles(new MyFileFilter(PREFIX_LOG))) != null) { files.addAll(Arrays.asList(fileArray)); } if ((fileArray = txnLog.getSnapDir().listFiles(new MyFileFilter(PREFIX_SNAPSHOT))) != null) { files.addAll(Arrays.asList(fileArray)); } for(File f: files) { final String msg = "Removing file: "+ DateFormat.getDateTimeInstance().format(f.lastModified())+ "\t"+f.getPath(); LOG.info(msg); System.out.println(msg); if(!f.delete()){ System.err.println("Failed to remove "+f.getPath()); } } }

Target:
static void purgeOlderSnapshots(FileTxnSnapLog txnLog, File snapShot) { final long leastZxidToBeRetain = Util.getZxidFromName( snapShot.getName(), PREFIX_SNAPSHOT); final Set<File> retainedTxnLogs = new HashSet<File>(); retainedTxnLogs.addAll(Arrays.asList(txnLog.getSnapshotLogs(leastZxidToBeRetain))); class MyFileFilter implements FileFilter{ private final String prefix; MyFileFilter(String prefix){ this.prefix=prefix; } public boolean accept(File f){ if(!f.getName().startsWith(prefix + ".")) return false; if (retainedTxnLogs.contains(f)) { return false; } long fZxid = Util.getZxidFromName(f.getName(), prefix); if (fZxid >= leastZxidToBeRetain) { return false; } return true; } } List<File> files = new ArrayList<File>(); File[] fileArray = txnLog.getDataDir().listFiles(new MyFileFilter(PREFIX_LOG)); if (fileArray != null) { files.addAll(Arrays.asList(fileArray)); } fileArray = txnLog.getSnapDir().listFiles(new MyFileFilter(PREFIX_SNAPSHOT)); if (fileArray != null) { files.addAll(Arrays.asList(fileArray)); } for(File f: files) { final String msg = "Removing file: "+ DateFormat.getDateTimeInstance().format(f.lastModified())+ "\t"+f.getPath(); LOG.info(msg); System.out.println(msg); if(!f.delete()){ System.err.println("Failed to remove "+f.getPath()); } } }
Source:
protected void registerAfterCompletionWithExistingTransaction( Object transaction, List<TransactionSynchronization> synchronizations) throws TransactionException { if(logger.isDebugEnabled()){ logger.debug("Cannot register Spring after-completion synchronization with existing transaction - " + "processing Spring after-completion callbacks immediately, with outcome status 'unknown'"); } invokeAfterCompletion(synchronizations, TransactionSynchronization.STATUS_UNKNOWN); }

Target:
protected void registerAfterCompletionWithExistingTransaction( Object transaction, List<TransactionSynchronization> synchronizations) throws TransactionException { logger.debug("Cannot register Spring after-completion synchronization with existing transaction - " + "processing Spring after-completion callbacks immediately, with outcome status 'unknown'"); invokeAfterCompletion(synchronizations, TransactionSynchronization.STATUS_UNKNOWN); }
Source:
public void boundaryError() { PublishSubject<Integer> pp = PublishSubject.create(); CompletableSubject cs = CompletableSubject.create(); TestObserver<Void> to = pp.concatMapCompletableDelayError( Functions.justFunction(cs), false).test(); to.assertEmpty(); assertTrue(pp.hasObservers()); assertFalse(cs.hasObservers()); pp.onNext(1); assertTrue(cs.hasObservers()); pp.onError(new TestException()); assertTrue(cs.hasObservers()); to.assertEmpty(); cs.onComplete(); to.assertFailure(TestException.class); }

Target:
public void boundaryError() { PublishSubject<Integer> ps = PublishSubject.create(); CompletableSubject cs = CompletableSubject.create(); TestObserver<Void> to = ps.concatMapCompletableDelayError( Functions.justFunction(cs), false).test(); to.assertEmpty(); assertTrue(ps.hasObservers()); assertFalse(cs.hasObservers()); ps.onNext(1); assertTrue(cs.hasObservers()); ps.onError(new TestException()); assertTrue(cs.hasObservers()); to.assertEmpty(); cs.onComplete(); to.assertFailure(TestException.class); }
Source:
public void testBlobFromFileURL() throws Exception { String contentType = "image/png"; Blob blob = null; URL url = null; File path = folder.newFile("attachment.png"); InputStream is = getAsset("attachment.png"); try { byte[] bytes = IOUtils.toByteArray(is); FileOutputStream fos = new FileOutputStream(path); fos.write(bytes); fos.close(); blob = new Blob(contentType, path.toURI().toURL()); } catch(Exception e) { fail(" failed at " + e); } finally { is.close(); } byte[] bytes = IOUtils.toByteArray(path); byte[] content = blob.getContent(); assertTrue(Arrays.equals(content, bytes)); thrown.expect(IllegalArgumentException.class); blob = new Blob(null, url); thrown.expect(IllegalArgumentException.class); blob = new Blob(contentType, (URL) null); thrown.expect(IllegalArgumentException.class); blob = new Blob(contentType, new URL("<LINK_0>")); }

Target:
public void testBlobFromFileURL() throws Exception { String contentType = "image/png"; Blob blob = null; URL url = null; File path = tempFolder.newFile("attachment.png"); InputStream is = getAsset("attachment.png"); try { byte[] bytes = IOUtils.toByteArray(is); FileOutputStream fos = new FileOutputStream(path); fos.write(bytes); fos.close(); blob = new Blob(contentType, path.toURI().toURL()); } catch(Exception e) { fail("Failed when writing to tempFile " + e); } finally { is.close(); } byte[] bytes = IOUtils.toByteArray(path); byte[] content = blob.getContent(); assertTrue(Arrays.equals(content, bytes)); thrown.expect(IllegalArgumentException.class); blob = new Blob(null, url); thrown.expect(IllegalArgumentException.class); blob = new Blob(contentType, (URL) null); thrown.expect(IllegalArgumentException.class); blob = new Blob(contentType, new URL("<LINK_0>")); }
Source:
private void makeSockDiagMsg() { try { for (int family : ADDRESS_FAMILIES) { mSockDiagMsg.put( family, InetDiagMessageShimImpl.newInstance().makeInetDiagReqV2( IPPROTO_TCP, null , null , family, (short) (NLM_F_REQUEST | NLM_F_DUMP) , 0 , 1 << 1 , TCP_MONITOR_STATE_FILTER)); } } catch (ApiNotSupportedException e) { log("Method is not available in this version."); mIsTcpInfoParsingSupported = false; } }

Target:
private void makeSockDiagMsg() { try { final InetDiagMessageShim instance = InetDiagMessageShimImpl.newInstance(); for (int family : ADDRESS_FAMILIES) { mSockDiagMsg.put( family, instance.makeInetDiagReqV2( IPPROTO_TCP, null , null , family, (short) (NLM_F_REQUEST | NLM_F_DUMP) , 0 , 1 << INET_DIAG_MEMINFO , TCP_MONITOR_STATE_FILTER)); } } catch (ApiNotSupportedException e) { log("Method is not available in this version."); mIsTcpInfoParsingSupported = false; } }
Source:
private IModel runModelHooks(IModel base, Optional<Boolean> smooth, Optional<Boolean> gui3d, boolean uvlock, ImmutableMap<String, String> textureMap, ImmutableMap<String, String> customData) { base = base.process(customData); base = base.retexture(textureMap); base = smooth.isPresent() ? base.smoothLighting(smooth.get()) : base; base = gui3d.isPresent() ? base.gui3d(gui3d.get()) : base; base = base.uvlock(uvlock); return base; }

Target:
private IModel runModelHooks(IModel base, Optional<Boolean> smooth, Optional<Boolean> gui3d, boolean uvlock, ImmutableMap<String, String> textureMap, ImmutableMap<String, String> customData) { base = base.process(customData); base = base.retexture(textureMap); base = smooth.map(base::smoothLighting).orElse(base); base = gui3d.map(base::gui3d).orElse(base); base = base.uvlock(uvlock); return base; }
Source:
public void mergeLots(final String keepLotUUID, final LotsSearchDto lotsSearchDto) { final List<ExtendedLotDto> lotDtos = this.lotService.searchLots(lotsSearchDto, null); this.lotMergeValidator.validate(keepLotUUID, lotDtos); lotsSearchDto.setLotIds(lotDtos.stream().map(LotDto::getLotId).collect(Collectors.toList())); final ExtendedLotDto lotDto = lotDtos.stream() .filter(extendedLotDto -> keepLotUUID.equals(extendedLotDto.getLotUUID())) .findFirst() .get(); final WorkbenchUser loggedInUser = this.securityService.getCurrentlyLoggedInUser(); this.lotService.mergeLots(loggedInUser.getUserid(), lotDto.getLotId(), lotsSearchDto); }

Target:
public void mergeLots(final String keepLotUUID, final LotsSearchDto lotsSearchDto) { final List<ExtendedLotDto> lotDtos = this.lotService.searchLots(lotsSearchDto, null); this.lotMergeValidator.validate(keepLotUUID, lotDtos); final ExtendedLotDto lotDto = lotDtos.stream() .filter(extendedLotDto -> keepLotUUID.equals(extendedLotDto.getLotUUID())) .findFirst() .get(); final WorkbenchUser loggedInUser = this.securityService.getCurrentlyLoggedInUser(); this.lotService.mergeLots(loggedInUser.getUserid(), lotDto.getLotId(), lotsSearchDto); }
Source:
public void updateTitle(@StringRes int title) { final int toolbarId = getToolbarId(); final FragmentManager fm = getSupportFragmentManager(); Fragment actionBarGeoTag = fm.findFragmentById(toolbarId); if (actionBarGeoTag != null && actionBarGeoTag instanceof ActionBarGeoTagFragment) { ((ActionBarGeoTagFragment) actionBarGeoTag).updateTitle(title); } }

Target:
public void updateTitle(@StringRes int title) { final int toolbarId = getToolbarId(); final FragmentManager fm = getSupportFragmentManager(); Fragment actionBarGeoTag = fm.findFragmentById(toolbarId); if (actionBarGeoTag instanceof ActionBarGeoTagFragment) { ((ActionBarGeoTagFragment) actionBarGeoTag).updateTitle(title); } }
Source:
public boolean advanceNextPosition() { if (this.closed) { return false; } try { boolean result = this.resultSet.next(); if (!result) { this.close(); } return result; } catch (SQLException | RuntimeException e) { throw this.handleSqlException(e); } }

Target:
public boolean advanceNextPosition() { if (closed) { return false; } try { boolean result = resultSet.next(); if (!result) { close(); } return result; } catch (SQLException | RuntimeException e) { throw handleSqlException(e); } }
Source:
public void testJdk8DateTimeSerialization() throws IOException { assertThat(MAPPER.writeValueAsString(Duration.ofDays(2))).isEqualTo("172800.000000000"); assertThat(MAPPER.readValue("172800.000000000", Duration.class)).isEqualTo(Duration.ofDays(2)); assertThat(MAPPER.readValue("172800", Duration.class)).isEqualTo(Duration.ofDays(2)); ZonedDateTime now = ZonedDateTime.now().withZoneSameInstant(ZoneId.of("GMT")); assertThat(MAPPER.readValue(MAPPER.writeValueAsString(now), ZonedDateTime.class)).isEqualTo(now); now = ZonedDateTime.now().withZoneSameInstant(ZoneId.of(ZoneId.SHORT_IDS.get("EST"))); assertThat(MAPPER.readValue(MAPPER.writeValueAsString(now), ZonedDateTime.class)).isNotEqualTo(now); }

Target:
public void testJdk8DateTimeSerialization() throws IOException { Duration duration = Duration.ofMinutes(60 * 50 + 1); assertThat(ser(duration)).isEqualTo("\"PT50H1M\""); assertThat(serDe(duration, Duration.class)).isEqualTo(duration); OffsetDateTime offsetDateTime = OffsetDateTime.of(2001, 2, 3, 4, 5, 6, 7, ZoneOffset.ofHours(-5)); assertThat(ser(offsetDateTime)).isEqualTo("\"2001-02-03T04:05:06.000000007-05:00\""); assertThat(serDe(offsetDateTime, OffsetDateTime.class)).isEqualTo(offsetDateTime); ZonedDateTime zoneDateTime = ZonedDateTime.of(2001, 2, 3, 4, 5, 6, 7, ZoneId.of(ZoneId.SHORT_IDS.get("EST"))); assertThat(ser(zoneDateTime)).isEqualTo("\"2001-02-03T04:05:06.000000007-05:00\""); assertThat(serDe(zoneDateTime, ZonedDateTime.class)).isEqualTo(zoneDateTime); LocalDate localDate = LocalDate.of(2001, 2, 3); assertThat(ser(localDate)).isEqualTo("\"2001-02-03\""); assertThat(serDe(localDate, LocalDate.class)).isEqualTo(localDate); }
Source:
private MultiResult getMultiValue(JsonParser parser, JsonPathCursor pathCursor) throws IOException { pathCursor.getNext(); MultiResult<Object> multiResult = new MultiResult<>(); JsonToken currentToken = parser.currentToken(); if (currentToken != JsonToken.START_ARRAY) { return null; } while (true) { currentToken = parser.nextToken(); if (currentToken == JsonToken.END_ARRAY) { break; } if (pathCursor.getCurrent() == null) { if (currentToken.isScalarValue()) { multiResult.add(convertJsonTokenToValue(parser)); } else { parser.skipChildren(); } } else { if (currentToken == JsonToken.START_OBJECT) { do { boolean attributeFound = findAttribute(parser, pathCursor); if (attributeFound && parser.currentToken() != JsonToken.START_OBJECT && !pathCursor.hasNext()) { addToMultiResult(multiResult, parser); break; } else if (attributeFound) { if (pathCursor.getNext() == null) { addToMultiResult(multiResult, parser); break; } } else { break; } } while (true); } else if (currentToken == JsonToken.START_ARRAY) { parser.skipChildren(); } } } return multiResult; }

Target:
private MultiResult getMultiValue(JsonParser parser, JsonPathCursor pathCursor) throws IOException { pathCursor.getNext(); MultiResult<Object> multiResult = new MultiResult<>(); JsonToken currentToken = parser.currentToken(); if (currentToken != JsonToken.START_ARRAY) { return null; } while (true) { currentToken = parser.nextToken(); if (currentToken == JsonToken.END_ARRAY) { break; } if (pathCursor.getCurrent() == null) { if (currentToken.isScalarValue()) { multiResult.add(convertJsonTokenToValue(parser)); } else { parser.skipChildren(); } } else { if (currentToken == START_OBJECT) { do { if (!findAttribute(parser, pathCursor)) { break; } if ((parser.currentToken() != START_OBJECT && !pathCursor.hasNext()) || pathCursor.getNext() == null) { addToMultiResult(multiResult, parser); break; } } while (true); } else if (currentToken == JsonToken.START_ARRAY) { parser.skipChildren(); } } } return multiResult; }
Source:
private boolean deleteTable() { try { TableConfig tableConfig = JsonUtils.fileToObject(new File(_tableConfigFileName), TableConfig.class); ControllerTest.sendDeleteRequest( ControllerRequestURLBuilder.baseUrl(CONTROLLER_URL).forTableDelete(tableConfig.getTableName())); return true; } catch (IOException e) { System.out.println(e.getMessage()); return false; } }

Target:
private boolean deleteTable() { try { TableConfig tableConfig = JsonUtils.fileToObject(new File(_tableConfigFileName), TableConfig.class); ControllerTest.sendDeleteRequest( ControllerRequestURLBuilder.baseUrl(ClusterDescriptor.CONTROLLER_URL).forTableDelete(tableConfig.getTableName())); return true; } catch (IOException e) { LOGGER.error("Failed to delete table with file: {}", _tableConfigFileName, e); return false; } }
Source:
protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { for (DView dView : dAnalysis.getOwnedViews()) { for (DDiagram dDiagram : Iterables.filter(dView.getOwnedRepresentations(), DDiagram.class)) { for (DDiagramElementContainer diagramElement : new DDiagramInternalQuery(dDiagram).getContainers()) { if (diagramElement.getStyle() instanceof BorderedStyle) { BorderedStyle containerBorderedStyle = (BorderedStyle) diagramElement.getStyle(); if (containerBorderedStyle.getBorderSize().intValue() == 0) { containerBorderedStyle.setBorderSize(1); } if ("0".equals(containerBorderedStyle.getBorderSizeComputationExpression())) { containerBorderedStyle.setBorderSizeComputationExpression("1"); } } } } } } }

Target:
protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { for (DView dView : dAnalysis.getOwnedViews()) { for (DDiagram dDiagram : Iterables.filter(dView.getOwnedRepresentations(), DDiagram.class)) { for (DDiagramElementContainer diagramElement : dDiagram.getContainers()) { if (diagramElement.getStyle() instanceof BorderedStyle) { BorderedStyle containerBorderedStyle = (BorderedStyle) diagramElement.getStyle(); if ("0".equals(containerBorderedStyle.getBorderSizeComputationExpression())) { containerBorderedStyle.setBorderSizeComputationExpression("1"); if (containerBorderedStyle.getBorderSize().intValue() == 0) { containerBorderedStyle.setBorderSize(1); } } } } } } } }
Source:
public void setAttribute(final String key, final String value) { String tempVal = value; if (key.equals(SORT_ORDER_TAG)) { try { this.sortOrder = null; tempVal = SortOrder.valueOf(value).toString(); } catch (IllegalArgumentException e) { tempVal = "unknown"; } } else if (key.equals(GROUP_ORDER_TAG)) { this.groupOrder = null; } super.setAttribute(key, tempVal); }

Target:
public void setAttribute(final String key, final String value) { String tempVal = value; if (key.equals(SORT_ORDER_TAG)) { this.sortOrder = null; try { tempVal = SortOrder.valueOf(value).toString(); } catch (IllegalArgumentException e) { tempVal = SortOrder.unknown.toString(); } } else if (key.equals(GROUP_ORDER_TAG)) { this.groupOrder = null; } super.setAttribute(key, tempVal); }