auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public BinaryData getBody() { final AmqpMessageBodyType type = amqpAnnotatedMessage.getBody().getBodyType(); switch (type) { case DATA: Optional<byte[]> byteArrayData = amqpAnnotatedMessage.getBody().getData().stream().findFirst(); final byte[] bytes; if (byteArrayData.isPresent()) { bytes = byteArrayData.get(); } else { logger.warning("Data not present."); bytes = new byte[0]; } return BinaryData.fromBytes(bytes); case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Not supported AmqpBodyType: " + type.toString())); default: throw logger.logExceptionAsError(new IllegalArgumentException("Unknown AmqpBodyType: " + type.toString())); } }

Target:
public BinaryData getBody() { final AmqpMessageBodyType type = amqpAnnotatedMessage.getBody().getBodyType(); switch (type) { case DATA: return BinaryData.fromBytes(amqpAnnotatedMessage.getBody().getFirstData()); case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Not supported AmqpBodyType: " + type.toString())); default: throw logger.logExceptionAsError(new IllegalArgumentException("Unknown AmqpBodyType: " + type.toString())); } }
Source:
private Mono<Void> afterProcessChanges(ChangeFeedObserverContext context) { AutoCheckpointer self = this; self.processedDocCount ++; if (self.isCheckpointNeeded()) { return context.checkpoint() .doOnSuccess((Void) -> { self.processedDocCount = 0; self.lastCheckpointTime = ZonedDateTime.now(ZoneId.of("UTC")); }); } return Mono.empty(); }

Target:
private Mono<Void> afterProcessChanges(ChangeFeedObserverContext context) { this.processedDocCount ++; if (this.isCheckpointNeeded()) { return context.checkpoint() .doOnSuccess((Void) -> { this.processedDocCount = 0; this.lastCheckpointTime = ZonedDateTime.now(ZoneId.of("UTC")); }); } return Mono.empty(); }
Source:
private Set<String> getLocalAddresses(ChannelHandlerContext ctx) { SocketAddress localAddress = ctx.channel().localAddress(); if (!(localAddress instanceof InetSocketAddress)) { return new HashSet<>(); } synchronized (localAddresses) { Set<String> localAddresses = this.localAddresses.get(localAddress); if (localAddresses != null) { return localAddresses; } InetSocketAddress inetSocketAddress = (InetSocketAddress) localAddress; String portExtension = ""; if (!(inetSocketAddress.getPort() == 443 && isSslEnabledUpstream(ctx.channel()) || inetSocketAddress.getPort() == 80)) { portExtension = ":" + inetSocketAddress.getPort(); } InetAddress socketAddress = inetSocketAddress.getAddress(); localAddresses = new HashSet<>(); localAddresses.add(socketAddress.getHostAddress() + portExtension); localAddresses.add(socketAddress.getCanonicalHostName() + portExtension); localAddresses.add(socketAddress.getHostName() + portExtension); localAddresses.add("localhost" + portExtension); localAddresses.add("127.0.0.1" + portExtension); this.localAddresses.put(inetSocketAddress, unmodifiableSet(localAddresses)); return localAddresses; } }

Target:
private Set<String> getLocalAddresses(ChannelHandlerContext ctx) { SocketAddress localAddress = ctx.channel().localAddress(); Set<String> localAddresses = null; if (localAddress instanceof InetSocketAddress) { InetSocketAddress inetSocketAddress = (InetSocketAddress) localAddress; String portExtension = calculatePortExtension(inetSocketAddress, isSslEnabledUpstream(ctx.channel())); DefaultKeyValue<InetSocketAddress, String> cacheKey = new DefaultKeyValue<>(inetSocketAddress, portExtension); localAddresses = localAddressesCache.get(cacheKey); if (localAddresses == null) { localAddresses = calculateLocalAddresses(inetSocketAddress, portExtension); localAddressesCache.put(cacheKey, localAddresses); } } return (localAddresses == null) ? Collections.<String>emptySet() : localAddresses; }
Source:
public Pageable getPageable(@Nullable Pageable optionalPageable) { return optionalPageable != null ? optionalPageable : new PageRequest(0, 20); }

Target:
public Pageable getPageable(@Nullable Pageable optionalPageable) { return optionalPageable != null ? optionalPageable : new PageRequest(0, DEFAULT_PAGE_SIZE); }
Source:
protected void execute() { if (!bindingsExist()) { logger.debug("There is no existing DSMR binding configuration => refresh cycle aborted!"); return; } if (dsmrPort != null) { boolean receivedData = dsmrPort.portReceivedData(); long autoDetectDuration = dsmrPort.getDetectingDuration(); logger.debug("Port received any data:" + receivedData + ", auto detect duration:" + autoDetectDuration); if (!receivedData && autoDetectDuration > 2 * DSMR_UPDATE_INTERVAL) { logger.info("No valid data received for " + autoDetectDuration + "ms during autodetection, switch speed"); dsmrPort.close(); switch (portSpeed) { case LOW_SPEED: portSpeed = DSMRPort.PortSpeed.HIGH_SPEED; break; case HIGH_SPEED: portSpeed = DSMRPort.PortSpeed.LOW_SPEED; break; } } } if (dsmrPort == null || !dsmrPort.isOpen()) { logger.debug("Creating DSMR Port:" + port + ", speed:" + portSpeed); dsmrPort = new DSMRPort(port, portSpeed, dsmrMeters, DSMR_UPDATE_INTERVAL); } List<OBISMessage> messages = dsmrPort.read(); logger.debug("Received " + messages.size() + " messages"); for (OBISMessage msg : messages) { logger.debug("Read message:" + msg); for (DSMRBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { String dsmrItemId = provider.getDSMRItemID(itemName); for (CosemValue<? extends State> openHABValue : msg .getOpenHABValues()) { if (dsmrItemId.equals(openHABValue.getDsmrItemId())) { logger.debug("Publish data(" + dsmrItemId + ") to " + itemName); eventPublisher.postUpdate(itemName, openHABValue.getValue()); } } } } } }

Target:
protected void execute() { if (!bindingsExist()) { logger.debug("There is no existing DSMR binding configuration => refresh cycle aborted!"); return; } if (dsmrPort == null || !dsmrPort.isOpen()) { logger.debug("Creating DSMR Port:" + port); dsmrPort = new DSMRPort(port, new P1TelegramParser( new OBISMsgFactory(dsmrMeters)), DSMR_UPDATE_INTERVAL / 2, DSMR_UPDATE_INTERVAL * 2); } List<OBISMessage> messages = dsmrPort.read(); logger.debug("Received " + messages.size() + " messages"); for (OBISMessage msg : messages) { logger.debug("Read message:" + msg); for (DSMRBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { String dsmrItemId = provider.getDSMRItemID(itemName); for (CosemValue<? extends State> openHABValue : msg .getOpenHABValues()) { if (dsmrItemId.equals(openHABValue.getDsmrItemId())) { logger.debug("Publish data(" + dsmrItemId + ") to " + itemName); eventPublisher.postUpdate(itemName, openHABValue.getValue()); } } } } } }
Source:
public Mono<ClientHttpResponse> connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest, Mono<Void>> requestCallback) { HttpClientContext context = this.contextSupplier.get(); if (context.getCookieStore() == null) { context.setCookieStore(new BasicCookieStore()); } HttpComponentsClientHttpRequest request = new HttpComponentsClientHttpRequest(method, uri, context, this.dataBufferFactory); return requestCallback.apply(request).then(Mono.defer(() -> execute(request, context))); }

Target:
public Mono<ClientHttpResponse> connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest, Mono<Void>> requestCallback) { HttpClientContext context = this.contextProvider.apply(method, uri); if (context.getCookieStore() == null) { context.setCookieStore(new BasicCookieStore()); } HttpComponentsClientHttpRequest request = new HttpComponentsClientHttpRequest(method, uri, context, this.dataBufferFactory); return requestCallback.apply(request).then(Mono.defer(() -> execute(request, context))); }
Source:
private List<ChannelRecord> determineWritingChannels(final WireRecord record) { requireNonNull(record, message.wireRecordNonNull()); final List<ChannelRecord> assetRecordsToWriteChannels = CollectionUtil.newArrayList(); final AssetConfiguration assetConfiguration = getAssetConfiguration(); final Map<String, Channel> channels = assetConfiguration.getAssetChannels(); for (final Entry<String, Channel> channelEntry : channels.entrySet()) { final Channel channel = channelEntry.getValue(); final String channelName = channel.getName(); final ChannelType channelType = channel.getType(); if (channelType != WRITE && channelType != READ_WRITE) { continue; } Map<String, TypedValue<?>> wireRecordProperties = record.getProperties(); if (wireRecordProperties.containsKey(channelName)) { final TypedValue<?> value = wireRecordProperties.get(channelName); if (channel.getValueType() == value.getType()) { assetRecordsToWriteChannels.add(channel.createWriteRecord(value)); } } } return assetRecordsToWriteChannels; }

Target:
private List<ChannelRecord> determineWritingChannels(final WireRecord record) { requireNonNull(record, message.wireRecordNonNull()); final List<ChannelRecord> channelRecordsToWrite = CollectionUtil.newArrayList(); final AssetConfiguration assetConfiguration = getAssetConfiguration(); final Map<String, Channel> channels = assetConfiguration.getAssetChannels(); for (final Entry<String, Channel> channelEntry : channels.entrySet()) { final Channel channel = channelEntry.getValue(); final String channelName = channel.getName(); final ChannelType channelType = channel.getType(); if (channelType != WRITE && channelType != READ_WRITE) { continue; } Map<String, TypedValue<?>> wireRecordProperties = record.getProperties(); if (wireRecordProperties.containsKey(channelName)) { final TypedValue<?> value = wireRecordProperties.get(channelName); if (channel.getValueType() == value.getType()) { channelRecordsToWrite.add(channel.createWriteRecord(value)); } } } return channelRecordsToWrite; }
Source:
private Map<String, SymbolReference> getUpdatedAssignments(Assignments assignments) { HashMap<String, SymbolReference> mapUpdate = new HashMap<>(); for (Map.Entry<Symbol, Expression> assignment : assignments.getMap().entrySet()) { for (Map.Entry<String, SymbolReference> existingAlias : map.entrySet()) { if (assignment.getValue().equals(existingAlias.getValue())) { mapUpdate.put(existingAlias.getKey(), assignment.getKey().toSymbolReference()); } else if (assignment.getKey().toSymbolReference().equals(existingAlias.getValue())) { mapUpdate.put(existingAlias.getKey(), existingAlias.getValue()); } } } return ImmutableMap.copyOf(mapUpdate); }

Target:
private Map<String, SymbolReference> getUpdatedAssignments(Assignments assignments) { ImmutableMap.Builder<String, SymbolReference> mapUpdate = ImmutableMap.builder(); for (Map.Entry<Symbol, Expression> assignment : assignments.getMap().entrySet()) { for (Map.Entry<String, SymbolReference> existingAlias : map.entrySet()) { if (assignment.getValue().equals(existingAlias.getValue())) { mapUpdate.put(existingAlias.getKey(), assignment.getKey().toSymbolReference()); } else if (assignment.getKey().toSymbolReference().equals(existingAlias.getValue())) { mapUpdate.put(existingAlias.getKey(), existingAlias.getValue()); } } } return mapUpdate.build(); }
Source:
@Test public void getWithQueryThenUrlThrows() { class Example { @GET("foo/bar") Call<Object> method(@Query("hey") String hey, @Url Object url) { return null; } } try { buildRequest(Example.class, "hey", "foo/bar/"); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("A @Url parameter must not come after a @Query (parameter #2)\n" + " for method Example.method"); } }

Target:
@Test public void getWithQueryThenUrlThrows() { class Example { @GET("foo/bar") Call<Object> method(@Query("hey") String hey, @Url Object url) { return null; } } try { buildRequest(Example.class, "hey", "foo/bar/"); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("A @Url parameter must not come after a @Query (parameter #2)\n" + " for method Example.method"); } }
Source:
public boolean containsKey(Object key) { return validate().litems.containsKey(key); }

Target:
public boolean containsKey(Object key) { return validate().linkedListItems.containsKey(key); }
Source:
public boolean offer(Runnable event) { if (EVENT_LISTENER_DEPTH.get().intValue() > 0) { if (!super.offer(event)) { LOG.warn("Execution queue is full, executing Runnable on current thread"); event.run(); } return true; } else { try { super.put(event); return true; } catch(InterruptedException ie) { Thread.currentThread().interrupt(); } return false; } }

Target:
public boolean offer(Runnable event) { if (EVENT_LISTENER_DEPTH.get().intValue() > 0) { if (!super.offer(event)) { LOG.warn("Execution queue is full, executing Runnable on current thread"); Logging.withPrefix(Eventd.LOG4J_CATEGORY, event); } return true; } else { try { super.put(event); return true; } catch(InterruptedException ie) { Thread.currentThread().interrupt(); } return false; } }
Source:
public Response isValidToken(@Context HttpServletRequest request) { TOTPManager totpManager = (TOTPManager) PrivilegedCarbonContext.getThreadLocalCarbonContext().getOSGiService (TOTPManager.class); String username = request.getParameter("username"); int token = Integer.parseInt(request.getParameter("token")); boolean isvalid = false; try { isvalid = totpManager.isValidTokenLocalUser(token, username); if (isvalid) { log.info("TOTP token is accepted"); return Response.status(Response.Status.ACCEPTED).type(MediaType.APPLICATION_JSON_TYPE) .entity("Token is verified").build(); } else { log.info("TOTP token is not valid"); return Response.status(Response.Status.BAD_REQUEST).type(MediaType.APPLICATION_JSON_TYPE) .entity("Token is not valid").build(); } } catch (TOTPException e) { log.error("Error when validating the token", e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).type(MediaType.APPLICATION_JSON_TYPE) .entity("Error while validating the token").build(); } }

Target:
public Response isValidToken(@Context HttpServletRequest request) { Hashtable<String, String> props = new Hashtable<String, String>(); TOTPManager totpManager = (TOTPManager) CarbonContext.getThreadLocalCarbonContext().getOSGiService (TOTPManager.class, props); String username = CharacterEncoder.getSafeText(request.getParameter("username")); int token = Integer.parseInt(CharacterEncoder.getSafeText(request.getParameter("token"))); boolean isvalid = false; try { isvalid = totpManager.isValidTokenLocalUser(token, username); if (isvalid) { if (log.isDebugEnabled()) { log.debug("TOTP token is accepted"); } return Response.status(Response.Status.ACCEPTED).type(MediaType.APPLICATION_JSON_TYPE) .entity("Token is verified").build(); } else { if (log.isDebugEnabled()) { log.debug("TOTP token is not valid"); } return Response.status(Response.Status.BAD_REQUEST).type(MediaType.APPLICATION_JSON_TYPE) .entity("Token is not valid").build(); } } catch (TOTPException e) { log.error("Error when validating the token", e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).type(MediaType.APPLICATION_JSON_TYPE) .entity("Error while validating the token").build(); } }
Source:
static int getExitOrientationFromFile(ContentResolver contentResolver, Uri uri) { Cursor cursor = null; try { contentResolver.openInputStream(uri); cursor = contentResolver.query(uri, CONTENT_DATA, null, null, null); if (cursor == null || !cursor.moveToFirst()) { return 0; } String filePath = cursor.getString(0); ExifInterface exifInterface = new ExifInterface(filePath); return exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED); } catch (Exception ignored) { return ExifInterface.ORIENTATION_UNDEFINED; } finally { if (cursor != null) { cursor.close(); } } }

Target:
static int getExitOrientationFromFile(ContentResolver contentResolver, Uri uri) { Cursor cursor = null; try { cursor = contentResolver.query(uri, CONTENT_DATA, null, null, null); if (cursor == null || !cursor.moveToFirst()) { return 0; } String filePath = cursor.getString(0); ExifInterface exifInterface = new ExifInterface(filePath); return exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED); } catch (Exception ignored) { return ExifInterface.ORIENTATION_UNDEFINED; } finally { if (cursor != null) { cursor.close(); } } }
Source:
Question question(Long id) { return questions.get(id); }

