auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testDataSet1() throws Exception { JavaRDD<Page> pages = sc.parallelize(getPagesSet1()); IndexStats stats = new IndexStats(sc); JavaPairRDD<RowColumn, Bytes> accumuloIndex = IndexUtil.createAccumuloIndex(stats, pages); verifyRDD(new File("src/test/resources/data/set1/accumulo-data.txt"), accumuloIndex); JavaPairRDD<RowColumn, Bytes> fluoIndex = IndexUtil.createFluoIndex(accumuloIndex); verifyRDD(new File("src/test/resources/data/set1/fluo-data.txt"), fluoIndex); JavaPairRDD<RowColumn, Bytes> reindex = IndexUtil.reindexFluo(fluoIndex); verifyRDD(new File("src/test/resources/data/set1/accumulo-data.txt"), reindex); }

Target:
public void testDataSet1() throws Exception { JavaRDD<Page> pages = sc.parallelize(getPagesSet1()); IndexStats stats = new IndexStats(sc); JavaPairRDD<RowColumn, Bytes> accumuloIndex = IndexUtil.createAccumuloIndex(stats, pages); verifyRDD(new File("src/test/resources/data/set1/accumulo-data.txt"), accumuloIndex); JavaPairRDD<RowColumn, Bytes> fluoIndex = IndexUtil.createFluoIndex(accumuloIndex); verifyRDD(new File("src/test/resources/data/set1/fluo-data.txt"), fluoIndex); JavaPairRDD<RowColumn, Bytes> accumuloIndexRecreated = IndexUtil.createAccumuloIndex(fluoIndex); verifyRDD(new File("src/test/resources/data/set1/accumulo-data.txt"), accumuloIndexRecreated); }
Source:
private void handleContent(HttpContent httpContent) throws RestServiceException { if (request != null) { logger.trace("Received content for request - {}", request.getUri()); try { request.addContent(httpContent); } catch (IllegalStateException e) { throw new RestServiceException(e, RestServiceErrorCode.InvalidRequestState); } catch (ClosedChannelException e) { throw new RestServiceException("The request has been closed and is not accepting content", RestServiceErrorCode.RequestChannelClosed); } if (!RestMethod.POST.equals(request.getRestMethod())) { requestHandler.handleRequest(request, responseChannel); } } else { logger.warn("Received content without a request on channel {}", ctx.channel()); nettyMetrics.noRequestError.inc(); throw new RestServiceException("Received content without a request", RestServiceErrorCode.InvalidRequestState); } }

Target:
private void handleContent(HttpContent httpContent) throws RestServiceException { if (request != null) { logger.trace("Received content for request - {}", request.getUri()); try { request.addContent(httpContent); } catch (IllegalStateException e) { throw new RestServiceException(e, RestServiceErrorCode.InvalidRequestState); } catch (ClosedChannelException e) { throw new RestServiceException("The request has been closed and is not accepting content", RestServiceErrorCode.RequestChannelClosed); } if (!request.getRestMethod().equals(RestMethod.POST)) { requestHandler.handleRequest(request, responseChannel); } } else { logger.warn("Received content without a request on channel {}", ctx.channel()); nettyMetrics.noRequestError.inc(); throw new RestServiceException("Received content without a request", RestServiceErrorCode.InvalidRequestState); } }
Source:
public static ClientRegistration.Builder fromOidcIssuerLocation(String issuer) { Assert.hasText(issuer, "issuer cannot be empty"); return oidc(URI.create(issuer)).get(); }

Target:
public static ClientRegistration.Builder fromOidcIssuerLocation(String issuer) { Assert.hasText(issuer, "issuer cannot be empty"); return getBuilder(issuer, oidc(URI.create(issuer))); }
Source:
public InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry, String name) { this.delegate = delegate; this.created = registry.counter(MetricRegistry.name(name, "created")); this.running = registry.counter(MetricRegistry.name(name, "running")); this.finished = registry.counter(MetricRegistry.name(name, "finished")); }

Target:
public InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry, String name) { this.delegate = delegate; this.created = registry.meter(MetricRegistry.name(name, "created")); this.running = registry.counter(MetricRegistry.name(name, "running")); this.terminated = registry.meter(MetricRegistry.name(name, "terminated")); }
Source:
private void add(Document doc, FieldDef<ChangeData, ?> f, Iterable<?> values) throws OrmException { if (f.getType() == FieldType.INTEGER) { for (Object value : values) { doc.add(new IntField(f.getName(), (Integer) value, store(f))); } } else if (f.getType() == FieldType.EXACT) { for (Object value : values) { doc.add(new StringField(f.getName(), (String) value, store(f))); } } else if (f.getType() == FieldType.FULL_TEXT) { for (Object value : values) { doc.add(new TextField(f.getName(), (String) value, store(f))); } } else { throw badFieldType(f.getType()); } }

Target:
private void add(Document doc, FieldDef<ChangeData, ?> f, Iterable<?> values) throws OrmException { String name = f.getName(); Store store = store(f); if (f.getType() == FieldType.INTEGER) { for (Object value : values) { doc.add(new IntField(name, (Integer) value, store)); } } else if (f.getType() == FieldType.LONG) { for (Object value : values) { doc.add(new LongField(name, (Long) value, store)); } } else if (f.getType() == FieldType.TIMESTAMP) { for (Object v : values) { doc.add(new IntField(name, toIndexTime((Timestamp) v), store)); } } else if (f.getType() == FieldType.EXACT || f.getType() == FieldType.PREFIX) { for (Object value : values) { doc.add(new StringField(name, (String) value, store)); } } else if (f.getType() == FieldType.FULL_TEXT) { for (Object value : values) { doc.add(new TextField(name, (String) value, store)); } } else { throw badFieldType(f.getType()); } }
Source:
public static String getFromUrl( String url, String encoding ) throws IOException { String protocol = StringUtils.substringBefore( url, ":" ).toLowerCase(); Charset charset = Charset.forName( encoding ); String result = null; if ( CLASSPATH_PROTOCOL.equals( protocol ) ) { ClassLoader classLoader = UrlRequester.class.getClassLoader(); String resource = url.substring( CLASSPATH_PROTOCOL.length() + 1 ); URL resourceUrl = classLoader.getResource( resource ); if ( resourceUrl == null ) { resourceUrl = ClassLoader.getSystemResource( resource ); } if ( resourceUrl != null ) { result = IOUtils.toString( resourceUrl, charset ); } else { throw new IOException( "The resource " + resource + " was not found in the maven plugin classpath" ); } } else if ( "http".equals( protocol ) || "https".equals( protocol ) ) { CloseableHttpClient httpClient = HttpClientBuilder.create().build(); HttpGet get = new HttpGet( url ); CloseableHttpResponse response = null; try { response = httpClient.execute( get ); result = IOUtils.toString( response.getEntity().getContent(), charset ); } catch ( ClientProtocolException e ) { throw new IOException( e.getMessage(), e ); } finally { if ( response != null ) { try { response.close(); } catch ( IOException e ) { } } } } else { result = IOUtils.toString( new URL( url ).openStream(), charset ); } return result; }

