diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 00000000..01b9ceed --- /dev/null +++ b/.claude/CLAUDE.md @@ -0,0 +1 @@ +@../.github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index eb32e7f2..b23eb308 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -10,7 +10,7 @@ This repository provides Java stub declarations for Salesforce platform types to - **Root package**: `io.github.apexdevtools.standardtypes` - **Namespace mapping**: Each Salesforce namespace becomes a Java package (e.g., `System` → `io.github.apexdevtools.standardtypes.System`) -- **Cross-references**: Types reference each other using proper `io.github.apexdevtools.standardtypes.*` imports, never native Java types (except `Object`) +- **Cross-references**: Types reference each other using proper `io.github.apexdevtools.standardtypes.*` imports, never native Java types. Permitted native Java types are limited to `Object`, `Exception` (exception stubs extend it and take it as a parameter), and `java.lang.UnsupportedOperationException` (thrown by every method body) ### Key Package Categories @@ -25,9 +25,25 @@ This repository provides Java stub declarations for Salesforce platform types to ### Stub Implementation Pattern -Every method follows this exact pattern: +Every file starts with the standard BSD-style copyright header (see below), followed by the package, an optional documentation-link comment, and the class. Every method throws `UnsupportedOperationException`: ```java +/* + Copyright (c) Kevin Jones, All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + */ + +package io.github.apexdevtools.standardtypes.; + // [link to class documentation page] @SuppressWarnings("unused") public class ExampleClass { @@ -35,6 +51,8 @@ public class ExampleClass { } ``` +Copy the header verbatim from an existing file in the same namespace (e.g. `System/MathException.java`), updating only the year. + ### Type Import Rules ⚠️ - **ALWAYS use** `io.github.apexdevtools.standardtypes.System.String` (not `java.lang.String`) @@ -86,7 +104,7 @@ public class InstanceClass { - **⚠️ CRITICAL: Getters/setters**: NEVER auto-generate getter/setter methods. ONLY create methods that are explicitly documented in the Salesforce API documentation. Properties are public fields unless documentation shows otherwise. - **⚠️ CRITICAL: Methods only**: Create ONLY the methods that appear in the official Salesforce documentation. Do not add any convenience methods, utility methods, or standard Java patterns not documented. - **Constructor patterns**: Static method classes have no constructors; instance classes have public default constructor plus any documented constructors -- **Copyright year**: Use current year (2025) for newly created files +- **Copyright year**: Use the current calendar year in the header of newly created files ## Build & Development @@ -98,7 +116,7 @@ mvn install -Dgpg.skip=true # Skip GPG signing for local builds ### Version Strategy -- Versions track Salesforce API releases (e.g., v64.X.X = Summer '25 API) +- Versions track Salesforce API releases (e.g., v67.X.X = Summer '26 API) - Built for Java 1.8 compatibility for wider tooling support ### File Organization @@ -140,7 +158,7 @@ Create `.github/[namespace-name]-todo.md` with a simple structure: ### Adding New Salesforce Types 1. **Determine package location** based on Salesforce namespace mapping -2. **Set copyright year** to current year (2025) for new files +2. **Add the copyright header** (copy from an existing file in the namespace) and set the year to the current calendar year 3. **Preserve documentation order** - maintain alphabetical method/property order from API docs 4. **Choose class pattern**: - Static method classes: No constructors diff --git a/src/main/java/io/github/apexdevtools/standardtypes/System/FormulaEvaluationException.java b/src/main/java/io/github/apexdevtools/standardtypes/System/FormulaEvaluationException.java new file mode 100644 index 00000000..54cb1373 --- /dev/null +++ b/src/main/java/io/github/apexdevtools/standardtypes/System/FormulaEvaluationException.java @@ -0,0 +1,23 @@ +/* + Copyright (c) 2026 Kevin Jones, All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + */ + +package io.github.apexdevtools.standardtypes.System; + +@SuppressWarnings("unused") +public class FormulaEvaluationException extends Exception { + public FormulaEvaluationException() {throw new java.lang.UnsupportedOperationException();} + public FormulaEvaluationException(Exception param1) {throw new java.lang.UnsupportedOperationException();} + public FormulaEvaluationException(String param1) {throw new java.lang.UnsupportedOperationException();} + public FormulaEvaluationException(String param1, Exception param2) {throw new java.lang.UnsupportedOperationException();} +} diff --git a/src/main/java/io/github/apexdevtools/standardtypes/System/FormulaValidationException.java b/src/main/java/io/github/apexdevtools/standardtypes/System/FormulaValidationException.java new file mode 100644 index 00000000..42ff0b77 --- /dev/null +++ b/src/main/java/io/github/apexdevtools/standardtypes/System/FormulaValidationException.java @@ -0,0 +1,23 @@ +/* + Copyright (c) 2026 Kevin Jones, All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + */ + +package io.github.apexdevtools.standardtypes.System; + +@SuppressWarnings("unused") +public class FormulaValidationException extends Exception { + public FormulaValidationException() {throw new java.lang.UnsupportedOperationException();} + public FormulaValidationException(Exception param1) {throw new java.lang.UnsupportedOperationException();} + public FormulaValidationException(String param1) {throw new java.lang.UnsupportedOperationException();} + public FormulaValidationException(String param1, Exception param2) {throw new java.lang.UnsupportedOperationException();} +}