Target:
private Question question(Long id) { return questions.get(id); }
Source:
private void sendTupleDomain() { if (positionCount > positionsLimit) { client.ifPresent(client -> client.storeSummary(new DynamicFilterSummary(TupleDomain.all()))); return; } ImmutableMap.Builder<String, Domain> domainsBuilder = ImmutableMap.builder(); for (int channelIndex = 0; channelIndex < filterChannels.size(); channelIndex++) { Integer channel = filterChannels.get(channelIndex); List<Object> values = valuesBuilder.get(channelIndex).build(); Domain domain; if (values.isEmpty()) { domain = Domain.none(types.get(channel)); } else { domain = Domain.create(ValueSet.copyOf(types.get(channel), values), nullsAllowed[channelIndex]); } domainsBuilder.put(filterDynamicFilterNames.get(channelIndex).toString(), domain); } client.ifPresent(client -> client.storeSummary(new DynamicFilterSummary(TupleDomain.withColumnDomains(domainsBuilder.build())))); }

Target:
private void sendTupleDomain() { if (positionCount > positionsLimit) { client.storeSummary(new DynamicFilterSummary(TupleDomain.all())); return; } ImmutableMap.Builder<String, Domain> domainsBuilder = ImmutableMap.builder(); for (int channelIndex = 0; channelIndex < filterChannels.size(); channelIndex++) { Integer channel = filterChannels.get(channelIndex); List<Object> values = valuesBuilder.get(channelIndex).build(); Domain domain; if (values.isEmpty()) { domain = Domain.none(types.get(channel)); } else { domain = Domain.create(ValueSet.copyOf(types.get(channel), values), nullsAllowed[channelIndex]); } domainsBuilder.put(filterDynamicFilterNames.get(channelIndex).toString(), domain); } client.storeSummary(new DynamicFilterSummary(TupleDomain.withColumnDomains(domainsBuilder.build()))); }
Source:
public Token selectToken(Text service, Collection<Token<? extends TokenIdentifier>> tokens) { LOG.trace("Getting token for service {}", service); Token token = super.selectToken(service, tokens); LOG.info("Got tokens: for service {}", token, service); return token; }