Target:
public static String getFromUrl( String url, String encoding ) throws IOException { String protocol = StringUtils.substringBefore( url, ":" ).toLowerCase(); Charset charset = Charset.forName( encoding ); String result = null; if ( CLASSPATH_PROTOCOL.equals( protocol ) ) { ClassLoader classLoader = UrlRequester.class.getClassLoader(); String resource = url.substring( CLASSPATH_PROTOCOL.length() + 1 ); URL resourceUrl = classLoader.getResource( resource ); if ( resourceUrl != null ) { result = IOUtils.toString( resourceUrl, charset ); } else { throw new IOException( "The resource " + resource + " was not found in the maven plugin classpath" ); } } else if ( "http".equals( protocol ) || "https".equals( protocol ) ) { try ( CloseableHttpClient httpClient = HttpClientBuilder.create().build() ) { HttpGet get = new HttpGet( url ); try ( CloseableHttpResponse response = httpClient.execute( get ) ) { int responseCode = response.getStatusLine().getStatusCode(); if ( responseCode >= 200 && responseCode < 300 ) { HttpEntity entity = response.getEntity(); ContentType contentType = ContentType.get( entity ); if ( contentType != null ) { charset = contentType.getCharset(); } result = IOUtils.toString( entity.getContent(), charset ); } else { throw new IOException( "For the URL (" + url + ") the server responded with " + response.getStatusLine() ); } } } } else { result = IOUtils.toString( new URL( url ).openStream(), charset ); } return result; }
Source:
public void run() { store.setValue(prefName, isChecked()); if (store.needsSaving()) { try { store.save(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, false); } } }

Target:
public void run() { store.setValue(prefName, isChecked()); if (store.needsSaving()) try { store.save(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, false); } }
Source:
private Event getEvent(final DataObject eventDataObject) throws ProtocolAdapterException { final List<DataObject> eventData = eventDataObject.value(); if (eventData == null) { throw new ProtocolAdapterException("eventData DataObject should not be null"); } if (eventData.size() != 2) { throw new ProtocolAdapterException("eventData size should be 2"); } final DateTime dateTime = this.dlmsHelperService.convertDataObjectToDateTime(eventData.get(0)); final Short code = eventData.get(1).value(); LOGGER.info("Event time is and event code is {}", dateTime, code); final Event event = new Event(dateTime, code.intValue()); return event; }

Target:
private Event getEvent(final DataObject eventDataObject) throws ProtocolAdapterException { final List<DataObject> eventData = eventDataObject.value(); if (eventData == null) { throw new ProtocolAdapterException("eventData DataObject should not be null"); } if (eventData.size() != 2) { throw new ProtocolAdapterException("eventData size should be 2"); } final DateTime dateTime = this.dlmsHelperService.convertDataObjectToDateTime(eventData.get(0)); if (!eventData.get(1).isNumber()) { throw new ProtocolAdapterException("eventData value is not a number"); } final Short code = eventData.get(1).value(); LOGGER.info("Event time is and event code is {}", dateTime, code); return new Event(dateTime, code.intValue()); }
Source:
public boolean createSubBlock(ItemStack itemStack, Direction direction, EntityPlayer player) { SixNodeDescriptor descriptor = Eln.sixNodeItem.getDescriptor(itemStack); if (sideElementList[direction.getInt()] != null) return false; try { sideElementIdList[direction.getInt()] = itemStack.getItemDamage(); sideElementList[direction.getInt()] = (SixNodeElement) descriptor.ElementClass.getConstructor(SixNode.class, Direction.class, SixNodeDescriptor.class).newInstance(this, direction, descriptor); sideElementIdList[direction.getInt()] = 0; disconnect(); sideElementList[direction.getInt()].front = descriptor.getFrontFromPlace(direction, player); sideElementList[direction.getInt()].initialize(); sideElementIdList[direction.getInt()] = itemStack.getItemDamage(); connect(); Utils.println("createSubBlock " + sideElementIdList[direction.getInt()] + " " + direction); setNeedPublish(true); return true; } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } return false; }

Target:
public boolean createSubBlock(ItemStack itemStack, Direction direction, EntityPlayer player) { SixNodeDescriptor descriptor = null; if (sideElementList[direction.getInt()] != null) return false; try { sideElementIdList[direction.getInt()] = itemStack.getItemDamage(); sideElementList[direction.getInt()] = (SixNodeElement) descriptor.ElementClass.getConstructor(SixNode.class, Direction.class, SixNodeDescriptor.class).newInstance(this, direction, descriptor); sideElementIdList[direction.getInt()] = 0; disconnect(); sideElementList[direction.getInt()].front = descriptor.getFrontFromPlace(direction, player); sideElementList[direction.getInt()].initialize(); sideElementIdList[direction.getInt()] = itemStack.getItemDamage(); connect(); Utils.println("createSubBlock " + sideElementIdList[direction.getInt()] + " " + direction); setNeedPublish(true); return true; } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } return false; }
Source:
public void testUpdateProperties() throws OperationException { DocumentModel doc = session.createDocumentModel("/", "docComplex", "File"); doc.setPropertyValue("dc:description", "description"); doc.setPropertyValue("dc:source", "source"); doc = session.createDocument(doc); try (OperationContext ctx = new OperationContext(session)) { ctx.setInput(doc); DocumentModel res = (DocumentModel) automationService.run(ctx, "Scripting.TestUpdateProperties"); assertEquals("foo", res.getPropertyValue("dc:description")); assertEquals("bar", res.getPropertyValue("dc:source")); } }

Target:
public void testUpdateProperties() throws OperationException { DocumentModel doc = session.createDocumentModel("/", "file", "File"); doc.setPropertyValue("dc:description", "description"); doc.setPropertyValue("dc:source", "source"); doc = session.createDocument(doc); try (OperationContext ctx = new OperationContext(session)) { ctx.setInput(doc); DocumentModel res = (DocumentModel) automationService.run(ctx, "Scripting.TestUpdateProperties"); assertEquals("foo", res.getPropertyValue("dc:description")); assertEquals("bar", res.getPropertyValue("dc:source")); } }
Source:
public synchronized void listenOn(Cache<CounterKey, CounterValue> cache) throws InterruptedException { if (!topologyListener.registered) { this.cache = cache; topologyListener.register(cache); } if (!listenersRegistered) { this.cache.addFilteredListener(valueListener, null, null, Util.asSet(CacheEntryCreated.class, CacheEntryModified.class, CacheEntryRemoved.class)); listenersRegistered = true; } }

Target:
public synchronized void listenOn(Cache<CounterKey, CounterValue> cache) throws InterruptedException { if (!topologyListener.registered) { this.cache = cache; topologyListener.register(cache); } if (!listenersRegistered) { this.cache.addListener(valueListener); listenersRegistered = true; } }
Source:
public int hashCode() { return 31* testNGMethod.hashCode(); }

Target:
public int hashCode() { return multiplicationFactor * testNGMethod.hashCode(); }
Source:
public void writeRevision(Revision rev) throws IOException { XmlWriter writer = this.writer; writer.openElement("revision"); writer.textElement("id", Integer.toString(rev.Id)); if (rev.Parentid != 0) { writer.textElement("parentid", Integer.toString(rev.Parentid)); } writer.textElement("timestamp", formatTimestamp(rev.Timestamp)); writeContributor(rev.Contributor); if (rev.Minor) { writer.emptyElement("minor"); } if (rev.Comment == null) { writer.emptyElement("comment", deletedAttrib); } else if (rev.Comment.length() != 0) { writer.textElement("comment", rev.Comment); } writer.textElement("model", rev.Model); writer.textElement("format", rev.Format); ArrayList<String[]> textAttribs = new ArrayList<String[]>(); textAttribs.add(new String[] {"xml:space", "preserve"}); if (rev.Text == null) { textAttribs.add(new String[] {"deleted", "deleted"}); } else if (rev.Bytes != null) { textAttribs.add(new String[] {"bytes", rev.Bytes.toString()}); } writer.textElement("text", rev.Text, textAttribs.toArray(new String[][] {})); writer.textElement("sha1", rev.Sha1); writer.closeElement(); }

Target:
public void writeRevision(Revision rev) throws IOException { XmlWriter writer = this.writer; writer.openElement("revision"); if (rev.Id != 0) { writer.textElement("id", Integer.toString(rev.Id)); } if (rev.Parentid != 0) { writer.textElement("parentid", Integer.toString(rev.Parentid)); } writer.textElement("timestamp", formatTimestamp(rev.Timestamp)); writeContributor(rev.Contributor); if (rev.Minor) { writer.emptyElement("minor"); } if (rev.Comment == null) { writer.emptyElement("comment", deletedAttrib); } else if (rev.Comment.length() != 0) { writer.textElement("comment", rev.Comment); } if (rev.Model != null) { writer.textElement("model", rev.Model); } if (rev.Format != null) { writer.textElement("format", rev.Format); } ArrayList<String[]> textAttribs = new ArrayList<String[]>(); textAttribs.add(new String[] {"xml:space", "preserve"}); if (rev.Text == null) { textAttribs.add(new String[] {"deleted", "deleted"}); } else if (rev.Bytes != null) { textAttribs.add(new String[] {"bytes", rev.Bytes.toString()}); } writer.textElement("text", rev.Text, textAttribs.toArray(new String[][] {})); if (rev.Sha1 != null) { writer.textElement("sha1", rev.Sha1); } writer.closeElement(); }
Source:
protected byte[] encryptWrite(byte[] b, int off, int len, long fp) { if (writeBuffer == null || writeBuffer.length < b.length) writeBuffer = new byte[b.length]; System.arraycopy(b, off, writeBuffer, off, len); encrypt(writeBuffer, off, len, fp); return writeBuffer; }

Target:
protected synchronized byte[] encryptWrite(byte[] b, int off, int len, long fp) { if (writeBuffer == null || writeBuffer.length < b.length) writeBuffer = new byte[b.length]; System.arraycopy(b, off, writeBuffer, off, len); encrypt(writeBuffer, off, len, fp); return writeBuffer; }
Source:
private static <T> List<T> extractList(Map<String, Object> xmlRpcStruct, String propertyName, boolean returnNullOnEmpty) { if (!xmlRpcStruct.containsKey(propertyName)){ return returnNullOnEmpty ? null : Collections.emptyList(); } Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items.length == 0) { return returnNullOnEmpty ? null : Collections.emptyList(); } return Arrays.stream(items).map(item -> (T) item).collect(Collectors.toList()); }

Target:
private static <T> List<T> extractList(Map<String, Object> xmlRpcStruct, String propertyName, boolean returnNullOnEmpty) { if (xmlRpcStruct.containsKey(propertyName)){ Object[] items = (Object[]) xmlRpcStruct.get(propertyName); if (items.length > 0) { return Arrays.stream(items).map(item -> (T) item).collect(Collectors.toList()); } } return returnNullOnEmpty ? null : Collections.emptyList(); }
Source:
public void aggregate() { Object value = selector.get(); if (HllAggregatorFactory.context == HllAggregatorFactory.CONTEXT.COMPLEX) { String k = (String) ((AbstractList) value).get(0); byte[] ibmapByte = Base64.decodeBase64(k); TIntByteHashMap newIbMap; ByteBuffer buffer = ByteBuffer.wrap(ibmapByte); int keylength = buffer.getInt(); int valuelength = buffer.getInt(); if (keylength == 0) { newIbMap = new TIntByteHashMap(); } else { int[] keys = new int[keylength]; byte[] values = new byte[valuelength]; for (int i = 0; i < keylength; i++) { keys[i] = buffer.getInt(); } buffer.get(values); newIbMap = new TIntByteHashMap(keys, values); } int[] indexes = newIbMap.keys(); for (int i = 0; i < indexes.length; i++) { int index_i = indexes[i]; if (ibMap.get(index_i) == ibMap.getNoEntryValue() || newIbMap.get(index_i) > ibMap.get(index_i)) { ibMap.put(index_i, newIbMap.get(index_i)); } } } else { long id = Hashing .murmur3_128() .hashString((String) ((AbstractList) selector.get()).get(0)) .asLong(); final int bucket = (int) (id >>> (Long.SIZE - log2m)); final int zerolength = Long.numberOfLeadingZeros((id << log2m) | (1 << (log2m - 1)) + 1) + 1; if (ibMap.get(bucket) == ibMap.getNoEntryValue() || ibMap.get(bucket) < (byte) zerolength) ibMap.put(bucket, (byte) zerolength); } }