Target:
public Token selectToken(Text service, Collection<Token<? extends TokenIdentifier>> tokens) { LOG.trace("Getting token for service {}", service); Token token = super.selectToken(service, tokens); LOG.debug("Got tokens: for service {}", token, service); return token; }
Source:
public void poll() { if (isMonitoringNeeded(vdsManager.getStatus())) { VmsListFetcher fetcher = new VmsStatisticsFetcher(vdsManager); long fetchTime = System.nanoTime(); if (fetcher.fetch()) { getVmsMonitoring().perform(fetcher.getChangedVms(), fetchTime, vdsManager, true); List<VdsmVm> vdsmVmsToMonitor = fetcher.getChangedVms().stream(). filter(monitoredVm -> monitoredVm.getFirst() != null). map(Pair::getSecond).collect(Collectors.toList()); processDevices(vdsmVmsToMonitor.stream(), fetchTime); } else { log.info("Failed to fetch vms info for host '{}' - skipping VMs monitoring.", vdsManager.getVdsName()); } } }

Target:
public void poll() { if (isMonitoringNeeded(vdsManager.getStatus())) { VmsListFetcher fetcher = new VmsStatisticsFetcher(vdsManager); long fetchTime = System.nanoTime(); if (fetcher.fetch()) { getVmsMonitoring().perform(fetcher.getChangedVms(), fetchTime, vdsManager, true); Stream<VdsmVm> vdsmVmsToMonitor = fetcher.getChangedVms().stream(). filter(monitoredVm -> monitoredVm.getFirst() != null). map(Pair::getSecond); processDevices(vdsmVmsToMonitor, fetchTime); } else { log.info("Failed to fetch vms info for host '{}' - skipping VMs monitoring.", vdsManager.getVdsName()); } } }
Source:
private static Collection<EObject> getDeployableObjects(ISelection selection){ Set<EObject> retVal = new HashSet<>(); if (selection instanceof StructuredSelection) { for (Iterator iterator = (( StructuredSelection)selection).iterator(); iterator.hasNext();) { Object selectedObject = iterator.next(); if(selectedObject instanceof EObject) { addEObject((EObject)selectedObject, retVal); } else if(selectedObject instanceof EditorPart && ((EditPart)selectedObject).getModel() instanceof EObject) { addEObject((EObject)((EditPart)selectedObject).getModel(), retVal); } } } return retVal; }

Target:
private static Collection<EObject> getDeployableObjects(ISelection selection){ Set<EObject> retVal = new HashSet<>(); if (selection instanceof StructuredSelection) { for (Object selectedObject : (( StructuredSelection)selection).toArray()) { if(selectedObject instanceof EObject) { addEObject((EObject)selectedObject, retVal); } else if(selectedObject instanceof EditorPart && ((EditPart)selectedObject).getModel() instanceof EObject) { addEObject((EObject)((EditPart)selectedObject).getModel(), retVal); } } } return retVal; }
Source:
private void processAnnotations(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(AutoService.class); log(annotations.toString()); log(elements.toString()); for (Element e : elements) { TypeElement providerImplementer = (TypeElement) e; AnnotationMirror annotationMirror = getAnnotationMirror(e, AutoService.class) .get(); Set<DeclaredType> providerInterfaces = getFieldOfClasses( annotationMirror, "value", processingEnv.getElementUtils()); for (DeclaredType providerInterface : providerInterfaces) { TypeElement providerType = (TypeElement) providerInterface.asElement(); log("provider interface: " + providerType.getQualifiedName()); log("provider implementer: " + providerImplementer.getQualifiedName()); if (!checkImplementer(providerImplementer, providerType)) { String message = "ServiceProviders must implement their service provider interface. " + providerImplementer.getQualifiedName() + " does not implement " + providerType.getQualifiedName(); error(message, e, annotationMirror); } String providerTypeName = getBinaryName(providerType); String providerImplementerName = getBinaryName(providerImplementer); log("provider interface binary name: " + providerTypeName); log("provider implementer binary name: " + providerImplementerName); providers.put(providerTypeName, providerImplementerName); } } }

Target:
private void processAnnotations(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(AutoService.class); log(annotations.toString()); log(elements.toString()); for (Element e : elements) { TypeElement providerImplementer = (TypeElement) e; AnnotationMirror annotationMirror = getAnnotationMirror(e, AutoService.class).get(); Set<DeclaredType> providerInterfaces = getValueFieldOfClasses(annotationMirror); if (providerInterfaces.isEmpty()) { error(MISSING_SERVICES_ERROR, e, annotationMirror); continue; } for (DeclaredType providerInterface : providerInterfaces) { TypeElement providerType = MoreTypes.asTypeElement(providerInterface); log("provider interface: " + providerType.getQualifiedName()); log("provider implementer: " + providerImplementer.getQualifiedName()); if (checkImplementer(providerImplementer, providerType)) { providers.put(getBinaryName(providerType), getBinaryName(providerImplementer)); } else { String message = "ServiceProviders must implement their service provider interface. " + providerImplementer.getQualifiedName() + " does not implement " + providerType.getQualifiedName(); error(message, e, annotationMirror); } } } }
Source:
public int hashCode() { return Objects.hash(repository, tag, authConfigs, doForcePull, memoryLimit, memorySwapLimit, files, dockerfile, remote, q, nocache, rm, forceRm, buildArgs); }

Target:
public int hashCode() { return Objects.hash(repository, tag, authConfigs, doForcePull, memoryLimit, memorySwapLimit, files, dockerfile, remote, quiet, noCache, removeIntermediateContainer, forceRemoveIntermediateContainers, buildArgs); }
Source:
public void logIn(final String email, final String password, final ApiCallback<Object> callback) { if (failOnNoInternet(callback)) { callback.onFailure("Active internet connection."); return; } RequestParams params = new RequestParams(); params.put("username", email); params.put("password", password); Log.d(TAG, "logging in as " + email); client.post(sessionUrl, params, new JsonHttpResponseHandler() { @Override public void onSuccess(JSONObject obj) { Log.d(TAG, "User " + email + " logged in"); if (callback != null) { callback.onSuccess(null); } } @Override public void onFailure(Throwable t, JSONObject obj) { String message = "Invalid email/password combination."; if (callback != null) { try { String nameErr = obj.getJSONArray("username").getString(0); String passErr = obj.getJSONArray("password_digest").getString(0); final String errMessage = nameErr + " " + passErr; Log.d(TAG, "errors: " + errMessage); callback.onFailure(message); } catch (JSONException ej) { Log.d(TAG, "JSON problems on log in: " + t.getMessage()); callback.onFailure(message); } } } @Override public void onFailure(Throwable t, String message) { if (t instanceof SocketTimeoutException) { callback.onFailure("Network Timeout"); } else { callback.onFailure(message); } } }); }