Target:
public void aggregate() { Object value = selector.get(); log.info("class name:"+value.getClass()+":value "+value); if (value instanceof TIntByteHashMap) { TIntByteHashMap newIbMap = (TIntByteHashMap) value; int[] indexes = newIbMap.keys(); for (int i = 0; i < indexes.length; i++) { int index_i = indexes[i]; if (ibMap.get(index_i) == ibMap.getNoEntryValue() || newIbMap.get(index_i) > ibMap.get(index_i)) { ibMap.put(index_i, newIbMap.get(index_i)); } } } else { log.info("value "+ selector.get() ); long id = Hashing .murmur3_128() .hashString((String) (selector.get())) .asLong(); final int bucket = (int) (id >>> (Long.SIZE - log2m)); final int zerolength = Long.numberOfLeadingZeros((id << log2m) | (1 << (log2m - 1)) + 1) + 1; if (ibMap.get(bucket) == ibMap.getNoEntryValue() || ibMap.get(bucket) < (byte) zerolength) ibMap.put(bucket, (byte) zerolength); } }
Source:
private void approveOne(final PatchSet.Id patchSetId) throws NoSuchChangeException, OrmException, EmailException, Failure { final Change.Id changeId = patchSetId.getParentKey(); try { ChangeControl changeControl = changeControlFactory.validateFor(changeId); if (changeComment == null) { changeComment = ""; } Set<ApprovalCategoryValue.Id> aps = new HashSet<ApprovalCategoryValue.Id>(); for (ApproveOption ao : optionList) { Short v = ao.value(); if (v != null) { assertScoreIsAllowed(patchSetId, changeControl, ao, v); aps.add(new ApprovalCategoryValue.Id(ao.getCategoryId(), v)); } } try { publishCommentsFactory.create(patchSetId, changeComment, aps, forceMessage).call(); if (abandonChange) { final ReviewResult result = abandonChangeFactory.create( patchSetId, changeComment).call(); handleReviewResultErrors(result); } else if (restoreChange) { final ReviewResult result = restoreChangeFactory.create( patchSetId, changeComment).call(); handleReviewResultErrors(result); } if (submitChange) { final ReviewResult result = submitFactory.create(patchSetId).call(); handleReviewResultErrors(result); } } catch (InvalidChangeOperationException e) { throw error(e.getMessage()); } catch (IllegalStateException e) { throw error(e.getMessage()); } if (publishPatchSet) { final ReviewResult result = publishDraftFactory.create(patchSetId).call(); handleReviewResultErrors(result); } else if (deleteDraftPatchSet) { final ReviewResult result = deleteDraftPatchSetFactory.create(patchSetId).call(); handleReviewResultErrors(result); } } catch (NoSuchChangeException e) { throw error("no such change " + changeId.get()); } }

Target:
private void approveOne(final PatchSet.Id patchSetId) throws NoSuchChangeException, OrmException, EmailException, Failure { final Change.Id changeId = patchSetId.getParentKey(); ChangeControl changeControl = changeControlFactory.validateFor(changeId); if (changeComment == null) { changeComment = ""; } Set<ApprovalCategoryValue.Id> aps = new HashSet<ApprovalCategoryValue.Id>(); for (ApproveOption ao : optionList) { Short v = ao.value(); if (v != null) { assertScoreIsAllowed(patchSetId, changeControl, ao, v); aps.add(new ApprovalCategoryValue.Id(ao.getCategoryId(), v)); } } try { publishCommentsFactory.create(patchSetId, changeComment, aps, forceMessage).call(); if (abandonChange) { final ReviewResult result = abandonChangeFactory.create( patchSetId, changeComment).call(); handleReviewResultErrors(result); } else if (restoreChange) { final ReviewResult result = restoreChangeFactory.create( patchSetId, changeComment).call(); handleReviewResultErrors(result); } if (submitChange) { final ReviewResult result = submitFactory.create(patchSetId).call(); handleReviewResultErrors(result); } } catch (InvalidChangeOperationException e) { throw error(e.getMessage()); } catch (IllegalStateException e) { throw error(e.getMessage()); } if (publishPatchSet) { final ReviewResult result = publishDraftFactory.create(patchSetId).call(); handleReviewResultErrors(result); } else if (deleteDraftPatchSet) { final ReviewResult result = deleteDraftPatchSetFactory.create(patchSetId).call(); handleReviewResultErrors(result); } }
Source:
public Mono<Instant> renewMessageLock(ServiceBusReceivedMessage receivedMessage) { return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath)) .flatMap(serviceBusManagementNode -> { return serviceBusManagementNode .renewMessageLock(receivedMessage) .doOnNext(instant -> { receivedMessage.setLockedUntil(instant); }); }); }

Target:
public Mono<Instant> renewMessageLock(ServiceBusReceivedMessage receivedMessage) { return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(serviceBusManagementNode -> { return serviceBusManagementNode .renewMessageLock(receivedMessage) .map(instant -> { receivedMessage.setLockedUntil(instant); return instant; }); }); }
Source:
public InterpreterResult interpret(String cypherQuery, InterpreterContext interpreterContext) { logger.info("Opening session"); if (StringUtils.isEmpty(cypherQuery)) { return new InterpreterResult(Code.ERROR, "Cypher query is Empty"); } try { StatementResult result = this.neo4jConnectionManager.execute(cypherQuery, interpreterContext); Set<Node> nodes = new HashSet<>(); Set<Relationship> relationships = new HashSet<>(); List<String> columns = new ArrayList<>(); List<List<String>> lines = new ArrayList<List<String>>(); while (result.hasNext()) { Record record = result.next(); List<Pair<String, Value>> fields = record.fields(); List<String> line = new ArrayList<>(); for (Pair<String, Value> field : fields) { if (field.value().hasType(InternalTypeSystem.TYPE_SYSTEM.NODE())) { nodes.add(field.value().asNode()); } else if (field.value().hasType(InternalTypeSystem.TYPE_SYSTEM.RELATIONSHIP())) { relationships.add(field.value().asRelationship()); } else if (field.value().hasType(InternalTypeSystem.TYPE_SYSTEM.PATH())) { nodes.addAll(Iterables.asList(field.value().asPath().nodes())); relationships.addAll(Iterables.asList(field.value().asPath().relationships())); } else { setTabularResult(field.key(), field.value(), columns, line, InternalTypeSystem.TYPE_SYSTEM); } } if (!line.isEmpty()) { lines.add(line); } } if (!nodes.isEmpty()) { return renderGraph(nodes, relationships); } else { return renderTable(columns, lines); } } catch (Exception e) { logger.error("Exception while interpreting cypher query", e); return new InterpreterResult(Code.ERROR, e.getMessage()); } }