Target:
public void logIn(final String email, final String password, final ApiCallback<Object> callback) { if (failOnNoInternet(callback)) { return; } RequestParams params = new RequestParams(); params.put("username", email); params.put("password", password); Log.d(TAG, "logging in as " + email); client.post(sessionUrl, params, new JsonHttpResponseHandler() { @Override public void onSuccess(JSONObject obj) { Log.d(TAG, "User " + email + " logged in"); if (callback != null) { callback.onSuccess(null); } } @Override public void onFailure(Throwable t, JSONObject obj) { if (callback != null) { try { String message = obj.getString("login"); Log.d(TAG, "Login Error: " + message); callback.onFailure(message); } catch (JSONException ej) { Log.d(TAG, "JSON problems on log in: " + t.getMessage()); onFailure(t, t.getMessage()); } } } @Override public void onFailure(Throwable t, String message) { if (t instanceof SocketTimeoutException) { callback.onFailure(UBudgetApp.getAppContext() .getString(R.string.error_network)); } else { callback.onFailure(message); } } }); }
Source:
public void testListInfoTypes() throws Exception { InfoTypesList.listInfoTypes("supported_by=INSPECT", "en-US"); String output = bout.toString(); assertTrue(output.contains("Name") && output.contains("Display name")); }

Target:
public void testListInfoTypes() throws Exception { InfoTypesList.listInfoTypes(); String output = bout.toString(); assertThat(output, CoreMatchers.containsString("Name")); assertThat(output, CoreMatchers.containsString("Display name")); }
Source:
protected void executeQueryCommand() { Map<String, String> glusterServers = null; VDS upServer = getClusterUtils().getUpServer(getParameters().getClusterId()); if(upServer != null ) { VDSReturnValue returnValue = getBackendInstance().RunVdsCommand(VDSCommandType.GlusterServersList, new VdsIdVDSCommandParametersBase(upServer.getId())); glusterServers = getAddedGlusterServers((List<GlusterServerInfo>) returnValue.getReturnValue()); } else { glusterServers = new HashMap<String, String>(); } getQueryReturnValue().setReturnValue(glusterServers); }

Target:
protected void executeQueryCommand() { Map<String, String> glusterServers = new HashMap<String, String>(); VDS upServer = getClusterUtils().getUpServer(getParameters().getClusterId()); if(upServer != null ) { VDSReturnValue returnValue = getBackendInstance().RunVdsCommand(VDSCommandType.GlusterServersList, new VdsIdVDSCommandParametersBase(upServer.getId())); glusterServers = getAddedGlusterServers((List<GlusterServerInfo>) returnValue.getReturnValue()); } getQueryReturnValue().setReturnValue(glusterServers); }
Source:
public synchronized void createRemoteConsumer(FederatedConsumerKey key, Transformer transformer, ClientSessionCallback callback) { if (started) { FederatedQueueConsumer remoteQueueConsumer = remoteQueueConsumers.get(key); if (remoteQueueConsumer == null) { if (server.hasBrokerFederationPlugins()) { try { server.callBrokerFederationPlugins(plugin -> plugin.beforeCreateFederatedQueueConsumer(key)); } catch (ActiveMQException t) { logger.warn("Error executing beforeCreateFederatedQueueConsumer plugin method: {}", t.getMessage(), t); throw new IllegalStateException(t.getMessage(), t.getCause()); } } remoteQueueConsumer = new FederatedQueueConsumer(federation, server, transformer, key, upstream, callback); remoteQueueConsumer.start(); remoteQueueConsumers.put(key, remoteQueueConsumer); if (server.hasBrokerFederationPlugins()) { try { final FederatedQueueConsumer finalConsumer = remoteQueueConsumer; server.callBrokerFederationPlugins(plugin -> plugin.afterCreateFederatedQueueConsumer(finalConsumer)); } catch (ActiveMQException t) { logger.warn("Error executing afterCreateFederatedQueueConsumer plugin method: {}", t.getMessage(), t); throw new IllegalStateException(t.getMessage(), t.getCause()); } } } remoteQueueConsumer.incrementCount(); } }

Target:
public synchronized void createRemoteConsumer(FederatedConsumerKey key, Transformer transformer, ClientSessionCallback callback) { if (started) { FederatedQueueConsumer remoteQueueConsumer = remoteQueueConsumers.get(key); if (remoteQueueConsumer == null) { if (server.hasBrokerFederationPlugins()) { try { server.callBrokerFederationPlugins(plugin -> plugin.beforeCreateFederatedQueueConsumer(key)); } catch (ActiveMQException t) { ActiveMQServerLogger.LOGGER.federationPluginExecutionError(t, "beforeCreateFederatedQueueConsumer"); throw new IllegalStateException(t.getMessage(), t.getCause()); } } remoteQueueConsumer = new FederatedQueueConsumerImpl(federation, server, transformer, key, upstream, callback); remoteQueueConsumer.start(); remoteQueueConsumers.put(key, remoteQueueConsumer); if (server.hasBrokerFederationPlugins()) { try { final FederatedQueueConsumer finalConsumer = remoteQueueConsumer; server.callBrokerFederationPlugins(plugin -> plugin.afterCreateFederatedQueueConsumer(finalConsumer)); } catch (ActiveMQException t) { ActiveMQServerLogger.LOGGER.federationPluginExecutionError(t, "afterCreateFederatedQueueConsumer"); throw new IllegalStateException(t.getMessage(), t.getCause()); } } } remoteQueueConsumer.incrementCount(); } }
Source:
private static TLSClientParameters constructTLSClient(TLSClientParameters tlsClientParameters) { try { SSLContext context = SSLUtils.getSSLContext(tlsClientParameters); SSLSocketFactory factory = context.getSocketFactory(); if (factory != null) { tlsClientParameters.setSSLSocketFactory(factory); } else { throw new RuntimeException("Couldn't get the SSLSocketFactory."); } tlsClientParameters.setDisableCNCheck(true); } catch (GeneralSecurityException | IllegalStateException e) { LOG.error("Could not get TLS client parameters: ", e.getLocalizedMessage(), e); throw new RuntimeException("Could not create SSL Context.", e); } return tlsClientParameters; }

Target:
private static TLSClientParameters constructTLSClient(TLSClientParameters tlsClientParameters) { try { SSLSocketFactory factory = SSLUtils.getSSLContext(tlsClientParameters).getSocketFactory(); if (factory != null) { tlsClientParameters.setSSLSocketFactory(factory); } else { throw new SecurityException("Couldn't get the SSLSocketFactory."); } tlsClientParameters.setDisableCNCheck(true); } catch (GeneralSecurityException | IllegalStateException e) { LOG.error("Could not get TLS client parameters: ", e.getLocalizedMessage(), e); throw new SecurityException("Could not create SSL Context.", e); } return tlsClientParameters; }
Source:
public void hideChild(MElementContainer<MUIElement> parentElement, MUIElement child) { super.hideChild(parentElement, child); if (child.getRenderer() != null) { Widget widget = (Widget) child.getWidget(); if (widget != null && !widget.isDisposed()) { widget.dispose(); } ToolBar toolbar = (ToolBar) getUIContainer(child); if (toolbar != null && !toolbar.isDisposed()) { toolbar.pack(true); toolbar.requestLayout(); } } }

Target:
public void hideChild(MElementContainer<MUIElement> parentElement, MUIElement child) { super.hideChild(parentElement, child); if (child.getRenderer() != null) { Widget widget = (Widget) child.getWidget(); if (widget != null && !widget.isDisposed()) { widget.dispose(); } ToolBar toolbar = (ToolBar) getUIContainer(child); if (toolbar != null && !toolbar.isDisposed()) { toolbar.requestLayout(); } } }
Source:
public Set<Usermetadata> getUserMetadataByLogs(List<Integer> logIds, UserMetadataTypeEnum userMetadataTypeEnum) { if (null == logIds || logIds.size() == 0) { return null; } List<Set<Usermetadata>> lists = new ArrayList<>(); for (Integer logId : logIds) { lists.add(getUserMetadataByLog(logId, userMetadataTypeEnum)); } Set<Usermetadata> result = new HashSet<>(); for (Set<Usermetadata> umSet : lists) { for (Usermetadata u : umSet) { int count = 0; Set<UsermetadataLog> umlSet = u.getUsermetadataLog(); if (umlSet.size() == logIds.size()) { for (UsermetadataLog uml : umlSet) { if (logIds.contains(uml.getLog().getId())) { count += 1; } } if (count == logIds.size()) { result.add(u); } } } } return result; }

Target:
public Set<Usermetadata> getUserMetadataByLogs(List<Integer> logIds, UserMetadataTypeEnum userMetadataTypeEnum) { Set<Usermetadata> result = new HashSet<>(); if (null == logIds || logIds.size() == 0) { return result; } List<Set<Usermetadata>> lists = new ArrayList<>(); for (Integer logId : logIds) { lists.add(getUserMetadataByLog(logId, userMetadataTypeEnum)); } for (Set<Usermetadata> umSet : lists) { for (Usermetadata u : umSet) { int count = 0; Set<UsermetadataLog> umlSet = u.getUsermetadataLog(); if (umlSet.size() == logIds.size()) { for (UsermetadataLog uml : umlSet) { if (logIds.contains(uml.getLog().getId())) { count += 1; } } if (count == logIds.size()) { result.add(u); } } } } return result; }
Source:
public void register() { boolean isLeader = leaderElector.tryBecomeLeader(); if(isLeader) { listenToProcessorLiveness(); debounceTimer.scheduleAfterDebounceTime(ScheduleAfterDebounceTime.ON_PROCESSOR_CHANGE, ScheduleAfterDebounceTime.DEBOUNCE_TIME_MS, () -> zkListener.onBecomeLeader()); } zkUtils.subscribeToJobModelVersionChange(new ZkJobModelVersionChangeHandler(debounceTimer)); }

Target:
public void register() { leaderElector.tryBecomeLeader(); zkUtils.subscribeToJobModelVersionChange(new ZkJobModelVersionChangeHandler(debounceTimer)); }
Source:
public void testNoAddressResolutionForGraphite() throws Exception { this.graphiteReporterFactory.build(new MetricRegistry()); final ArgumentCaptor<Graphite> argument = ArgumentCaptor.forClass(Graphite.class); verify(this.builderSpy).build(argument.capture()); final Graphite graphite = argument.getValue(); assertThat(getField(graphite, "hostname")).isEqualTo("localhost"); assertThat(getField(graphite, "port")).isEqualTo(8080); assertThat(getField(graphite, "address")).isNull(); }

Target:
public void testNoAddressResolutionForGraphite() throws Exception { graphiteReporterFactory.build(new MetricRegistry()); final ArgumentCaptor<Graphite> argument = ArgumentCaptor.forClass(Graphite.class); verify(builderSpy).build(argument.capture()); final Graphite graphite = argument.getValue(); assertThat(getField(graphite, "hostname")).isEqualTo("localhost"); assertThat(getField(graphite, "port")).isEqualTo(8080); assertThat(getField(graphite, "address")).isNull(); }
Source:
public int getMaxIntermediateSize() { return Double.BYTES; }

Target:
public int getMaxIntermediateSize() { return Double.BYTES + Byte.BYTES; }
Source:
public static BlobId craft(BlobId inputId, short targetVersion, short accountId, short containerId) { if (targetVersion < BLOB_ID_V3) { throw new IllegalArgumentException("Target version for crafting must be V3 or higher"); } return new BlobId(targetVersion, BlobIdType.CRAFTED, inputId.getDatacenterId(), accountId, containerId, inputId.partitionId, inputId.isEncrypted, null, inputId.uuid); }