Target:
public InterpreterResult interpret(String cypherQuery, InterpreterContext interpreterContext) { logger.info("Opening session"); if (StringUtils.isBlank(cypherQuery)) { return new InterpreterResult(Code.SUCCESS); } try { StatementResult result = this.neo4jConnectionManager.execute(cypherQuery, interpreterContext); Set<Node> nodes = new HashSet<>(); Set<Relationship> relationships = new HashSet<>(); List<String> columns = new ArrayList<>(); List<List<String>> lines = new ArrayList<List<String>>(); while (result.hasNext()) { Record record = result.next(); List<Pair<String, Value>> fields = record.fields(); List<String> line = new ArrayList<>(); for (Pair<String, Value> field : fields) { if (field.value().hasType(InternalTypeSystem.TYPE_SYSTEM.NODE())) { nodes.add(field.value().asNode()); } else if (field.value().hasType(InternalTypeSystem.TYPE_SYSTEM.RELATIONSHIP())) { relationships.add(field.value().asRelationship()); } else if (field.value().hasType(InternalTypeSystem.TYPE_SYSTEM.PATH())) { nodes.addAll(Iterables.asList(field.value().asPath().nodes())); relationships.addAll(Iterables.asList(field.value().asPath().relationships())); } else { setTabularResult(field.key(), field.value(), columns, line, InternalTypeSystem.TYPE_SYSTEM); } } if (!line.isEmpty()) { lines.add(line); } } if (!nodes.isEmpty()) { return renderGraph(nodes, relationships); } else { return renderTable(columns, lines); } } catch (Exception e) { logger.error("Exception while interpreting cypher query", e); return new InterpreterResult(Code.ERROR, e.getMessage()); } }
Source:
private static void encodeArgumentWithSpecialCharactersForWindows(String str, StringBuilder builder) { builder.append("\""); for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); if (c == '\"') { builder.append(c); } builder.append(c); } builder.append("\""); }

Target:
private static void encodeArgumentWithSpecialCharactersForWindows(String str, StringBuilder builder) { builder.append("\""); builder.append(WindowsCommandLineArgsSanitizer.sanitize(str)); builder.append("\""); }
Source:
public static boolean setEnablement(String property, boolean val) { synchronized (MUTEX) { boolean oldVal = isEnabled(property); FEATURE_ENABLEMENT_CACHE.put(property, val); return oldVal; } }

Target:
public static boolean setEnablement(String property, boolean val) { synchronized (MUTEX) { boolean oldVal = isEnabled(property); FEATURE_ENABLEMENTS.put(property, val); return oldVal; } }
Source:
public IYAppearance getSeriesAppearance(@NonNull String seriesName) { if (seriesName.equals(getTrace().getName())) { return getPresentationProvider().getAppearance(seriesName, IYAppearance.Type.LINE, DEFAULT_SERIES_WIDTH); } return getPresentationProvider().getAppearance(seriesName, IYAppearance.Type.AREA, DEFAULT_SERIES_WIDTH); }

Target:
public IYAppearance getSeriesAppearance(@NonNull String seriesName) { if (seriesName.startsWith(CpuUsageDataProvider.TOTAL)) { return getPresentationProvider().getAppearance(seriesName, IYAppearance.Type.LINE, DEFAULT_SERIES_WIDTH); } return getPresentationProvider().getAppearance(seriesName, IYAppearance.Type.AREA, DEFAULT_SERIES_WIDTH); }
Source:
private Set<EventSubscriber> getEventSubscribers(String eventType) { Set<EventSubscriber> eventTypeSubscribers = typedEventSubscribers.get(eventType); Set<EventSubscriber> allEventTypeSubscribers = typedEventSubscribers.get(EventSubscriber.ALL_EVENT_TYPES); Set<EventSubscriber> subscribers = new HashSet<EventSubscriber>(); if (eventTypeSubscribers != null) { subscribers.addAll(eventTypeSubscribers); } if (allEventTypeSubscribers != null) { subscribers.addAll(allEventTypeSubscribers); } return subscribers; }

Target:
private Set<EventSubscriber> getEventSubscribers(String eventType) { Set<EventSubscriber> eventTypeSubscribers = typedEventSubscribers.get(eventType); Set<EventSubscriber> allEventTypeSubscribers = typedEventSubscribers.get(EventSubscriber.ALL_EVENT_TYPES); Set<EventSubscriber> subscribers = new HashSet<>(); if (eventTypeSubscribers != null) { subscribers.addAll(eventTypeSubscribers); } if (allEventTypeSubscribers != null) { subscribers.addAll(allEventTypeSubscribers); } return subscribers; }
Source:
public void start(final Environment env) throws IOException { try { parseCommandLine(); if (Strings.isNullOrEmpty(commandName)) { StringWriter msg = new StringWriter(); msg.write(usage()); throw new UnloggedFailure(1, msg.toString()); } final CommandProvider p = commands.get(commandName); if (p == null) { String msg = (getName().isEmpty() ? "Gerrit Code Review" : getName()) + ": "; msg += commandName.equals("git-receive-pack") ? "Push operation is not supported on slave" : commandName + ": not found"; throw new UnloggedFailure(1, msg); } final Command cmd = p.getProvider().get(); checkRequiresCapability(cmd); if (cmd instanceof BaseCommand) { final BaseCommand bc = (BaseCommand) cmd; if (getName().isEmpty()) bc.setName(commandName); else bc.setName(getName() + " " + commandName); bc.setArguments(args.toArray(new String[args.size()])); } else if (!args.isEmpty()) { throw new UnloggedFailure(1, commandName + " does not take arguments"); } provideStateTo(cmd); atomicCmd.set(cmd); cmd.start(env); } catch (UnloggedFailure e) { String msg = e.getMessage(); if (!msg.endsWith("\n")) { msg += "\n"; } err.write(msg.getBytes(ENC)); err.flush(); onExit(e.exitCode); } }