Target:
public static BlobId craft(BlobId inputId, short targetVersion, short accountId, short containerId) { if (targetVersion < BLOB_ID_V3) { throw new IllegalArgumentException("Target version for crafting must be V3 or higher"); } return new BlobId(targetVersion, BlobIdType.CRAFTED, inputId.getDatacenterId(), accountId, containerId, inputId.partitionId, inputId.isEncrypted, inputId.blobDataType, inputId.uuid); }
Source:
private static void checkDictionaries(SubscriptionContext ctx, StringFormat format, DictionaryLiteral dict) { if (format.hasPositionalFields()) { ctx.addIssue(dict, "Replace this formatting argument with a tuple."); return; } if (dict.elements().stream().anyMatch(StringFormatMisuseCheck::isOutOfScopeDictionaryElement)) { return; } Map<String, List<StringFormat.ReplacementField>> fieldMap = format.replacementFields().stream().collect( Collectors.groupingBy(StringFormat.ReplacementField::mappingKey)); if (fieldMap.size() != dict.elements().size()) { reportInvalidArgumentSize(ctx, dict, fieldMap.size(), dict.elements().size()); return; } for (DictionaryLiteralElement element : dict.elements()) { KeyValuePair pair = (KeyValuePair) element; String key = ((StringLiteral) pair.key()).trimmedQuotesValue(); List<StringFormat.ReplacementField> fields = fieldMap.remove(key); if (fields == null) { continue; } fields.forEach(field -> field.validateArgument(pair.value())); } fieldMap.keySet().forEach(fieldName -> ctx.addIssue(dict, String.format("Provide a value for field \"%s\".", fieldName))); }

Target:
private static void checkDictionaries(SubscriptionContext ctx, StringFormat format, DictionaryLiteral dict) { for (DictionaryLiteralElement element : dict.elements()) { if (!element.is(Tree.Kind.KEY_VALUE_PAIR)) { return; } KeyValuePair pair = (KeyValuePair) element; if (!pair.key().type().canOnlyBe("str")) { ctx.addIssue(pair.key(), "Replace this key; %-format accepts only string keys."); return; } if (!pair.key().is(Tree.Kind.STRING_LITERAL)) { return; } } Map<String, List<StringFormat.ReplacementField>> fieldMap = format.replacementFields().stream().collect( Collectors.groupingBy(StringFormat.ReplacementField::mappingKey)); for (DictionaryLiteralElement element : dict.elements()) { KeyValuePair pair = (KeyValuePair) element; String key = ((StringLiteral) pair.key()).trimmedQuotesValue(); List<StringFormat.ReplacementField> fields = fieldMap.remove(key); if (fields == null) { continue; } fields.forEach(field -> field.validateArgument(pair.value())); } fieldMap.keySet().forEach(fieldName -> ctx.addIssue(dict, String.format("Provide a value for field \"%s\".", fieldName))); }
Source:
protected UserCommandElement(@Nullable Text key, boolean returnSource) { super(key); this.possiblePlayer = new PlayerCommandElement(key, false); this.returnSource = returnSource; }

Target:
protected UserCommandElement(@Nullable Text key, boolean returnSource) { super(key); this.returnSource = returnSource; }
Source:
public XpathFilter(Pattern files, Pattern checks, Pattern message, String moduleId, String query) { if (files == null) { filePattern = null; fileRegexp = null; } else { filePattern = files.pattern(); fileRegexp = files; } if (checks == null) { checkPattern = null; checkRegexp = null; } else { checkPattern = checks.pattern(); checkRegexp = checks; } if (message == null) { messagePattern = null; messageRegexp = null; } else { messagePattern = message.pattern(); messageRegexp = message; } this.moduleId = moduleId; xpathQuery = query; if (xpathQuery == null) { xpathExpression = null; } else { final XPathEvaluator xpathEvaluator = new XPathEvaluator(); try { xpathExpression = xpathEvaluator.createExpression(xpathQuery); } catch (XPathException ex) { throw new IllegalStateException("Illegal xpath query: " + xpathQuery, ex); } } }

Target:
public XpathFilter(Pattern files, Pattern checks, Pattern message, String moduleId, String query) { if (files == null) { filePattern = null; fileRegexp = null; } else { filePattern = files.pattern(); fileRegexp = files; } if (checks == null) { checkPattern = null; checkRegexp = null; } else { checkPattern = checks.pattern(); checkRegexp = checks; } if (message == null) { messagePattern = null; messageRegexp = null; } else { messagePattern = message.pattern(); messageRegexp = message; } this.moduleId = moduleId; xpathQuery = query; if (xpathQuery == null) { xpathExpression = null; } else { final XPathEvaluator xpathEvaluator = new XPathEvaluator(); try { xpathExpression = xpathEvaluator.createExpression(xpathQuery); } catch (XPathException ex) { throw new IllegalArgumentException("Incorrect xpath query: " + xpathQuery, ex); } } }
Source:
public String getAttributeValue(String namespace, String localPart) { final String result; if (VALUE_ATTRIBUTE_NAME.equals(localPart)) { result = value; } else if (TEXT_ATTRIBUTE_NAME.equals(localPart)) { result = ident; } else { throw throwUnsupportedOperationException(); } return result; }

Target:
public String getAttributeValue(String namespace, String localPart) { final AttributeNode attribute = attributes.get(localPart); final String result; if (attribute == null) { result = null; } else { result = attribute.getStringValue(); } return result; }
Source:
public void testServiceAnnotation() { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(ConfigTest.class.getPackage().getName().replace('.', '/') + "/service-annotation.xml"); ctx.start(); try { DemoService demoService = refer("dubbo://127.0.0.1:20887"); String hello = demoService.sayName("hello"); assertEquals("say:hello", hello); } finally { ctx.stop(); ctx.close(); } }