Target:
public void start(final Environment env) throws IOException { try { parseCommandLine(); if (Strings.isNullOrEmpty(commandName)) { StringWriter msg = new StringWriter(); msg.write(usage()); throw new UnloggedFailure(1, msg.toString()); } final CommandProvider p = commands.get(commandName); if (p == null) { String msg = (getName().isEmpty() ? "Gerrit Code Review" : getName()) + ": " + commandName + ": not found"; throw new UnloggedFailure(1, msg); } final Command cmd = p.getProvider().get(); checkRequiresCapability(cmd); if (cmd instanceof BaseCommand) { final BaseCommand bc = (BaseCommand) cmd; if (getName().isEmpty()) bc.setName(commandName); else bc.setName(getName() + " " + commandName); bc.setArguments(args.toArray(new String[args.size()])); } else if (!args.isEmpty()) { throw new UnloggedFailure(1, commandName + " does not take arguments"); } provideStateTo(cmd); atomicCmd.set(cmd); cmd.start(env); } catch (UnloggedFailure e) { String msg = e.getMessage(); if (!msg.endsWith("\n")) { msg += "\n"; } err.write(msg.getBytes(ENC)); err.flush(); onExit(e.exitCode); } }
Source:
public static List<RangePartition> getRangePartitions(Map<String, Object> tableProperties) { requireNonNull(tableProperties); @SuppressWarnings("unchecked") String json = (String) tableProperties.get(RANGE_PARTITIONS); if (json != null) { try { RangePartition[] partitions = mapper.readValue(json, RangePartition[].class); if (partitions == null) { return ImmutableList.of(); } else { return ImmutableList.copyOf(partitions); } } catch (IOException e) { throw new RuntimeException(e); } } else { return ImmutableList.of(); } }

Target:
public static List<RangePartition> getRangePartitions(Map<String, Object> tableProperties) { requireNonNull(tableProperties); @SuppressWarnings("unchecked") String json = (String) tableProperties.get(RANGE_PARTITIONS); if (json != null) { try { RangePartition[] partitions = mapper.readValue(json, RangePartition[].class); if (partitions == null) { return ImmutableList.of(); } return ImmutableList.copyOf(partitions); } catch (IOException e) { throw new RuntimeException(e); } } else { return ImmutableList.of(); } }
Source:
private void resetSystemExports() { BundleDescription[] systemBundles = getBundles(Constants.SYSTEM_BUNDLE_SYMBOLICNAME); for (BundleDescription systemBundle1 : systemBundles) { BundleDescriptionImpl systemBundle = (BundleDescriptionImpl) systemBundle1; ExportPackageDescription[] exports = systemBundle.getExportPackages(); List<ExportPackageDescription> newExports = new ArrayList<>(exports.length); for (ExportPackageDescription export : exports) { if (((Integer) export.getDirective(ExportPackageDescriptionImpl.EQUINOX_EE)).intValue() < 0) { newExports.add(export); } } addSystemExports(newExports); systemBundle.setExportPackages(newExports.toArray(new ExportPackageDescription[newExports.size()])); } }

Target:
private void resetSystemExports() { BundleDescription[] systemBundles = getBundles(Constants.SYSTEM_BUNDLE_SYMBOLICNAME); for (BundleDescription systemBundle : systemBundles) { BundleDescriptionImpl systemBundleImpl = (BundleDescriptionImpl) systemBundle; ExportPackageDescription[] exports = systemBundleImpl.getExportPackages(); List<ExportPackageDescription> newExports = new ArrayList<>(exports.length); for (ExportPackageDescription export : exports) { if (((Integer) export.getDirective(ExportPackageDescriptionImpl.EQUINOX_EE)).intValue() < 0) { newExports.add(export); } } addSystemExports(newExports); systemBundleImpl.setExportPackages(newExports.toArray(new ExportPackageDescription[newExports.size()])); } }
Source:
public void visitToken(DetailAST classDef) { if (!isClass(classDef) || !shouldCheckClass(classDef)) { return; } final DetailAST objBlock = classDef.findFirstToken(TokenTypes.OBJBLOCK); DetailAST child = objBlock.getFirstChild(); boolean hasNoArgCtor = false; boolean hasExplicitCtor = false; while (child != null) { if (child.getType() == TokenTypes.CTOR_DEF) { hasExplicitCtor = true; DetailAST ctorParams = child.findFirstToken(TokenTypes.PARAMETERS); if (ctorParams.getChildCount() == 0) { hasNoArgCtor = true; break; } } child = child.getNextSibling(); } if (!hasNoArgCtor && hasExplicitCtor) { log(classDef.getLineNo(), classDef.getColumnNo(), "Class must have a no-argument constructor (with any access modifier)," + " i.e. either explicit or default constructor without arguments."); } }

Target:
public void visitToken(DetailAST classDef) { if (!shouldVisit(classDef)) { return; } DetailAST objBlock = classDef.findFirstToken(TokenTypes.OBJBLOCK); DetailAST child = objBlock.getFirstChild(); boolean hasExplicitCtor = false; while (child != null) { if (child.getType() == TokenTypes.CTOR_DEF) { hasExplicitCtor = true; DetailAST ctorParams = child.findFirstToken(TokenTypes.PARAMETERS); if (ctorParams.getChildCount() == 0) { return; } } child = child.getNextSibling(); } if (hasExplicitCtor) { DetailAST classIdent = classDef.findFirstToken(TokenTypes.LITERAL_CLASS).getNextSibling(); log(classIdent.getLineNo(), classIdent.getColumnNo(), "Class {0} must have a no-argument constructor (with any access modifier)." + " Alternatively, use @NoArgConstructorCheck.Disable annotation.", classIdent.getText()); } }
Source:
protected void onSetUpView() { try { String currentUser = EMChatManager.getInstance().getCurrentUser(); String fromUser = message.getStringAttribute(LMConstant.EXTRA_LUCKY_MONEY_SENDER); String toUser = message.getStringAttribute(LMConstant.EXTRA_LUCKY_MONEY_RECEIVER); String senderId; if (message.direct == EMMessage.Direct.SEND) { if (message.getChatType().equals(EMMessage.ChatType.GroupChat)) { senderId = message.getStringAttribute(LMConstant.EXTRA_LUCKY_MONEY_SENDER_ID); if (senderId.equals(currentUser)) { mTvMessage.setText("你领取了自己的红包"); } else { mTvMessage.setText(String.format("你领取了%s的红包", fromUser)); } } else { mTvMessage.setText(String.format("你领取了%s的红包", fromUser)); } } else { mTvMessage.setText(String.format("%s领取了你的红包", toUser)); } } catch (EaseMobException e) { e.printStackTrace(); } }

Target:
protected void onSetUpView() { try { String currentUser = EMChatManager.getInstance().getCurrentUser(); String fromUser = message.getStringAttribute(LMConstant.EXTRA_LUCKY_MONEY_SENDER); String toUser = message.getStringAttribute(LMConstant.EXTRA_LUCKY_MONEY_RECEIVER); String senderId; if (message.direct == EMMessage.Direct.SEND) { if (message.getChatType().equals(EMMessage.ChatType.GroupChat)) { senderId = message.getStringAttribute(LMConstant.EXTRA_LUCKY_MONEY_SENDER_ID); if (senderId.equals(currentUser)) { mTvMessage.setText(R.string.money_msg_take_money); } else { mTvMessage.setText(String.format(getResources().getString(R.string.money_msg_take_someone_money), fromUser)); } } else { mTvMessage.setText(String.format(getResources().getString(R.string.money_msg_take_someone_money), fromUser)); } } else { mTvMessage.setText(String.format(getResources().getString(R.string.money_msg_someone_take_money), toUser)); } } catch (EaseMobException e) { e.printStackTrace(); } }
Source:
private static Boolean cacheGet(final CacheKey key) { final LRUMap<CacheKey, Boolean> cache = SecuredItemImpl.CACHE.get(); return (cache == null) ? null : (Boolean) cache.get(key); }

Target:
private Boolean cacheGet(final CacheKey key) { final LRUMap<CacheKey, Boolean> cache = SecuredItemImpl.CACHE.get(); return (cache == null) ? null : (Boolean) cache.get(key); }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } if (tree.is(Tree.Kind.METHOD_INVOCATION)) { checkMethod(tree, methodMatcher -> methodMatcher.matches((MethodInvocationTree) tree)); } else if (tree.is(Tree.Kind.METHOD_REFERENCE)) { checkMethod(tree, methodMatcher -> methodMatcher.matches((MethodReferenceTree) tree)); } else { checkMemberSelect((MemberSelectExpressionTree) tree); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } if (tree.is(Tree.Kind.METHOD_INVOCATION) && METHOD_MATCHERS.anyMatch((MethodInvocationTree) tree)) { reportIssue(tree); } else if (tree.is(Tree.Kind.METHOD_REFERENCE) && METHOD_MATCHERS.anyMatch((MethodReferenceTree) tree)) { reportIssue(tree); } else if (tree.is(Tree.Kind.IDENTIFIER)) { checkIdentifier((IdentifierTree) tree); } }
Source:
void doClear(RegionEventImpl regionEvent, boolean cacheWrite) { String lockName = CLEAR_OPERATION + partitionedRegion.getName(); long clearStartTime = 0; try { acquireDistributedClearLock(lockName); clearStartTime = System.nanoTime(); assignAllPrimaryBuckets(); if (cacheWrite) { invokeCacheWriter(regionEvent); } boolean acquireClearLockForNotification = (partitionedRegion.hasAnyClientsInterested() || partitionedRegion.hasListener()); if (acquireClearLockForNotification) { obtainLockForClear(regionEvent); } try { Set<Integer> bucketsCleared = clearRegion(regionEvent); if (!partitionedRegion.allServerVersionsSupportPartitionRegionClear()) { throw new PartitionedRegionVersionException(); } if (partitionedRegion.getTotalNumberOfBuckets() != bucketsCleared.size()) { String message = "Unable to clear all the buckets from the partitioned region " + partitionedRegion.getName() + ", either data (buckets) moved or member departed."; logger.warn(message + " expected to clear number of buckets: " + partitionedRegion.getTotalNumberOfBuckets() + " actual cleared: " + bucketsCleared.size()); throw new PartitionedRegionPartialClearException(message); } } finally { if (acquireClearLockForNotification) { releaseLockForClear(regionEvent); } } } finally { releaseDistributedClearLock(lockName); CachePerfStats stats = partitionedRegion.getRegionCachePerfStats(); if (stats != null) { partitionedRegion.getRegionCachePerfStats() .incPartitionedRegionClearTotalDuration(System.nanoTime() - clearStartTime); } } }

Target:
void doClear(RegionEventImpl regionEvent, boolean cacheWrite) { String lockName = CLEAR_OPERATION + partitionedRegion.getName(); long clearStartTime = 0; allServerVersionsSupportPartitionRegionClear(); try { acquireDistributedClearLock(lockName); clearStartTime = System.nanoTime(); assignAllPrimaryBuckets(); if (cacheWrite) { invokeCacheWriter(regionEvent); } boolean acquireClearLockForNotification = (partitionedRegion.hasAnyClientsInterested() || partitionedRegion.hasListener()); if (acquireClearLockForNotification) { obtainLockForClear(regionEvent); } try { Set<Integer> bucketsCleared = clearRegion(regionEvent); if (partitionedRegion.getTotalNumberOfBuckets() != bucketsCleared.size()) { String message = "Unable to clear all the buckets from the partitioned region " + partitionedRegion.getName() + ", either data (buckets) moved or member departed."; logger.warn(message + " expected to clear number of buckets: " + partitionedRegion.getTotalNumberOfBuckets() + " actual cleared: " + bucketsCleared.size()); throw new PartitionedRegionPartialClearException(message); } } finally { if (acquireClearLockForNotification) { releaseLockForClear(regionEvent); } } } finally { releaseDistributedClearLock(lockName); CachePerfStats stats = partitionedRegion.getRegionCachePerfStats(); if (stats != null) { partitionedRegion.getRegionCachePerfStats() .incPartitionedRegionClearTotalDuration(System.nanoTime() - clearStartTime); } } }
Source:
public CqlClient constructClient( TaggedMetricRegistry taggedMetricRegistry, CassandraKeyValueServiceConfig config, boolean initializeAsync) { return config.servers().accept(new CassandraServersConfigs.Visitor<CqlClient>() { @Override public CqlClient visit(CassandraServersConfigs.DefaultConfig defaultConfig) { return ThrowingCqlClientImpl.SINGLETON; } @Override public CqlClient visit(CassandraServersConfigs.CqlCapableConfig cqlCapableConfig) { if (!cqlCapableConfig.validateHosts()) { log.warn("Your CQL capable config is wrong, the hosts for CQL and Thrift are not the same, using " + "async API will result in an exception."); return ThrowingCqlClientImpl.SINGLETON; } Set<InetSocketAddress> servers = cqlCapableConfig.cqlHosts(); Cluster.Builder clusterBuilder = cqlClusterBuilderFactory.get() .addContactPointsWithPorts(servers) .withCredentials(config.credentials().username(), config.credentials().password()) .withCompression(ProtocolOptions.Compression.LZ4) .withRetryPolicy(DefaultRetryPolicy.INSTANCE) .withoutJMXReporting() .withProtocolVersion(ProtocolVersion.V3) .withThreadingOptions(new ThreadingOptions()); Cluster cluster = withLoadBalancingPolicy( withQueryOptions( withPoolingOptions( withSslOptions(clusterBuilder, config), config), config), config, servers).build(); return CqlClientImpl.create( taggedMetricRegistry, cluster, cqlCapableConfig.tuning(), initializeAsync); } }); }