Target:
public void testServiceAnnotation() { AnnotationConfigApplicationContext providerContext = new AnnotationConfigApplicationContext(); providerContext.register(ProviderConfiguration.class); providerContext.refresh(); ReferenceConfig<HelloService> reference = new ReferenceConfig<HelloService>(); reference.setApplication(new ApplicationConfig("consumer")); reference.setRegistry(new RegistryConfig(RegistryConfig.NO_AVAILABLE)); reference.setInterface(HelloService.class); reference.setUrl("dubbo://127.0.0.1:12345"); String hello = reference.get().sayHello("hello"); assertEquals("Hello, hello", hello); }
Source:
public void sendMessages(String topic, String... messages) throws IOException { try (AutoClosableProcess autoClosableProcess = AutoClosableProcess.runNonBlocking( kafkaDir.resolve(Paths.get("bin", "kafka-console-producer.sh")).toString(), "--broker-list", KAFKA_ADDRESS, "--topic", topic, "--property", "parse.key=true", "--property", "key.separator=\t")) { try (PrintStream printStream = new PrintStream(autoClosableProcess.getProcess().getOutputStream(), true, StandardCharsets.UTF_8.name())) { for (final String message : messages) { printStream.println(message); } printStream.flush(); } try { autoClosableProcess.getProcess().waitFor(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }

Target:
public void sendMessages(String topic, String... messages) throws IOException { List<String> args = createSendMessageArguments(topic); sendMessagesAndWait(args, messages); }
Source:
public Map<ObjectId, String> call() throws GitAPIException { try { Map<ObjectId, String> nonCommits = new HashMap<ObjectId, String>(); LinkedList<NameRevCommit> pending = new LinkedList<NameRevCommit>(); addPrefixes(nonCommits, pending); int cutoff = minCommitTime() - COMMIT_TIME_SLOP; while (!pending.isEmpty()) { NameRevCommit c = pending.remove(); if (c.getCommitTime() < cutoff) continue; boolean merge = c.getParentCount() > 1; long cost = c.cost + (merge ? MERGE_COST : 1); for (int i = 0; i < c.getParentCount(); i++) { NameRevCommit p = (NameRevCommit) walk.parseCommit(c.getParent(i)); if (p.tip == null || compare(c.tip, cost, p.tip, p.cost) < 0) { if (merge) { p.tip = c.format().append('^').append(i + 1).toString(); p.distance = 0; } else { p.tip = c.tip; p.distance = c.distance + 1; } p.cost = cost; pending.add(p); } } } Map<ObjectId, String> result = new LinkedHashMap<ObjectId, String>(revs.size()); for (ObjectId id : revs) { RevObject o = walk.parseAny(id); if (o instanceof NameRevCommit) { NameRevCommit c = (NameRevCommit) o; if (c.tip != null) result.put(id, simplify(c.format().toString())); } else { String name = nonCommits.get(id); if (name != null) result.put(id, simplify(name)); } } setCallable(false); walk.release(); return result; } catch (IOException e) { walk.reset(); throw new JGitInternalException(e.getMessage(), e); } }

Target:
public Map<ObjectId, String> call() throws GitAPIException { try { Map<ObjectId, String> nonCommits = new HashMap<ObjectId, String>(); FIFORevQueue pending = new FIFORevQueue(); addPrefixes(nonCommits, pending); int cutoff = minCommitTime() - COMMIT_TIME_SLOP; while (true) { NameRevCommit c = (NameRevCommit) pending.next(); if (c == null) break; if (c.getCommitTime() < cutoff) continue; boolean merge = c.getParentCount() > 1; long cost = c.cost + (merge ? MERGE_COST : 1); for (int i = 0; i < c.getParentCount(); i++) { NameRevCommit p = (NameRevCommit) walk.parseCommit(c.getParent(i)); if (p.tip == null || compare(c.tip, cost, p.tip, p.cost) < 0) { if (merge) { p.tip = c.format().append('^').append(i + 1).toString(); p.distance = 0; } else { p.tip = c.tip; p.distance = c.distance + 1; } p.cost = cost; pending.add(p); } } } Map<ObjectId, String> result = new LinkedHashMap<ObjectId, String>(revs.size()); for (ObjectId id : revs) { RevObject o = walk.parseAny(id); if (o instanceof NameRevCommit) { NameRevCommit c = (NameRevCommit) o; if (c.tip != null) result.put(id, simplify(c.format().toString())); } else { String name = nonCommits.get(id); if (name != null) result.put(id, simplify(name)); } } setCallable(false); walk.release(); return result; } catch (IOException e) { walk.reset(); throw new JGitInternalException(e.getMessage(), e); } }
Source:
public void updateConstraintDescriptor(ConstraintDescriptor cd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException{ ExecIndexRow keyRow1; ExecRow row; DataValueDescriptor IDOrderable; TabInfoImpl ti=getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM); SYSCONSTRAINTSRowFactory rf=(SYSCONSTRAINTSRowFactory)ti.getCatalogRowFactory(); IDOrderable=getIDValueAsCHAR(formerUUID); keyRow1=exFactory.getIndexableRow(1); keyRow1.setColumn(1,IDOrderable); row=rf.makeRow(cd,null); assert rf.getNumIndexes()==3:"Programmer error: there are more indexes on sysconstraints than expected"; boolean[] bArray=new boolean[3]; if(colsToSet==null){ bArray[0]=true; bArray[1]=true; bArray[2]=true; }else{ for(int colToSet : colsToSet){ switch(colToSet){ case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_CONSTRAINTID: bArray[0]=true; break; case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_CONSTRAINTNAME: case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_SCHEMAID: bArray[1]=true; break; case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_TABLEID: bArray[2]=true; break; default: assert false: "Unexpected colToSet: " + colToSet; } } } ti.updateRow(keyRow1,row,SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX1_ID,bArray,colsToSet,tc); }

Target:
public void updateConstraintDescriptor(ConstraintDescriptor cd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException{ ExecIndexRow keyRow1; ExecRow row; DataValueDescriptor IDOrderable; TabInfoImpl ti=getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM); SYSCONSTRAINTSRowFactory rf=(SYSCONSTRAINTSRowFactory)ti.getCatalogRowFactory(); IDOrderable=getIDValueAsCHAR(formerUUID); keyRow1=exFactory.getIndexableRow(1); keyRow1.setColumn(1,IDOrderable); row=rf.makeRow(cd,null); assert rf.getNumIndexes()==3:"Programmer error: there are more indexes on sysconstraints than expected"; boolean[] bArray=new boolean[3]; if(colsToSet==null){ bArray[0]=true; bArray[1]=true; bArray[2]=true; }else{ for(int colToSet : colsToSet){ switch(colToSet){ case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_CONSTRAINTID: bArray[0]=true; break; case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_CONSTRAINTNAME: case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_SCHEMAID: bArray[1]=true; break; case SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_TABLEID: bArray[2]=true; break; default: } } } ti.updateRow(keyRow1,row,SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX1_ID,bArray,colsToSet,tc); }