Target:
public CqlClient constructClient( TaggedMetricRegistry taggedMetricRegistry, CassandraKeyValueServiceConfig config, boolean initializeAsync) { return config.servers().accept(new CassandraServersConfigs.Visitor<CqlClient>() { @Override public CqlClient visit(CassandraServersConfigs.DefaultConfig defaultConfig) { return ThrowingCqlClientImpl.SINGLETON; } @Override public CqlClient visit(CassandraServersConfigs.CqlCapableConfig cqlCapableConfig) { if (!cqlCapableConfig.validateHosts()) { log.warn("Your CQL capable config is wrong, the hosts for CQL and Thrift are not the same, using " + "async API will result in an exception."); return ThrowingCqlClientImpl.SINGLETON; } Set<InetSocketAddress> servers = cqlCapableConfig.cqlHosts(); Cluster.Builder clusterBuilder = cqlClusterBuilderFactory.get() .addContactPointsWithPorts(servers) .withCredentials(config.credentials().username(), config.credentials().password()) .withCompression(ProtocolOptions.Compression.LZ4) .withRetryPolicy(DefaultRetryPolicy.INSTANCE) .withoutJMXReporting() .withProtocolVersion(ProtocolVersion.V3) .withThreadingOptions(new ThreadingOptions()); clusterBuilder = withSslOptions(clusterBuilder, config); clusterBuilder = withPoolingOptions(clusterBuilder, config); clusterBuilder = withQueryOptions(clusterBuilder, config); clusterBuilder = withLoadBalancingPolicy(clusterBuilder, config, servers); return CqlClientImpl.create( taggedMetricRegistry, clusterBuilder.build(), cqlCapableConfig.tuning(), initializeAsync); } }); }
Source:
private boolean isDiscoDataPaketCompressed(TcpDiscoveryNode node) { return allNodesSupport(IgniteFeatures.DATA_PAKET_COMPRESSION) && IgniteFeatures.allNodesSupports(Collections.singleton(node), IgniteFeatures.DATA_PAKET_COMPRESSION); }

Target:
private boolean isDiscoDataPaketCompressed(TcpDiscoveryNode node) { return IgniteFeatures.nodeSupports(node, IgniteFeatures.DATA_PACKET_COMPRESSION) && allNodesSupport(IgniteFeatures.DATA_PACKET_COMPRESSION); }
Source:
protected void refreshVisuals() { boolean stack = false; if (hasNotationView() && (getUMLElement() != null)) { MultiplicityElement mult = (MultiplicityElement) getUMLElement(); boolean isHash = 0 == mult.getLower(); getPrimaryShape().setHashed(isHash); int upper = mult.getUpper(); int lower = mult.getLower(); if (!(upper == 1 && lower == 0) && RTPropertyUtils.isReplicated((Property) getUMLElement())) { stack = true; } getPrimaryShape().setStack(stack); } getPrimaryShape().setLayerNumber(LAYER_NUMBER); getPrimaryShape().setXOffSet(X_OFFSET); getPrimaryShape().setYOffSet(Y_OFFSET); getPrimaryShape().setPathPattern(PATTERN_PATH); getPrimaryShape().setLayerOpacity(isSemanticInherited() ? getLighterAlpha(LAYER_OPACITY) : LAYER_OPACITY); super.refreshVisuals(); }

Target:
protected void refreshVisuals() { boolean stack = false; if (hasNotationView() && (getUMLElement() != null)) { MultiplicityElement mult = (MultiplicityElement) getUMLElement(); boolean isHash = 0 == mult.getLower(); getPrimaryShape().setHashed(isHash); if (RTPropertyUtils.isReplicated((Property) getUMLElement())) { stack = true; } getPrimaryShape().setStack(stack); } getPrimaryShape().setLayerNumber(LAYER_NUMBER); getPrimaryShape().setXOffSet(X_OFFSET); getPrimaryShape().setYOffSet(Y_OFFSET); getPrimaryShape().setPathPattern(PATTERN_PATH); getPrimaryShape().setLayerOpacity(isSemanticInherited() ? getLighterAlpha(LAYER_OPACITY) : LAYER_OPACITY); super.refreshVisuals(); }
Source:
protected boolean supersetOfUniqueIndex(boolean[] eqCols) throws StandardException{ ConglomerateDescriptor[] cds=tableDescriptor.getConglomerateDescriptors(); IndexDescriptor id; for(ConglomerateDescriptor cd : cds){ if(!cd.isIndex()) { if (!cd.isPrimaryKey()) continue; else id = cd.getIndexDescriptor().getIndexDescriptor(); } else { id=cd.getIndexDescriptor(); if(!id.isUnique()){ continue; } } int[] keyColumns=id.baseColumnPositions(); int inner=0; for(;inner<keyColumns.length;inner++){ if(!eqCols[keyColumns[inner]]){ break; } } if(inner==keyColumns.length){ return true; } } return false; }

Target:
protected boolean supersetOfUniqueIndex(boolean[] eqCols) throws StandardException{ ConglomerateDescriptor[] cds=tableDescriptor.getConglomerateDescriptors(); IndexDescriptor id; for(ConglomerateDescriptor cd : cds){ if(!cd.isIndex()) { if (!cd.isPrimaryKey()) continue; else id = cd.getIndexDescriptor(); } else { id=cd.getIndexDescriptor(); if(!id.isUnique()){ continue; } } int[] keyColumns=id.baseColumnPositions(); int inner=0; for(;inner<keyColumns.length;inner++){ if(!eqCols[keyColumns[inner]]){ break; } } if(inner==keyColumns.length){ return true; } } return false; }